-
Notifications
You must be signed in to change notification settings - Fork 3
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
Temporary directory name conflicts when runnig inside containers with shared /tmp #4535
Comments
Add process ID to the temporary directory name |
Hi Andrew, I'm not sure what was the original reasoning behind making the directories per-user, but now that you're going into the direction of making them unique (per process), isn't it much better to use the POSIX mkdtemp API (or rather get_tmp_dir from glib) and remove all our strange black magic altogether? There was already CVE-2004-0231 in the past due to homegrown adventurous handling of temporary directories... |
Replying to zaytsev:
Probably yes.
g_get_tmp_dir uses $TMPDIR. mc tries to use $MC_TMPDIR if it's set and $TMPDIR otherwise. |
|
Well, there seems to be another more flexible API: g_dir_make_tmp - maybe you could use that instead. |
Replying to zaytsev:
It doesn't help us: g_dir_make_tmp calls g_get_tmp_dir.
|
You are right, I agree! |
comment:1 updated. |
|
|
A typo in the commit message: s/drirectory/directory/ :-( |
this commit broke /usr/libexec/mc/mc-wrapper.sh script probably. It expects /tmp/mc-$MC_USER |
Important
This issue was migrated from Trac:
eugenesan
(eugenesan@….com)When running inside Distrobox container temporary directory name conflicts with mc instance running on the host machine which has different permissions:
Trivial fix I came up with is to add process ID to the directory name.
Also, that might be useful when running multiple instances on the host.
Please find the fix attached to the tocket
Note
Original attachments:
eugenesan
(eugenesan@….com) onMay 8, 2024 at 20:45 UTC
The text was updated successfully, but these errors were encountered: