tmpfs - fix chgrp(), or chown() when one of uid/gid is to be unchanged
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Mon, 22 Nov 2010 02:35:48 +0000 (11:35 +0900)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Mon, 29 Nov 2010 04:13:44 +0000 (13:13 +0900)
uid/gid values from function arguments were being used instead of the ones
arranged by vop_helper_chown(), accidentally setting one of them to -1
(4294967295) instead of leaving it unchanged.

sys/vfs/tmpfs/tmpfs_subr.c

index 1798186..2933a8b 100644 (file)
@@ -1146,8 +1146,8 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred)
                if (cur_uid != node->tn_uid ||
                    cur_gid != node->tn_gid ||
                    cur_mode != node->tn_mode) {
-                       node->tn_uid = uid;
-                       node->tn_gid = gid;
+                       node->tn_uid = cur_uid;
+                       node->tn_gid = cur_gid;
                        node->tn_mode = cur_mode;
                        node->tn_status |= TMPFS_NODE_CHANGED;
                }