[GRASS-user] how to enable write access for the UNIX group?

Maciej Sieczka tutey at o2.pl
Mon Sep 24 05:53:21 EDT 2007


Glynn wrote:
>Maciej Sieczka wrote:

>> How do enable members of a UNIX group to have write access to shared
>> GRASS locations/mapsets from GRASS?
>>
>> To check if that's possible with umask, I do:
>>
>> $ umask 6
>> $ grass63
>> (setup new location, create mapsets)
>>
>> The location and mapsets directories are created with 771 rights. The
>> dbf subdir too. WIND, DEFAULT_WIND, MYNAME, .gislock and .bashrc files
>> are created with 660. Good. But, any newly created mapset elements
>> (subdirs for vectors, raster etc.) still have only read access for the
>> group. Do GRASS commands ignore umask setting?

>They shouldn't. Any libgis functions which create directories use
>G_mkdir(), which uses 0777. The only references to chmod() are for the
>session directory (/tmp/grass6-<user>-<pid> on Unix) and G_rc_path().
>There are no calls to umask() in libgis.
>
>Similarly, the raster files are created as 0666, while the vector
>library uses G_fopen_new(), which uses G__open(), which uses 0666.
>
>FWIW, I can't reproduce the problem:
>
>$ rm -rf /opt/grass-data/spearfish57/glynn/windows
>$ umask 0000
>$ g.region save=foo
>$ ls -ld /opt/grass-data/spearfish57/glynn/windows
>drwxrwxrwx 2 glynn users 4096 Sep 24 00:58
/opt/grass-data/spearfish57/glynn/windows/
>$ ls -l /opt/grass-data/spearfish57/glynn/windows
>total 4
>-rw-rw-rw- 1 glynn users 287 Sep 24 00:58 foo
>$ umask 0022
>$ rm -rf /opt/grass-data/spearfish57/glynn/windows
>$ g.region save=foo
>$ ls -ld /opt/grass-data/spearfish57/glynn/windows
>drwxr-xr-x 2 glynn users 4096 Sep 24 00:58
/opt/grass-data/spearfish57/glynn/windows/
>$ ls -l /opt/grass-data/spearfish57/glynn/windows
>total 4
>-rw-r--r-- 1 glynn users 287 Sep 24 00:58 foo

Glynn,

Please note that I run umask *before* entering GRASS, while you do it
*after*. Shouldn't GRASS session preserve umask set before entering it? It
doesn't. It forces 0022 instead:

$ umask 2
$ umask
0002
$ grass63
$ umask
0022
$ exit
$ umask
0002

Maciek

-- 
View this message in context: http://www.nabble.com/how-to-enable-write-access-for-the-UNIX-group--tf4505070.html#a12856927
Sent from the Grass - Users mailing list archive at Nabble.com.




More information about the grass-user mailing list