summaryrefslogtreecommitdiff
path: root/sys/src/cmd/hjfs/fs2.c
diff options
context:
space:
mode:
authormischief <mischief@offblast.org>2018-08-20 12:48:06 -0700
committermischief <mischief@offblast.org>2018-08-20 12:48:06 -0700
commite1907b41d32441e79e8cc3db26afc5f0c4cdcef9 (patch)
treeac1edfe459b071e92c7500cf46c2553a6a0b6f0d /sys/src/cmd/hjfs/fs2.c
parentf8f677b48ebaf490c6d870e8728285bc409789c0 (diff)
hjfs: set group of new files to that of the parent directory (thanks umbraticus)
Diffstat (limited to 'sys/src/cmd/hjfs/fs2.c')
-rw-r--r--sys/src/cmd/hjfs/fs2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/cmd/hjfs/fs2.c b/sys/src/cmd/hjfs/fs2.c
index 8befb2426..064697244 100644
--- a/sys/src/cmd/hjfs/fs2.c
+++ b/sys/src/cmd/hjfs/fs2.c
@@ -108,6 +108,7 @@ chancreat(Chan *ch, char *name, int perm, int mode)
int isdir;
Loc *l;
FLoc f;
+ short pgid;
b = nil;
l = nil;
@@ -150,6 +151,7 @@ chancreat(Chan *ch, char *name, int perm, int mode)
l = getloc(ch->fs, f, ch->loc);
modified(ch, d);
b->op |= BDELWRI;
+ pgid = d->gid;
putbuf(b);
b = nil;
if(willmodify(ch->fs, l, ch->flags & CHFNOLOCK) < 0)
@@ -164,7 +166,8 @@ chancreat(Chan *ch, char *name, int perm, int mode)
strcpy(d->name, name);
d->mtime = time(0);
d->atime = d->mtime;
- d->gid = d->uid = d->muid = ch->uid;
+ d->gid = pgid;
+ d->uid = d->muid = ch->uid;
d->mode = DALLOC | perm & 0777;
if((d->type & QTEXCL) != 0){
qlock(&ch->loc->ex);