Opened 10 years ago

Closed 10 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 10 years ago.
Screenshot of commad window with error message

Download all attachments as: .zip

Change History (22)

by dnewcomb, 10 years ago

Attachment: grass7_error.png added

Screenshot of commad window with error message

comment:1 by neteler, 10 years ago

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 by dnewcomb, 10 years ago

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 by dnewcomb, 10 years ago

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.

in reply to:  3 comment:4 by hellik, 10 years ago

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 by dnewcomb, 10 years ago

| 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 by marisn, 10 years ago

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.

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

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.

in reply to:  7 ; comment:8 by marisn, 10 years ago

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

in reply to:  8 comment:9 by hellik, 10 years ago

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 by wenzeslaus, 10 years ago

Keywords: installation added

Possible duplicate of #1983. Please continue discussion here.

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

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

in reply to:  11 ; comment:12 by hellik, 10 years ago

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.

in reply to:  11 ; comment:13 by martinl, 10 years ago

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.

in reply to:  12 comment:14 by martinl, 10 years ago

Replying to hellik:

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

done and documented on wiki:CompileOnWindows

in reply to:  13 ; comment:15 by hellik, 10 years ago

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

in reply to:  15 ; comment:16 by hellik, 10 years ago

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.

in reply to:  16 ; comment:17 by marisn, 10 years ago

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.

in reply to:  17 comment:18 by martinl, 10 years ago

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 by hellik, 10 years ago

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 by neteler, 10 years ago

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

comment:21 by hellik, 10 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.