lkml.org 
[lkml]   [2006]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/4] permission mapping for sys_syslog operations
On Thu, 14 Dec 2006 17:21:25 -0800 Zack Weinberg wrote:

> On 12/14/06, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > > +#define security_syslog_or_fail(type) do { \
> > > + int error = security_syslog(type); \
> > > + if (error) \
> > > + return error; \
> > > + } while (0)
> > > +
> >
> > From Documentation/CodingStyle:
> >
> > Things to avoid when using macros:
> >
> > 1) macros that affect control flow: ...
>
> It says "avoid", not "never use". If you can think of another way to
> code this function that won't completely obscure the actual operations
> with the security checks, I will be happy to change it.

The usual answer is to just open-code it. You may dislike that,
but hiding control flow in macros is held as really bad by
more than just me.

---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-15 18:11    [W:0.055 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site