Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ext2fs update i_uid and i_gid after chown



details:   https://anonhg.NetBSD.org/src/rev/7b838a1fcbbc
branches:  trunk
changeset: 748350:7b838a1fcbbc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Oct 21 17:37:21 2009 +0000

description:
update i_uid and i_gid after chown

diffstat:

 sys/ufs/ext2fs/ext2fs_extern.h |  3 ++-
 sys/ufs/ext2fs/ext2fs_vfsops.c |  7 +++----
 sys/ufs/ext2fs/ext2fs_vnops.c  |  8 +++++---
 3 files changed, 10 insertions(+), 8 deletions(-)

diffs (82 lines):

diff -r fa081493655a -r 7b838a1fcbbc sys/ufs/ext2fs/ext2fs_extern.h
--- a/sys/ufs/ext2fs/ext2fs_extern.h    Wed Oct 21 17:16:11 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_extern.h    Wed Oct 21 17:37:21 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_extern.h,v 1.41 2009/10/19 18:41:17 bouyer Exp $        */
+/*     $NetBSD: ext2fs_extern.h,v 1.42 2009/10/21 17:37:21 pooka Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -138,6 +138,7 @@
 int ext2fs_flushfiles(struct mount *, int);
 int ext2fs_sbupdate(struct ufsmount *, int);
 int ext2fs_cgupdate(struct ufsmount *, int);
+void ext2fs_set_inode_guid(struct inode *);
 
 /* ext2fs_readwrite.c */
 int ext2fs_read(void *);
diff -r fa081493655a -r 7b838a1fcbbc sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c    Wed Oct 21 17:16:11 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c    Wed Oct 21 17:37:21 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vfsops.c,v 1.151 2009/10/19 18:41:17 bouyer Exp $       */
+/*     $NetBSD: ext2fs_vfsops.c,v 1.152 2009/10/21 17:37:21 pooka Exp $        */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.151 2009/10/19 18:41:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.152 2009/10/21 17:37:21 pooka Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -106,7 +106,6 @@
 
 int ext2fs_sbupdate(struct ufsmount *, int);
 static int ext2fs_checksb(struct ext2fs *, int);
-static void ext2fs_set_inode_guid(struct inode *);
 
 static struct sysctllog *ext2fs_sysctl_log;
 
@@ -164,7 +163,7 @@
 };
 
 /* Fill in the inode uid/gid from ext2 halves.  */
-static void
+void
 ext2fs_set_inode_guid(struct inode *ip)
 {
 
diff -r fa081493655a -r 7b838a1fcbbc sys/ufs/ext2fs/ext2fs_vnops.c
--- a/sys/ufs/ext2fs/ext2fs_vnops.c     Wed Oct 21 17:16:11 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c     Wed Oct 21 17:37:21 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vnops.c,v 1.90 2009/10/19 18:41:17 bouyer Exp $ */
+/*     $NetBSD: ext2fs_vnops.c,v 1.91 2009/10/21 17:37:21 pooka Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.90 2009/10/19 18:41:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.91 2009/10/21 17:37:21 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -502,8 +502,10 @@
                ip->i_e2fs_gid_high = 0;
                ip->i_e2fs_uid_high = 0;
        }
-       if (ouid != uid || ogid != gid)
+       if (ouid != uid || ogid != gid) {
+               ext2fs_set_inode_guid(ip);
                ip->i_flag |= IN_CHANGE;
+       }
        if (ouid != uid && kauth_authorize_generic(cred,
            KAUTH_GENERIC_ISSUSER, NULL) != 0)
                ip->i_e2fs_mode &= ~ISUID;



Home | Main Index | Thread Index | Old Index