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

Files and folders owned by root on exit. #123

Open
einarjon opened this issue Nov 10, 2023 · 0 comments
Open

Files and folders owned by root on exit. #123

einarjon opened this issue Nov 10, 2023 · 0 comments

Comments

@einarjon
Copy link

einarjon commented Nov 10, 2023

After running the pyinstaller, both entrypoints fix the permissions by running
chown -R --reference=. ./dist/linux and chown -R --reference=. ./dist/windows
That's usually not enough, and it leaves files/folders with root ownership.

So I have to run
docker run -v $PWD/win:/src cdrx/pyinstaller-windows:python3 'chown -R --reference=/src /src'
to clean that up every time.

Proposed fix:
Change line 42 of the entrypoint files to
chown -R --reference=. ./dist ./__pycache__
https://github.com/cdrx/docker-pyinstaller/blob/master/entrypoint-linux.sh#L42
https://github.com/cdrx/docker-pyinstaller/blob/master/entrypoint-windows.sh#L42

Steps to reproduce:

$ docker run -v  $PWD/lin:/src   cdrx/pyinstaller-linux:python3 >& /dev/null
$ find lin -user  0  -exec ls -ld {} \;
drwxr-xr-x. 3 root root 4096 Nov 10 14:37 lin/dist
drwxr-xr-x. 2 root root 4096 Nov 10 14:37 lin/__pycache__
-rw-r--r--. 1 root root 3141 Nov 10 14:37 lin/__pycache__/myexecutable.cpython-37.pyc
$ docker run -v  $PWD/win:/src   cdrx/pyinstaller-windows:python3 >& /dev/null
$ find win -user  0  -exec ls -ld {} \;
drwxr-xr-x. 3 root root 4096 Nov 10 14:42 win/dist
drwxr-xr-x. 2 root root 4096 Nov 10 14:42 win/__pycache__
-rw-r--r--. 1 root root 3143 Nov 10 14:42 win/__pycache__/myexecutable.cpython-37.pyc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant