Opened 12 years ago

Closed 10 years ago

#1704 closed defect (fixed)

GRASS 7 cli startup enters into write protected/not owned mapset

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Startup Version: svn-trunk
Keywords: Cc:
CPU: x86-64 Platform: Linux

Description

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.

Change History (3)

comment:1 by neteler, 12 years ago

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

in reply to:  description comment:2 by glynn, 12 years ago

Replying to 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)

comment:3 by lucadelu, 10 years ago

Resolution: fixed
Status: newclosed

Using r62902 version this ticket seems fixed.

I close it, please reopen if needed

Note: See TracTickets for help on using tickets.