<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<pre>Dear grass comunity,</pre>
<pre> Yesterday for the first time since I use grass, I have been</pre>
<pre>faced with an interesting question:</pre>
<pre> can different users work on the same mapset ?</pre>
<pre>So I tried, I played with unix privileges moved mapsets changed user</pre>
<pre>and group etc. etc. and discovered that finally THE ANSWER IS NO !!!</pre>
<pre>at lest not in grass5beta3 on alinux RH6.0 (posix compliant) platform.</pre>
<pre></pre>
<pre>Well, this is a little bit strange. Why shouldn't be possible in a</pre>
<pre>multi user environment such as unix to use the same mapset under</pre>
<pre>different usernames (maybe in the same group) ?</pre>
<pre>This could be very usefull especially for large projects whit many</pre>
<pre>people involved in.</pre>
<pre>The problem is in a GRASS GIS library call G__mapset_permissions,</pre>
<pre>that looks like:</pre>
<pre>int G__mapset_permissions (char *mapset)
{
char path[256];
struct stat info;
G__file_name (path,"","",mapset);
if (stat (path, &info) != 0)
return -1;
if (info.st_uid != getuid())
return 0;
if (info.st_uid != geteuid())
return 0;
return 1;
}
Simple, everytime that a call access mapsets data a check is done</pre>
<pre>for the userid of the mapsets file to be equal to that of real and</pre>
<pre>effective ids of the invoking process. So if I own a mapset I can</pre>
<pre>work on it, if I do not own it I cannot regardeless of the unix</pre>
<pre>mapsets files privileges.</pre>
<pre>I have only one question, why ? I do not understand this idea.</pre>
<pre></pre>
<pre>Ok so I went forward and changed a little bit the code. But if we</pre>
<pre>release this constraint by for example commenting the last two ifs</pre>
<pre>in the call, we will have to check for access permission to the mapsets.</pre>
<pre>This is done at start time in gis_set. I've done some work on that</pre>
<pre>and modified the gis_set and the g.access programs.</pre>
<pre>Anyhow at this stage I do not think it is a good idea to post my bugfixes,</pre>
<pre>that are to be considered much more as tournarounds. A sound understanding</pre>
<pre>of the global grass structure and clear objectives on how to manage mapset</pre>
<pre>permissions are needed in order to produce a proper code.</pre>
<pre>So here I just want to point out that THIS IS AN IMPORTANT ISSUE. Clearly</pre>
<pre>if somebody is interested in having my patch I can send it. But I would first</pre>
<pre>like to understand the developping strategy beneath the G__mapset_permissions</pre>
<pre>call.</pre>
<pre></pre>
<pre>Comments are welcome</pre>
<pre>LP</pre>
<pre></pre>
<pre>--> Luca Palmeri - Dip. Proc. Chimici dell'Ingengeria
Universita' di Padova TEL: +390498275527 -------
------------------------- FAX: +390498275528 -------
--> Think holistic @ the end of the 2nd millenium <--</pre>
</html>