Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] GRASS 7.8.6 for Windows will not start for unpriviliged user #1965

Closed
newcomb-d opened this issue Nov 2, 2021 · 36 comments
Closed

[Bug] GRASS 7.8.6 for Windows will not start for unpriviliged user #1965

newcomb-d opened this issue Nov 2, 2021 · 36 comments
Labels
bug Something isn't working windows Microsoft Windows specific
Milestone

Comments

@newcomb-d
Copy link

Describe the bug
After installation on Windows 10 , starting GRASS7.8.6 fails with the message in the terminal window:
"C:\Program Files\GRASS GIS 7.8\extrabin\python3.exe: can't open file 'C:\ProgramFiles\GRASS GIS 7.8\etc\grass78.py': {Errno 13] Permission denied

It should be noted that normal users do not have read access to C:\ProgramFiles\GRASS GIS 7.8\etc\grass78.py after installation , only System and users in the Administrators group or otherwise elevated access
To Reproduce
Steps to reproduce the behavior:

  1. Install GRASS 7.8.6 on windows 10
  2. Start GRASS78
  3. See error

Expected behavior
Expect GRASS 7.8.6 to start

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

System description (please complete the following information):

  • Operating System: Windows 10
  • GRASS GIS version 7.8.6

Additional context
Add any other context about the problem here.

@newcomb-d newcomb-d added the bug Something isn't working label Nov 2, 2021
@newcomb-d
Copy link
Author

newcomb-d commented Nov 2, 2021

grass78.py seems to be the only file in the etc directory with this permissions issue

@ninsbl
Copy link
Member

ninsbl commented Nov 2, 2021

Hi, @newcomb-d. How did you install GRASS and which package did you install?
Using OSGeo4W V2 (the installer that is default) both the 7.8.6-3 and the very new 7.8.6-6 package do start without issues on my Windows 10 box...

@newcomb-d
Copy link
Author

I installed using the binary linked from the GRASS website earlier today.

@sujata91
Copy link

Any solution to this issue? I am also having the same error.

@dnewcomb
Copy link
Contributor

dnewcomb commented Nov 16, 2021 via email

@dnewcomb
Copy link
Contributor

On a virtual instance of Windows10, with the initial user from the Windows installation, GRASS 7.8.6-1 runs.
Add a standard user to Windows 10 and GRASS 7.8.6-1 will not start for that user.
The initial user is still part of the admin group, the new standard user is not. Most institutional users ( government agencies, businesses, etc.) run as standard users
This is a change between GRASS 7.8.6-RC1 and GRASS 7.8.6-1. GRASS 7.8.6-RC1 launched without a problem as a standard user.

This bug also seems to be present in the nightly GRASS 8 Standalone installers.

@hellik
Copy link
Member

hellik commented Nov 17, 2021

This is a change between GRASS 7.8.6-RC1 and GRASS 7.8.6-1. GRASS 7.8.6-RC1 launched without a problem as a standard user.

AFAIK there is no change in the related nsis code between RC and release.

@hellik
Copy link
Member

hellik commented Nov 17, 2021

could it be local issue?

@newcomb-d
Copy link
Author

newcomb-d commented Nov 17, 2021 via email

@hellik
Copy link
Member

hellik commented Nov 17, 2021

was there a change in Windows 10 Enterprise?

@hellik
Copy link
Member

hellik commented Nov 17, 2021

it could not read the grass78.py script to start grass.

the start up python script is called by the startup batch file, and not directly by the user.

@hellik
Copy link
Member

hellik commented Nov 17, 2021

it could not read the grass78.py script to start grass.

the start up python script is called by the startup batch file, and not directly by the user.

it is started by grass78.bat

@newcomb-d
Copy link
Author

newcomb-d commented Nov 17, 2021 via email

@newcomb-d
Copy link
Author

newcomb-d commented Nov 17, 2021 via email

@hellik
Copy link
Member

hellik commented Nov 17, 2021

Just wondering if there is a switch flipped there ( unlikely from your response)

nsis script

@hellik
Copy link
Member

hellik commented Nov 17, 2021

Tried it on my work laptop , Windows 10 Enterprise

no access here to a windows 10 enterprisebox

@newcomb-d
Copy link
Author

newcomb-d commented Nov 17, 2021 via email

@dnewcomb
Copy link
Contributor

@sujata91
Copy link

Hi may be off the topic, But I am having the temporary directory error while opening the GRASS. I installed it with the OSGeo4W installer. Can anyone suggest how to resolve this issue? Thanks
image

@tmszi tmszi added the windows Microsoft Windows specific label Nov 19, 2021
@tmszi
Copy link
Member

tmszi commented Nov 19, 2021

I was successfull with reproduce this issue. I tested this issue on the MS Windows 10 Enterprise Evaluation version as VirtualBox image obtained from official MS Microsoft page https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (on the page choose from Virtual Machines Select Box: MS Edge on Win 10 (x86_64) Stable 1809).

