/[hurdextras]/libfuse/netfs.c
ViewVC logotype

Diff of /libfuse/netfs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.41 by stesie, Fri Dec 9 19:52:37 2005 UTC revision 1.42 by stesie, Fri Dec 9 20:05:02 2005 UTC
# Line 187  netfs_attempt_create_file (struct iouser Line 187  netfs_attempt_create_file (struct iouser
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;
# Line 317  error_t netfs_attempt_mkdir (struct ious Line 303  error_t netfs_attempt_mkdir (struct ious
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.
# Line 642  error_t netfs_attempt_mkdev (struct ious Line 614  error_t netfs_attempt_mkdev (struct ious
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    
# Line 808  error_t netfs_attempt_link (struct iouse Line 765  error_t netfs_attempt_link (struct iouse
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    

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26