I want script to write to the directory.
The user who run the script has not permission to that directory. Also he has not administrator password.
The user can execute the script only, so he can not modify the script to make it do anything.
In Linux we have "S" permission to do that.
if the user want to modify his password he will use "passwd" program. this program will read the "shadow" file then modify the user password.
The user has not permission to modify "shadow" file but the program has.
How I can do this in windows OS.
The goal from the first part to make pre-update hook executable for all users.
This is the code for pre-update hook.
directory = "C:/Users/Wael.Asad/Desktop/admin"
os.chdir(directory)
os.environ.unsetenv("GIT_DIR")
a= subprocess.run(['git', 'fetch'],stdout=subprocess.PIPE)
received_text = a.stdout.decode('utf-8')
This error occurred at this line os.chdir(directory)
permission Error [WinError 5] access is denied:"C:/Users/Wael.Asad/Desktop/admin"
CodePudding user response:
I found approach solution for the dilemma above. The solution is through using API to do the above code. When the user clicked on the patch file, the batch will make post to API via "CURL" cmd command or "request.post" python command . The API can access to the directory that user can't.