[GRASS-user] Re: user/group permissions for accessing data on mounted drive

Glynn Clements glynn at gclements.plus.com
Tue Aug 18 00:26:49 EDT 2009


Tim Michelsen wrote:

> > It could, but that replaces one problem (using FAT filesystems on
> > Unix) with another (users accidentally trashing other users' mapsets).
> > 
> >> See the following use case:
> >> A desktop/notebook used by a group of people. Of course, these collegues 
> >> would not work on this machine simultaniously but log in at different 
> >> times with different user names.
> >>
> >> Any solutions?
> > 
> > The ideal solution is to skip the ownership check on filesystems which
> > don't have any concept of ownership. Unfortunately, I'm not sure how
> > to detect that.
> 
> In python os module I found something that may be used:
> http://docs.python.org/library/os.html?highlight=filesystem#os.fstatvfs
> http://docs.python.org/library/statvfs.html?highlight=filesystem

I can't see how statvfs() could help. statfs() might help, although
it's Linux-specific. getmntent() is another option, although I don't
know how to reliably get the path to the mtab file (it's not safe to
assume that it's /etc/mtab; some systems put it in e.g. /var/run/mtab
so that the root filesystem can be mounted read-only).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list