[GRASSLIST:5689] Sorry, no access to <<PERMANENT>>.

…bout ready to pull my hair out on this one.

Bottom line: Why does grass deny access to everyone except the owner of the PERMANENT mapset??

Background:

Trying to work with the demo data provided with GRASS (global and spearfish). The data are stored on my disk as follows

/home/grass_data

|- global/

| |- PERMANENT/

| |- grasslinksX/ : other mapsets

|- spearfish/

| |- PERMANENT/

| |- grasslinksX/ : other mapsets

User X installed the data so user X owns all the files that were placed in the DATABASE (/home/grass_data). User X wants to share his mapsets with everyone so user X foolishly gives read/write access to the world on every file in the database (chmod –R 777 /home/grass_data).

User Y would like to read the GRASS database setup by user X. GRASS denys access to user Y with the following message:

Sorry, no access to <>.

Mapsets in location


grasslinks0 grasslinks1 grasslinks2

grasslinks3 PERMANENT

note: you do not have access to any of these mapsets


Hit RETURN →

No matter what (yes I’ve tried g.access) GRASS will not allow anyone but the owner to access PERMANENT. This flies in the face of the documentation.

Any comments on this behavior?

Md

PS. Here’s the kicker, in my scenario, user Y is ….root. Hmmm, when root can’t do it, something’s not right!!! (also tried others as “user Y” and got the same thing).

PPS. Same behavior in grass4.3 and grass5.0.1.

Matt Doggett

Spatial Climate Analysis Service

Oregon State University

316 Strand Ag Hall

Corvallis, OR 97331

(541)737-9153

mdoggett@coas.oregonstate.edu

Matt Doggett wrote:

.bout ready to pull my hair out on this one.

Bottom line: Why does grass deny access to *everyone* except the owner
of the PERMANENT mapset??

At the implementation level, the reason is:

  /****************************************************************
  * G__mapset_permissions (mapset)
  *
  * returns: 1 mapset exists, and user has permission
  * 0 mapset exists, BUT user denied permission
  * -1 mapset does not exist
  ****************************************************************/
  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;
  }

At a design level, the reason is ... well, your guess is as probably
as good as anyone else's. Whoever originally implemented this
presumably had their reasons, but I doubt that any of the current
developers would be able to justify it.

--
Glynn Clements <glynn.clements@virgin.net>