On Fri, 27 May 2011 15:54:02 PDT, Andi Kleen said: > @@ -2578,5 +2580,10 @@ int __init get_filesystem_list(char *buf); > #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ > (flag & __FMODE_NONOTIFY))) > > +static inline int is_sgid(mode_t mode) > +{ > + return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); > +} > + There has *got* to be a better name for this function. And having said that, I'm not convinced it's the *right* check - on an SELinux system, pretty much *all* the files have a security xattr attached to them, and very few are actually setuid/setgid. So 98% of the time, or more, this will DTWT.
Attachment:
pgphiP8P56VOZ.pgp
Description: PGP signature