[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Linux-cluster] patch for gfs, add suiddir option for mount



Hi linux-cluster,

I apologize for the previous letter, here full patch

suiddir option for mount
man 8 mount (FreeBSD)

*** gfs_ioctl.h.orig    2004-07-14 13:54:39.000000000 +0400
--- gfs_ioctl.h 2004-07-14 13:57:38.000000000 +0400
***************
*** 213,218 ****
--- 213,219 ----
        unsigned int ar_num_glockd;

        int ar_posixacls;       /* Enable posix acls */
+       int ar_suiddir;         /* suiddir support */
  };

  #endif /* ___GFS_IOCTL_DOT_H__ */
*** inode.c.orig        2004-07-15 19:52:33.000000000 +0400
--- inode.c     2004-07-15 19:55:36.000000000 +0400
***************
*** 1132,1138 ****
        struct posix_acl *acl = NULL;
        struct gfs_alloc *al;
        struct gfs_inode *ip;
!       unsigned int gid;
        int alloc_required;
        int error;
  
--- 1132,1138 ----
        struct posix_acl *acl = NULL;
        struct gfs_alloc *al;
        struct gfs_inode *ip;
!       unsigned int gid, uid;
        int alloc_required;
        int error;
  
***************
*** 1148,1162 ****
        else
                gid = current->fsgid;
  
        al = gfs_alloc_get(dip);
  
        error = gfs_quota_lock_m(dip,
!                                current->fsuid,
                                 gid);
        if (error)
                goto fail;
  
!       error = gfs_quota_check(dip, current->fsuid, gid);
        if (error)
                goto fail_gunlock_q;
  
--- 1148,1172 ----
        else
                gid = current->fsgid;
  
+       if ( (sdp->sd_args.ar_suiddir == TRUE) 
+             && (dip->i_di.di_mode & S_ISUID) ) {
+               if (type == GFS_FILE_DIR)
+                       mode |= S_ISUID;
+               uid = dip->i_di.di_uid;
+               gid = dip->i_di.di_gid;
+       }
+       else
+               uid = current->fsuid;
+ 
        al = gfs_alloc_get(dip);
  
        error = gfs_quota_lock_m(dip,
!                                uid,
                                 gid);
        if (error)
                goto fail;
  
!       error = gfs_quota_check(dip, uid, gid);
        if (error)
                goto fail_gunlock_q;
  
***************
*** 1206,1212 ****
        if (error)
                goto fail_end_trans;
  
!       error = make_dinode(dip, gl, inum, type, mode, current->fsuid, gid);
        if (error)
                goto fail_end_trans;
  
--- 1216,1222 ----
        if (error)
                goto fail_end_trans;
  
!       error = make_dinode(dip, gl, inum, type, mode, uid, gid);
        if (error)
                goto fail_end_trans;
*** mount.c.orig        2004-06-24 12:53:28.000000000 +0400
--- mount.c     2004-07-14 13:59:36.000000000 +0400
***************
*** 110,115 ****
--- 110,118 ----
                else if (!strcmp(x, "upgrade"))
                        args->ar_upgrade = TRUE;

+               else if (!strcmp(x, "suiddir"))
+                       args->ar_suiddir = TRUE;
+
                else if (!strcmp(x, "num_glockd")) {
                        if (!y) {
                                printk("GFS: need argument to num_glockd\n");  

  

-- 
e-mail: anton hq 310 ru
http://www.310.ru


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]