Module Name: src Committed By: markd Date: Sat Apr 11 11:59:05 UTC 2009
Modified Files: src/sys/fs/tmpfs: tmpfs_subr.c Log Message: For chown make auth checks consistent with UFS. Fixes PR kern/40933. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/fs/tmpfs/tmpfs_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/tmpfs/tmpfs_subr.c diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.49 src/sys/fs/tmpfs/tmpfs_subr.c:1.50 --- src/sys/fs/tmpfs/tmpfs_subr.c:1.49 Fri Apr 10 03:40:05 2009 +++ src/sys/fs/tmpfs/tmpfs_subr.c Sat Apr 11 11:59:04 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_subr.c,v 1.49 2009/04/10 03:40:05 yamt Exp $ */ +/* $NetBSD: tmpfs_subr.c,v 1.50 2009/04/11 11:59:04 markd Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.49 2009/04/10 03:40:05 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.50 2009/04/11 11:59:04 markd Exp $"); #include <sys/param.h> #include <sys/dirent.h> @@ -1099,7 +1099,7 @@ * several other file systems. Shouldn't this be centralized * somewhere? */ if ((kauth_cred_geteuid(cred) != node->tn_uid || uid != node->tn_uid || - (gid != node->tn_gid && !(kauth_cred_getegid(cred) == node->tn_gid || + (gid != node->tn_gid && !(kauth_cred_getegid(cred) == gid || (kauth_cred_ismember_gid(cred, gid, &ismember) == 0 && ismember)))) && ((error = kauth_authorize_generic(cred, KAUTH_GENERIC_ISSUSER, NULL)) != 0))