hjfs: dont mask permission bits for "create" console command
This commit is contained in:
parent
6dc133ad99
commit
63f1fc07eb
|
@ -148,7 +148,7 @@ cmdcreate(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
if(name2uid(fsmain, argv[3], &gid) < 0)
|
if(name2uid(fsmain, argv[3], &gid) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
ch = chanattach(fsmain, 0);
|
ch = chanattach(fsmain, CHFNOPERM);
|
||||||
if(ch == nil)
|
if(ch == nil)
|
||||||
return -1;
|
return -1;
|
||||||
ch->uid = uid;
|
ch->uid = uid;
|
||||||
|
|
|
@ -132,17 +132,19 @@ chancreat(Chan *ch, char *name, int perm, int mode)
|
||||||
werrstr(Enotadir);
|
werrstr(Enotadir);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if((ch->flags & CHFNOPERM) == 0)
|
if((ch->flags & CHFNOPERM) == 0){
|
||||||
if(!permcheck(ch->fs, d, ch->uid, OWRITE)){
|
if(!permcheck(ch->fs, d, ch->uid, OWRITE)){
|
||||||
werrstr(Eperm);
|
werrstr(Eperm);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if(newentry(ch->fs, ch->loc, b, name, &f, 0) <= 0)
|
|
||||||
goto error;
|
|
||||||
if(isdir)
|
if(isdir)
|
||||||
perm &= ~0777 | d->mode & 0777;
|
perm &= ~0777 | d->mode & 0777;
|
||||||
else
|
else
|
||||||
perm &= ~0666 | d->mode & 0666;
|
perm &= ~0666 | d->mode & 0666;
|
||||||
|
}
|
||||||
|
if(newentry(ch->fs, ch->loc, b, name, &f, 0) <= 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
f.type = perm >> 24;
|
f.type = perm >> 24;
|
||||||
if(newqid(ch->fs, &f.path) < 0)
|
if(newqid(ch->fs, &f.path) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in a new issue