Opened 6 years ago

Closed 5 years ago

#2290 closed defect (fixed)

Wrong file permissions for grassXY.py on Windows (was: Grass not starting)

Reported by: dnewcomb Owned by: grass-dev@…
Priority: major Milestone: 7.0.0
Component: Installation Version: svn-releasebranch70
Keywords: installation Cc:
CPU: x86-64 Platform: MSWindows 7

Description

When trying to launch GRASS 7 svnR60210-961, i only get hte command window minimized. When bringing up the window I see: C:\Program Files (x86)\GRASS GIS 7.0.0svn\extrabin\python.exe: can't open file ' C:\Program Files (x86)\GRASS GIS 7.0.0svn\etc\grass70.py': [Errno 13] Permission denied Press any key to continue . . .

Upon pressing any key the command window disappears and GRASS is not running.

Attachments (1)

grass7_error.png (9.2 KB) - added by dnewcomb 6 years ago.
Screenshot of commad window with error message

Download all attachments as: .zip

Change History (22)

Changed 6 years ago by dnewcomb

Attachment: grass7_error.png added

Screenshot of commad window with error message

comment:1 Changed 6 years ago by neteler

Could you try to start GRASS from the OSGeo4W command line:

cd C:\Program Files (x86)\GRASS GIS 7.0.0svn\etc\
grass70.py -text

?

comment:2 Changed 6 years ago by dnewcomb

Tried that and I get Access is denied.

Looking at the security permissions for grass70.py , I see that there are only security permissions listed for administrative users ( i.e. SYSTEM, Administrators Group) There are no security policies for ordinary users listed . Comparing to other programs, it looks like there should be read and read and execute permissions for standard Users.

comment:3 Changed 6 years ago by dnewcomb

Downloaded r60231-962 , and had same problem. Manually set grass70.py Windows security settings to Add USERS read and read/execute rights and GRASS 7.0 started normally. The fix appears to be setting the correct security settings for USERS for this file upon install.

comment:4 in reply to:  3 Changed 6 years ago by hellik

Replying to dnewcomb:

Downloaded r60231-962 , and had same problem. Manually set grass70.py Windows security settings to Add USERS read and read/execute rights and GRASS 7.0 started normally. The fix appears to be setting the correct security settings for USERS for this file upon install.

are you installing winGRASS7-standalone installer with admin rights (e.g. right click on the standalone installer and execute as admin)?

long time ago I've added this as a needed default to the standalone installer: http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-Installer.nsi.tmpl#L96

comment:5 Changed 6 years ago by dnewcomb

| are you installing winGRASS7-standalone installer with admin rights (e.g. right |click on the standalone installer and execute as admin)?

|long time ago I've added this as a needed default to the standalone installer: |http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-Installer.nsi.tmpl#L96

I just tried that and I still have the same problem

comment:6 Changed 6 years ago by marisn

Component: DefaultInstallation
Priority: normalcritical

I installed Wingrass 7.0 nightly on Vista launching the installer with "Run as Admin", still on the ordinary user account I got hit by this bug. (For a strange reason the grass70.py file was lacking permissions for Users account.)

Rising its priority as ordinary user might not have Admin rights and thus installer should create a working installation at the first place not requiring manual adjustment of file permissions later.

comment:7 in reply to:  6 ; Changed 6 years ago by hellik

Type: defectenhancement

Replying to marisn:

I installed Wingrass 7.0 nightly on Vista launching the installer with "Run as Admin", still on the ordinary user account I got hit by this bug.

I wouldn't say that this is a winGRASS bug, it's a window operating system and a sytem right issue that can't be solved easily; as there are quite a lot of different right managements out there in the windows world. so I would class it rather an enhancement than a defect.

comment:8 in reply to:  7 ; Changed 6 years ago by marisn

Summary: Grass not startingWrong file permissions for grassXY.py on Windows (was: Grass not starting)
Type: enhancementdefect

Replying to hellik:

I wouldn't say that this is a winGRASS bug, it's a window operating system and a sytem right issue that can't be solved easily; as there are quite a lot of different right managements out there in the windows world. so I would class it rather an enhancement than a defect.

It is. In *NIX world that equals shipping a package (RPM, deb) with missing go+R permissions. This is not a limitation of Windows. This is an error in Wingrass installer not setting correct permissions on files. Changed the summary to better reflect the scope of this issue.

I am not familiar with NSIS and Wingrass, but as grass70.py file was affected, I would look on some of the magic touching that particular file, i.e.: https://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-Installer.nsi.tmpl#L884

comment:9 in reply to:  8 Changed 6 years ago by hellik

Replying to marisn:

Replying to hellik:

I wouldn't say that this is a winGRASS bug, it's a window operating system and a sytem right issue that can't be solved easily; as there are quite a lot of different right managements out there in the windows world. so I would class it rather an enhancement than a defect.

