[Pvfs2-developers] patch: sticky/setuid error handling

Sam Lang slang at mcs.anl.gov
Wed Nov 7 17:28:53 EST 2007


On Oct 12, 2007, at 4:03 PM, Phil Carns wrote:

> This patch is not a bug fix.  I doubt that anyone wants this  
> behavior, but I am sharing the patch just in case.  It causes PVFS  
> to _not_ report an error if a user attempts to set unsupported  
> sticky or setuid bits on a file or directory.  It is mainly helpful  
> if you have a 3rd party application that insists on setting those  
> bits and you don't want PVFS to complain about it.

Yeah, weird usage.  Does this app fail on error from the setuid, but  
already has the proper permissions?

-sam

>
> -Phil
> Index: pvfs2_src/src/kernel/linux-2.6/pvfs2-utils.c
> ===================================================================
> --- pvfs2_src/src/kernel/linux-2.6/pvfs2-utils.c	(revision 2658)
> +++ pvfs2_src/src/kernel/linux-2.6/pvfs2-utils.c	(revision 2659)
> @@ -383,17 +383,25 @@
>              }
>              else
>              {
> +/* just return success if user requests sticky bit */
> +                tmp_mode -= S_ISVTX;
> +#if 0
>                  gossip_debug(GOSSIP_UTILS_DEBUG, "User attempted  
> to set sticky bit"
>                          "on non-root directory; returning EINVAL. 
> \n");
>                  return(-EINVAL);
> +#endif
>              }
>          }
>
>          if (tmp_mode & (S_ISUID))
>          {
> +/* just return success if user requests setuid bit */
> +            tmp_mode -= S_ISUID;
> +#if 0
>              gossip_debug(GOSSIP_UTILS_DEBUG, "Attempting to set  
> setuid bit "
>                      "(not supported); returning EINVAL.\n");
>              return(-EINVAL);
> +#endif
>          }
>
>          convert_attribute_mode_to_pvfs_sys_attr(
> _______________________________________________
> Pvfs2-developers mailing list
> Pvfs2-developers at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers



More information about the Pvfs2-developers mailing list