Hi,
Would something like the attached patch work out for you?
Eventually, I will add the nosuid export option as part of the
ExportOptions configuration patches that I havent finished yet. But for
now, this should help..
Thanks,
Murali

On Thu, 22 Dec 2005, Rick Light wrote:

> Hi All,
>
> I've run into a snag...
>
> I have version 1.3.2 of PVFS2 installed and running on a single linux box.
> When I issue the following command, it dies as follows:
>
> chmod u+s /mnt/pvfs2/rxl/xxx
> chmod: changing permissions of `/mnt/pvfs2/rxl/xxx': Invalid argument
>
> It appears that no matter what I do, suid cannot be set for PVFS2 files.
> I've tried pvfs2-chmod and chmod both with both numeric and text (u+s)
> arguments.
> None of them work.  I've also tried various things with the mount
> command options,
> to no avail.
>
> Can anyone shed some light on this?  Should this work?  Is there
> something I can do to
> get it to work?
>
> I need this in order for some automated tests to run, the code for which
> is not mine
> and very much something I don't want to dig in and change.
>
> Thanks in advance for your help.
>
> Best regards,
>
>    Rick
>
> Rick Light
> Los Alamos National Lab
> 505-667-0744
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> PVFS2-developers mailing list
> [email protected]
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
>
diff -Naur --exclude doc pvfs2-1.3.2/include/pvfs2-types.h 
pvfs2-new/include/pvfs2-types.h
--- pvfs2-1.3.2/include/pvfs2-types.h   2005-12-02 09:55:47.000000000 -0600
+++ pvfs2-new/include/pvfs2-types.h     2005-12-22 17:26:33.000000000 -0600
@@ -162,13 +162,13 @@
 #define PVFS_U_READ    (1 << 8)
 /* no PVFS_U_VTX (sticky bit) */
 #define PVFS_G_SGID    (1 << 10)
-/* no PVFS_U_SGID */
+#define PVFS_U_SUID    (1 << 11)
 
 /* valid permission mask */
 #define PVFS_PERM_VALID \
 (PVFS_O_EXECUTE | PVFS_O_WRITE | PVFS_O_READ | PVFS_G_EXECUTE | \
  PVFS_G_WRITE | PVFS_G_READ | PVFS_U_EXECUTE | PVFS_U_WRITE | \
- PVFS_U_READ | PVFS_G_SGID)
+ PVFS_U_READ | PVFS_G_SGID | PVFS_U_SUID)
 
 #define PVFS_USER_ALL  (PVFS_U_EXECUTE|PVFS_U_WRITE|PVFS_U_READ)
 #define PVFS_GROUP_ALL (PVFS_G_EXECUTE|PVFS_G_WRITE|PVFS_G_READ)
diff -Naur --exclude doc pvfs2-1.3.2/include/pvfs2-util.h 
pvfs2-new/include/pvfs2-util.h
--- pvfs2-1.3.2/include/pvfs2-util.h    2005-12-02 09:55:47.000000000 -0600
+++ pvfs2-new/include/pvfs2-util.h      2005-12-22 17:38:47.000000000 -0600
@@ -97,22 +97,22 @@
 static inline int PVFS2_translate_mode(int mode)
 {
     int ret = 0, i = 0;
-    static int modes[10] =
+    static int modes[11] =
     {
         S_IXOTH, S_IWOTH, S_IROTH,
         S_IXGRP, S_IWGRP, S_IRGRP,
         S_IXUSR, S_IWUSR, S_IRUSR,
-        S_ISGID
+        S_ISGID, S_ISUID
     };
-    static int pvfs2_modes[10] =
+    static int pvfs2_modes[11] =
     {
         PVFS_O_EXECUTE, PVFS_O_WRITE, PVFS_O_READ,
         PVFS_G_EXECUTE, PVFS_G_WRITE, PVFS_G_READ,
         PVFS_U_EXECUTE, PVFS_U_WRITE, PVFS_U_READ,
-        PVFS_G_SGID
+        PVFS_G_SGID,    PVFS_U_SUID
     };
 
-    for(i = 0; i < 10; i++)
+    for(i = 0; i < 11; i++)
     {
         if (mode & modes[i])
         {
diff -Naur --exclude doc pvfs2-1.3.2/src/kernel/linux-2.6/pvfs2-utils.c 
pvfs2-new/src/kernel/linux-2.6/pvfs2-utils.c
--- pvfs2-1.3.2/src/kernel/linux-2.6/pvfs2-utils.c      2005-12-02 
09:55:50.000000000 -0600
+++ pvfs2-new/src/kernel/linux-2.6/pvfs2-utils.c        2005-12-22 
17:39:15.000000000 -0600
@@ -161,6 +161,8 @@
 
         if (attrs->perms & PVFS_G_SGID)
             perm_mode |= S_ISGID;
+        if (attrs->perms & PVFS_U_SUID)
+            perm_mode |= S_ISUID;
 
         inode->i_mode |= perm_mode;
         /* NOTE: this will change once we move from the iget() model to the
@@ -292,9 +294,9 @@
         if (iattr && (iattr->ia_valid & ATTR_MODE))
         {
             pvfs2_print("[1] converting attr mode %d\n", iattr->ia_mode);
-            if((iattr->ia_mode & (S_ISUID|S_ISVTX)) != 0)
+            if((iattr->ia_mode & S_ISVTX) != 0)
             {
-                pvfs2_print("User attempted to set setuid or sticky bit; "
+                pvfs2_print("User attempted to set sticky bit; "
                     "returning EINVAL.\n");
                 return(-EINVAL);
             }
@@ -304,9 +306,9 @@
         else
         {
             pvfs2_print("[2] converting attr mode %d\n", inode->i_mode); 
-            if((inode->i_mode & (S_ISUID|S_ISVTX)) != 0)
+            if((inode->i_mode & S_ISVTX) != 0)
             {
-                pvfs2_print("User attempted to set setuid or sticky bit; "
+                pvfs2_print("User attempted to set sticky bit; "
                     "returning EINVAL.\n");
                 return(-EINVAL);
             }
_______________________________________________
PVFS2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to