187 |
*/ |
*/ |
188 |
err = -FUSE_OP_CALL(mknod, path, (mode & ALLPERMS) | S_IFREG, 0); |
err = -FUSE_OP_CALL(mknod, path, (mode & ALLPERMS) | S_IFREG, 0); |
189 |
|
|
|
/* If available, call chown to make clear which uid/gid to assign to the |
|
|
* new file. Testing with 'fusexmp' I noticed that new files might be |
|
|
* created with wrong gids -- root instead of $user in my case :( |
|
|
* |
|
|
* TODO reconsider whether we should setuid/setgid the FUSE_OP_HAVE(mknod) |
|
|
* call instead (especially if mknod is not available or returns errors) |
|
|
*/ |
|
|
if(! err && FUSE_OP_HAVE(chown)) { |
|
|
assert(user->uids->ids[0]); |
|
|
assert(user->gids->ids[0]); |
|
|
|
|
|
(void)FUSE_OP_CALL(chown, path, user->uids->ids[0], user->gids->ids[0]); |
|
|
} |
|
|
|
|
190 |
out: |
out: |
191 |
if(err) |
if(err) |
192 |
*node = NULL; |
*node = NULL; |
303 |
|
|
304 |
err = -FUSE_OP_CALL(mkdir, path, mode & ALLPERMS); |
err = -FUSE_OP_CALL(mkdir, path, mode & ALLPERMS); |
305 |
|
|
|
/* If available, call chown to make clear which uid/gid to assign to the |
|
|
* new file. Testing with 'fusexmp' I noticed that new files might be |
|
|
* created with wrong gids -- root instead of $user in my case :( |
|
|
* |
|
|
* TODO reconsider whether we should setuid/setgid the FUSE_OP_HAVE(mknod) |
|
|
* call instead (especially if mknod is not available or returns errors) |
|
|
*/ |
|
|
if(! err && FUSE_OP_HAVE(chown)) { |
|
|
assert(user->uids->ids[0]); |
|
|
assert(user->gids->ids[0]); |
|
|
|
|
|
(void)FUSE_OP_CALL(chown, path, user->uids->ids[0], user->gids->ids[0]); |
|
|
} |
|
|
|
|
306 |
out: |
out: |
307 |
/* we don't need to make a netnode already, lookup will be called and do |
/* we don't need to make a netnode already, lookup will be called and do |
308 |
* that for us. |
* that for us. |
614 |
goto out; |
goto out; |
615 |
|
|
616 |
err = -FUSE_OP_CALL(mknod, node->nn->path, |
err = -FUSE_OP_CALL(mknod, node->nn->path, |
617 |
type & (ALLPERMS | S_IFBLK | S_IFCHR), indexes); |
type & (ALLPERMS | S_IFBLK | S_IFCHR), indexes); |
|
|
|
|
/* If available, call chown to make clear which uid/gid to assign to the |
|
|
* new file. Testing with 'fusexmp' I noticed that new files might be |
|
|
* created with wrong gids -- root instead of $user in my case :( |
|
|
* |
|
|
* TODO reconsider whether we should setuid/setgid the FUSE_OP_HAVE(mknod) |
|
|
* call instead (especially if mknod is not available or returns errors) |
|
|
*/ |
|
|
if(! err && FUSE_OP_HAVE(chown)) { |
|
|
assert(cred->uids->ids[0]); |
|
|
assert(cred->gids->ids[0]); |
|
|
|
|
|
(void)FUSE_OP_CALL(chown, node->nn->path, cred->uids->ids[0], |
|
|
cred->gids->ids[0]); |
|
|
} |
|
618 |
|
|
619 |
node->nn->may_need_sync = 1; |
node->nn->may_need_sync = 1; |
620 |
|
|
765 |
/* TODO |
/* TODO |
766 |
* create a netnode with the may_need_sync flag set!! */ |
* create a netnode with the may_need_sync flag set!! */ |
767 |
|
|
|
/* If available, call chown to make clear which uid/gid to assign to the |
|
|
* new file. Testing with 'fusexmp' I noticed that new files might be |
|
|
* created with wrong gids -- root instead of $user in my case :( |
|
|
* |
|
|
* TODO reconsider whether we should setuid/setgid the FUSE_OP_HAVE(mknod) |
|
|
* call instead (especially if mknod is not available or returns errors) |
|
|
*/ |
|
|
/* if(! err && FUSE_OP_HAVE(chown)) |
|
|
* { |
|
|
* assert(user->uids->ids[0]); |
|
|
* assert(user->gids->ids[0]); |
|
|
* |
|
|
* (void)FUSE_OP_CALL(chown, path, user->uids->ids[0], user->gids->ids[0]); |
|
|
* } |
|
|
*/ |
|
|
/* FIXME |
|
|
* This is most probably not a good idea to do here, as it would change |
|
|
* the user and group-id of the other (linked) files as well, sharing the |
|
|
* same inode. |
|
|
*/ |
|
|
|
|
768 |
out: |
out: |
769 |
mutex_unlock(&dir->lock); |
mutex_unlock(&dir->lock); |
770 |
|
|