--- scm.c Mon Mar 2 21:02:26 1998
+++ scm.c.new Thu Apr 23 02:33:27 1998
@@ -45,18 +45,16 @@
static __inline__ int scm_check_creds(struct ucred *creds)
{
- /* N.B. The test for suser should follow the credential check */
- if (suser())
+ if (creds->pid == current->pid &&
+ (creds->uid == current->uid || creds->uid == current->euid ||
+ creds->uid == current->suid) &&
+ (creds->gid == current->gid || creds->gid == current->egid ||
+ creds->gid == current->sgid))
return 0;
- if (creds->pid != current->pid ||
- (creds->uid != current->uid && creds->uid != current->euid &&
- creds->uid != current->suid) ||
- (creds->gid != current->gid && creds->gid != current->egid &&
- creds->gid != current->sgid))
- return -EPERM;
- return 0;
+ if (capable(CAP_SETUID))
+ return 0;
+ return -EPERM;
}
-
static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
{
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu