summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-03-11 00:03:05 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-03-11 00:03:05 +0000
commitf88d24f3afe66987167e029835e122a5cea90dad (patch)
tree1f0b2b6bff414407fcc3d11c2411082dd96da39e
parente93b6dc1a02e900dfd0f1c0182dc86e18ef843ef (diff)
Formerly dir-init.c.~4~
-rw-r--r--libdiskfs/dir-init.c9
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)