diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-03-11 00:03:05 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-03-11 00:03:05 +0000 |
commit | f88d24f3afe66987167e029835e122a5cea90dad (patch) | |
tree | 1f0b2b6bff414407fcc3d11c2411082dd96da39e | |
parent | e93b6dc1a02e900dfd0f1c0182dc86e18ef843ef (diff) |
Formerly dir-init.c.~4~
-rw-r--r-- | libdiskfs/dir-init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libdiskfs/dir-init.c b/libdiskfs/dir-init.c index 83def220..d7162253 100644 --- a/libdiskfs/dir-init.c +++ b/libdiskfs/dir-init.c @@ -28,14 +28,17 @@ diskfs_init_dir (struct node *dp, struct node *pdp, struct protid *cred) struct dirstat *ds = alloca (diskfs_dirstat_size); struct node *foo; error_t err; - + static uid_t zero = 0; + static struct protid lookupcred = {uids: &zero, gids: &zero, + nuids: 1, ngids: 1}; + /* New links */ if (pdp->dn_stat.st_nlink == diskfs_link_max - 1) return EMLINK; dp->dn_stat.st_nlink++; /* for `.' */ dp->dn_set_ctime = 1; - err = diskfs_lookup (dp, ".", CREATE, &foo, ds, cred); + err = diskfs_lookup (dp, ".", CREATE, &foo, ds, &lookupcred); assert (err == ENOENT); err = diskfs_direnter (dp, ".", dp, ds, cred); if (err) @@ -47,7 +50,7 @@ diskfs_init_dir (struct node *dp, struct node *pdp, struct protid *cred) pdp->dn_stat.st_nlink++; /* for `..' */ pdp->dn_set_ctime = 1; - err = diskfs_lookup (dp, "..", CREATE, &foo, ds, cred); + err = diskfs_lookup (dp, "..", CREATE, &foo, ds, &lookupcred); assert (err == ENOENT); err = diskfs_direnter (dp, "..", pdp, ds, cred); if (err) |