summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Siegl <stesie@brokenpipe.de>2005-12-09 20:05:02 +0000
committerStefan Siegl <stesie@brokenpipe.de>2005-12-09 20:05:02 +0000
commit54774a92372f3064d3c09968792d76d0b731009d (patch)
treedc11bf1ea37ec3f7eb1be2dde2448c6d7a23d8f5
parent5c2acce36614e8905dfd98eb59286a55a5f6e607 (diff)
don't call chown to make sure, files created with the fusexmp-translator have the creator's uid, not the translator's one. Fuse/Linux doesn't care for this, so we don't either to be consistent.
-rw-r--r--netfs.c66
1 files changed, 1 insertions, 65 deletions
diff --git a/netfs.c b/netfs.c
index 1504f9d67..15bec49f5 100644
--- a/netfs.c
+++ b/netfs.c
@@ -187,20 +187,6 @@ netfs_attempt_create_file (struct iouser *user, struct node *dir,
*/
err = -FUSE_OP_CALL(mknod, path, (mode & ALLPERMS) | S_IFREG, 0);
- /* 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]);
- }
-
out:
if(err)
*node = NULL;
@@ -317,20 +303,6 @@ error_t netfs_attempt_mkdir (struct iouser *user, struct node *dir,
err = -FUSE_OP_CALL(mkdir, path, mode & ALLPERMS);
- /* 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]);
- }
-
out:
/* we don't need to make a netnode already, lookup will be called and do
* that for us.
@@ -642,22 +614,7 @@ error_t netfs_attempt_mkdev (struct iouser *cred, struct node *node,
goto out;
err = -FUSE_OP_CALL(mknod, node->nn->path,
- 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]);
- }
+ type & (ALLPERMS | S_IFBLK | S_IFCHR), indexes);
node->nn->may_need_sync = 1;
@@ -808,27 +765,6 @@ error_t netfs_attempt_link (struct iouser *user, struct node *dir,
/* TODO
* create a netnode with the may_need_sync flag set!! */
- /* 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.
- */
-
out:
mutex_unlock(&dir->lock);