It is. In *NIX world that equals shipping a package (RPM, deb) with missing go+R permissions. This is not a limitation of Windows. This is an error in Wingrass installer not setting correct permissions on files. Changed the summary to better reflect the scope of this issue.

I am not familiar with NSIS and Wingrass, but as grass70.py file was affected, I would look on some of the magic touching that particular file, i.e.: https://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-Installer.nsi.tmpl#L884

it could be that changing some content in the file by L884 etc. may change the permission rights on some windows systems.

for setting permission rights:

http://nsis.sourceforge.net/AccessControl_plug-in

comment:10 Changed 6 years ago by wenzeslaus

Keywords: installation added

Possible duplicate of #1983. Please continue discussion here.

comment:11 in reply to:  10 ; Changed 6 years ago by hellik

Replying to wenzeslaus:

Possible duplicate of #1983. Please continue discussion here.

around line L894 may be following should be added:

AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(BU)" "Execute"

not sure to whom execute should be granted ( BU is builtin/users: builtin/users

comment:12 in reply to:  11 ; Changed 6 years ago by hellik

Replying to hellik:

Replying to wenzeslaus:

Possible duplicate of #1983. Please continue discussion here.

around line L894 may be following should be added:

and the plugin has to be added to nsis on the build server.

comment:13 in reply to:  11 ; Changed 6 years ago by martinl

Replying to hellik:

around line L894 may be following should be added:

> AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(BU)" "Execute"

done in r61401. Please check the next build 2014-07-26.

comment:14 in reply to:  12 Changed 6 years ago by martinl

Replying to hellik:

and the plugin has to be added to nsis on the build server.

done and documented on wiki:CompileOnWindows

comment:15 in reply to:  13 ; Changed 6 years ago by hellik

Replying to martinl:

Replying to hellik:

around line L894 may be following should be added:

> AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(BU)" "Execute"

done in r61401. Please check the next build 2014-07-26.

tested with

http://wingrass.fsv.cvut.cz/grass71/WinGRASS-7.1.svn-r61439-1037-Setup.exe

GRASS Version: 7.1.svn                                                          
GRASS SVN Revision: 61439                                                       
Erstellungsdatum: 2014-07-29                                                    
Build Platform: i686-pc-mingw32                                                 
GDAL/OGR: 1.11.0                                                                
PROJ.4: 4.8.0                                                                   
GEOS: 3.4.2                                                                     
SQLite: 3.7.17                                                                  
Python: 2.7.4                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-Vista-6.0.6002-SP2  

there is now added following access control to the current user:

grass71.py

user:
read, execute => allowed
read          => allowed

comment:16 in reply to:  15 ; Changed 6 years ago by hellik

Replying to hellik:

tested with

http://wingrass.fsv.cvut.cz/grass71/WinGRASS-7.1.svn-r61439-1037-Setup.exe

GRASS Version: 7.1.svn                                                          
GRASS SVN Revision: 61439                                                       
Erstellungsdatum: 2014-07-29                                                    
Build Platform: i686-pc-mingw32                                                 
GDAL/OGR: 1.11.0                                                                
PROJ.4: 4.8.0                                                                   
GEOS: 3.4.2                                                                     
SQLite: 3.7.17                                                                  
Python: 2.7.4                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-Vista-6.0.6002-SP2  

there is now added following access control to the current user:

grass71.py

user:
read, execute => allowed
read          => allowed

testing on other MS windows platforms very welcome!!! no chance here on my side to test with further windows boxes ( win 7, 8) at the moment.

comment:17 in reply to:  16 ; Changed 6 years ago by marisn

Replying to hellik:

testing on other MS windows platforms very welcome!!! no chance here on my side to test with further windows boxes ( win 7, 8) at the moment.

Tested with Vista - issue is fixed. Can't test on XP at the moment.

Needs a backport to 7.0 ASAP.

comment:18 in reply to:  17 Changed 6 years ago by martinl

Replying to marisn:

Replying to hellik:

testing on other MS windows platforms very welcome!!! no chance here on my side to test with further windows boxes ( win 7, 8) at the moment.

Tested with Vista - issue is fixed. Can't test on XP at the moment.

Needs a backport to 7.0 ASAP.

Done in r61454.

comment:19 Changed 6 years ago by hellik

Priority: criticalmajor

as the fix seems to work, downgrading to priority: major.

keeping ticket open until more tests on different win boxes (win7, win8) are done.

comment:20 Changed 5 years ago by neteler

If solved here, please check if also #1983 got solved at the same time.

comment:21 Changed 5 years ago by hellik

Resolution: fixed
Status: newclosed

as it seems to be fixed, closing ticket. reopen if needed.

Note: See TracTickets for help on using tickets.