GRASS GIS 8.0 version (Standalone installer) was installed under default IEuser user account (Administrator type account), then I created new user account Test (Standard user type account) and run GRASS GIS (double click on grass80.bat file) under this user account.

Error message:

C:\Program Files\GRASS GIS 8.0\extrabin\python3.exe: can't open file 'C:\Program Files\GRASS GIS 8.0\etc\grass80.py': [Errno 13] Permission denied
Press any key to continue . . .

As mentioned above only grass80.py file in the /etc dir doesn't have read permission.

@newcomb-d
Copy link
Author

newcomb-d commented Nov 19, 2021 via email

@hellik
Copy link
Member

hellik commented Nov 19, 2021

it works on a Windows 10 Home laptop.

so the question is: is there a difference in behaviour between Windows 10 Home and Windows 10 Professional?

@hellik
Copy link
Member

hellik commented Nov 19, 2021

For example, instead of the “BUILTINUSERS” line shown earlier, the installer now has these two lines:

AccessControl::GrantOnFile "$INSTDIRfile.foo" "(BU)" "GenericRead + GenericWrite"
AccessControl::GrantOnFile "$INSTDIRfile.foo" "(S-1-5-32-545)" "GenericRead + GenericWrite"

related code line:

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

so file execution on grass78.py is enabled.

@newcomb-d
Copy link
Author

newcomb-d commented Nov 19, 2021 via email

@hellik
Copy link
Member

hellik commented Nov 19, 2021

on other places:

	;grant $INSTDIR\etc read write accessible and show if succeeded: error if it failed
	AccessControl::GrantOnFile "$INSTDIR\etc" "(S-1-5-32-545)" "FullAccess"
	Pop $R0
	DetailPrint $R0	
	;grant modifying/overwriting fontcap file and show if succeeded: error if it failed	
	AccessControl::GrantOnFile "$INSTDIR\etc\fontcap" "(S-1-5-32-545)" "FullAccess"
	Pop $R0
	DetailPrint $R0	
	;set $INSTDIR\etc back to read accessible
	AccessControl::SetOnFile "$INSTDIR\etc" "(S-1-5-32-545)" "GenericRead + GenericExecute"	

so at least the \etc directory is set accordingly to the comment above.

@hellik
Copy link
Member

hellik commented Nov 19, 2021

so file execution on grass78.py is enabled.

so at least the \etc directory is set accordingly to the comment above.

it may be that the directory setting isn't overruling the file setting?

@hellik
Copy link
Member

hellik commented Nov 19, 2021

so file execution on grass78.py is enabled.

so at least the \etc directory is set accordingly to the comment above.

it may be that the directory setting isn't overruling the file setting?

directory setting is in line 599

file setting is in line 766

that could be an explanation.

@hellik
Copy link
Member

hellik commented Nov 19, 2021

GRASS GIS 8.0 version (Standalone installer) was installed under default IEuser user account (Administrator type account), then I created new user account Test (Standard user type account) and run GRASS GIS (double click on grass80.bat file) under this user account.

so it seems that there is a different behaviour between an IEuser user account and a Standard user type account

any hints from the nsis side of the world about that?

@hellik
Copy link
Member

hellik commented Nov 19, 2021

it works on a Windows 10 Home laptop.

checked here: it is an administrator account.

@dnewcomb
Copy link
Contributor

dnewcomb commented Dec 1, 2021

Sorry to take so long to reply. To sum up, it looks like changing line 766 from:
AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(BU)" "Execute"
to
AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(S-1-5-32-545)" "Execute"

should fix the issue for the standalone installer issue of normal, non-privileged users starting GRASS 7.8.6 and 8.0 after installation

@hellik
Copy link
Member

hellik commented Jan 3, 2022

@dnewcomb would you mind to open a PR with the changes mentioned above against G8?

@dnewcomb
Copy link
Contributor

dnewcomb commented Jan 3, 2022 via email

@TillF
Copy link

TillF commented Jan 12, 2024

I installed GRASS 8.3.1-1 on Windows 10 Pro from standalone-installer.
Same problem: GRASS could not be started as an unprivileged user, error message as above.
Quick dirty fix was modifying the file permissions of c:\Program Files\GRASS GIS 8.3\etc\grass83.py to "full access" for all computer users. Still, it would be nice to have it working out put the box after installation.

@newcomb-d
Copy link
Author

newcomb-d commented Jan 12, 2024 via email

@landam
Copy link
Member

landam commented Feb 7, 2024

I have built a new 7.8.8 standalone installer using NSIS 3.09, see OSGeo/grass-website#410

I was able to start GRASS 7.8.8 under unprivileged user. I am closing this issue, feel free to reopen if needed.

@landam landam closed this as completed Feb 7, 2024
@landam landam added this to the 7.8.9 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Microsoft Windows specific
Projects
None yet
Development

No branches or pull requests

8 participants