[GRASS-dev] [GRASS GIS] #1704: GRASS 7 cli startup enters into write protected/not owned mapset

#1704: GRASS 7 cli startup enters into write protected/not owned mapset
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
When starting GRASS 7 via command line it lets the user
enter a mapset not belonging to him/her:

{{{
grass70 /grassdata/geostat2012_ll/ecad50_geostat2012
...
Launching <wxpython> GUI in the background, please wait...
GRASS 7.0.svn (geostat2012_ll):/grassdata/geostat2012_ll >
ERROR: MAPSET ecad50_geostat2012 - permission denied
ERROR: MAPSET ecad50_geostat2012 - permission denied

GRASS 7.0.svn (geostat2012_ll):/grassdata/geostat2012_ll > g.list vect
ERROR: MAPSET ecad50_geostat2012 - permission denied
}}}

The wxGUI startup greys out not owned mapsets properly while
the CLI startup is missing this check.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1704&gt;
GRASS GIS <http://grass.osgeo.org>

#1704: GRASS 7 cli startup enters into write protected/not owned mapset
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by neteler):

It also hops over the .gislock test when the mapset is already open in
another session.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1704#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1704: GRASS 7 cli startup enters into write protected/not owned mapset
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by glynn):

Replying to [ticket:1704 neteler]:
> When starting GRASS 7 via command line it lets the user
> enter a mapset not belonging to him/her:

This isn't specific to 7.0. In 6.x, the ownership check is in
etc/set_data, which is only used for interactive startup.

> The wxGUI startup greys out not owned mapsets properly while
> the CLI startup is missing this check.

Something like the following in non_interactive() should work, provided
that g.mapset will work at that point in the startup:
{{{
if mapset not in grass.read_command('g.mapset', flags='l').strip().split()
     fatal(_("<%s> is not a valid mapset") % mapset)
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1704#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1704: GRASS 7 cli startup enters into write protected/not owned mapset
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Changes (by lucadelu):

  * status: new => closed
  * resolution: => fixed

Comment:

Using r62902 version this ticket seems fixed.

I close it, please reopen if needed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1704#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>