[GRASS-SVN] r66474 - grass/branches/releasebranch_7_0/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Oct 12 01:13:57 PDT 2015
Author: neteler
Date: 2015-10-12 01:13:57 -0700 (Mon, 12 Oct 2015)
New Revision: 66474
Modified:
grass/branches/releasebranch_7_0/lib/init/grass.py
Log:
init/grass.py: check if owner mapset is valid (backport of r66473)
Modified: grass/branches/releasebranch_7_0/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/init/grass.py 2015-10-12 08:09:50 UTC (rev 66473)
+++ grass/branches/releasebranch_7_0/lib/init/grass.py 2015-10-12 08:13:57 UTC (rev 66474)
@@ -866,6 +866,13 @@
global lockfile
if not os.path.exists(location):
fatal(_("Path '%s' doesn't exist") % location)
+ if not os.access(location, os.W_OK):
+ error = "Path '%s' not accessible.\n" % location
+ stat_info = os.stat(location)
+ mapset_uid = stat_info.st_uid
+ if mapset_uid != os.getuid():
+ error += "You are not the owner of '%s'" % location
+ fatal(_(error))
# Check for concurrent use
lockfile = os.path.join(location, ".gislock")
More information about the grass-commit
mailing list