From 1fdcdda2a09e9e0bdfc3cd5615e711f600f300d1 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 24 Jun 1996 19:10:40 +0000 Subject: (diskfs_create_node): Validate mode change before making it. --- libdiskfs/node-create.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdiskfs/node-create.c b/libdiskfs/node-create.c index 6905b5e2..b81cbcf3 100644 --- a/libdiskfs/node-create.c +++ b/libdiskfs/node-create.c @@ -57,6 +57,7 @@ diskfs_create_node (struct node *dir, if (err) goto change_err; np->dn_stat.st_uid = cred->uids[0]; + } else { err = diskfs_validate_owner_change (np, dir->dn_stat.st_uid); @@ -75,9 +76,12 @@ diskfs_create_node (struct node *dir, np->dn_stat.st_gid = dir->dn_stat.st_gid; mode &= ~S_ISGID; } - + np->dn_stat.st_rdev = 0; np->dn_stat.st_nlink = !!name; + err = diskfs_validate_mode_change (np, mode); + if (err) + goto change_err; np->dn_stat.st_mode = mode; np->dn_stat.st_blocks = 0; -- cgit v1.2.3