gluster/hadoop-glusterfs — pull request #32 by childsb (2013-05-10 20:19:29+00:00)
Title: Run the getFattr() command as root in the shim and provide an example sudoers tweak to allow it.

The hadoop-glusterfs shim needs to run getfattr -m . -n trusted.glusterfs.pathinfo to determine block location and replication for a given file. The "trusted" namespace of the extended attribute is only accessible to privileged (ie root) user.

Unfortunately, the shim code can run as unprivileged users (ex. in ambari), and won't have access to the trusted namespace as the unprivileged user.

I propose the two part fix in this pull request which does not pose a security problem based on these observations:

a) the unprivileged user is restricted to running only the getfattr(...) command by the sudoers file.

b) there's no way to modify the file system through this getfattr as it only reads attributes and won't set them.

b) if the sys admin wishes to further restrict the scope of the getfattr command, they could by restricting the allowed parameters to getfattr.

*Note 1: The sudoers example entry provided is the least restrictive method and not meant to represent the most secure way of running getfattr. The sys admin should understand the implications and may want to add finer grained restrictions.