[GRASSLIST:4205] Re: mapset permission denied....

Allard, Yannick (EXP) yannick.allard at lmco.com
Fri Aug 2 15:40:34 EDT 2002


	I dont want the other user to write in the mapset but only browse
throught the existing raster files and display them. All UNIX permissions
are correctly set for the read.

	But if the application create another "temporary empty" mapset, will
the other users will be able to browse through the other mapsets ( those
they dont own ) and access the raster files and maybe perform calculations
using those data ??? (the programmer's guide say it should...)

	And how can we create a mapset??? I don't think I've saw it in the
programmer's guide???

	thanks 

	yannick

	
----------------------------------------------------------------------------
>  
> Er, not quite. You are only deemed to have permission to write to a
> mapset if you own it, regardless of the actual Unix permissions on the
> mapset directory:
> 
> 	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;
> 	}
> 
> The set_data program won't allow you to select a mapset for which the
> above function fails.
> 
> Note that simply disabling the check may cause other problems, e.g. 
> you can't have multiple sessions with the same current mapset (due to
> the current region being stored in the mapset directory).
> 
> Basically, every user needs their own private mapset. You can read
> maps from other mapsets, but any new maps are written to the current
> mapset.
> 
> In short, I suspect that your application will need the ability to
> create new mapsets on demand.
> 
> -- 
> Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list