hjfs: set group of new files to that of the parent directory (thanks umbraticus)
This commit is contained in:
parent
f8f677b48e
commit
e1907b41d3
|
@ -108,6 +108,7 @@ chancreat(Chan *ch, char *name, int perm, int mode)
|
||||||
int isdir;
|
int isdir;
|
||||||
Loc *l;
|
Loc *l;
|
||||||
FLoc f;
|
FLoc f;
|
||||||
|
short pgid;
|
||||||
|
|
||||||
b = nil;
|
b = nil;
|
||||||
l = nil;
|
l = nil;
|
||||||
|
@ -150,6 +151,7 @@ chancreat(Chan *ch, char *name, int perm, int mode)
|
||||||
l = getloc(ch->fs, f, ch->loc);
|
l = getloc(ch->fs, f, ch->loc);
|
||||||
modified(ch, d);
|
modified(ch, d);
|
||||||
b->op |= BDELWRI;
|
b->op |= BDELWRI;
|
||||||
|
pgid = d->gid;
|
||||||
putbuf(b);
|
putbuf(b);
|
||||||
b = nil;
|
b = nil;
|
||||||
if(willmodify(ch->fs, l, ch->flags & CHFNOLOCK) < 0)
|
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);
|
strcpy(d->name, name);
|
||||||
d->mtime = time(0);
|
d->mtime = time(0);
|
||||||
d->atime = d->mtime;
|
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;
|
d->mode = DALLOC | perm & 0777;
|
||||||
if((d->type & QTEXCL) != 0){
|
if((d->type & QTEXCL) != 0){
|
||||||
qlock(&ch->loc->ex);
|
qlock(&ch->loc->ex);
|
||||||
|
|
Loading…
Reference in a new issue