Bruce Evans wrote:
> It has too many style bugs for me.  It corrupts all tabs to spaces and
> has some other style bugs.

Resisting the temptation to cut-and-paste (resulting in the lost
tabs), and incorporating your other suggestions, how about this
version?

Thanks,
-Brian

Index: sysv_ipc.c
===================================================================
RCS file: /usr00/mirror/ncvs/src/sys/kern/sysv_ipc.c,v
retrieving revision 1.13
diff -u -r1.13 sysv_ipc.c
--- sysv_ipc.c  2000/02/29 22:58:59     1.13
+++ sysv_ipc.c  2000/03/02 21:45:25
@@ -51,16 +51,11 @@
        int mode;
 {
        struct ucred *cred = p->p_ucred;
-       int error;
 
-       error = suser(p);
-       if (!error)
-               return (0);
-
        /* Check for user match. */
        if (cred->cr_uid != perm->cuid && cred->cr_uid != perm->uid) {
                if (mode & IPC_M)
-                       return (EPERM);
+                       return (suser(p) == 0 ? 0 : EPERM);
                /* Check for group match. */
                mode >>= 3;
                if (!groupmember(perm->gid, cred) &&
@@ -71,7 +66,7 @@
 
        if (mode & IPC_M)
                return (0);
-       return ((mode & perm->mode) == mode ? 0 : EACCES);
+       return ((mode & perm->mode) == mode || suser(p) == 0 ? 0 : EACCES);
 }
 
 #endif /* defined(SYSVSEM) || defined(SYSVSHM) || defined(SYSVMSG) */


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to