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

eix-remote fails to create temporary directory on pambase[mktemp] system #95

Open
waptaff opened this issue Feb 8, 2022 · 1 comment

Comments

@waptaff
Copy link

waptaff commented Feb 8, 2022

Hi.

The mktemp flag on sys-auth/pambase allows the per-user /tmp directory feature (for instance, user fred has TMP and TMPDIR set to /tmp/.private/fred).

Running eix-remote as root gives this error:

mktemp: failed to create directory via template ‘/tmp/.private/root/eix-remote.XXXXXXXX’: Permission denied
 * cannot create temporary directory

I suspect this error is happening because eix-drop-permissions does not involve PAM hence does not reset TMP and TMPDIR.

Perhaps the ${TMPDIR:-/tmp} constructs in /usr/share/eix/eix-functions should be updated to first check if TMPDIR is read/writable.

@vaeth
Copy link
Owner

vaeth commented Feb 8, 2022

It is the caller's responsibility to pass a sane value as TMPDIR. Trying to outsmart the user by re-interpreting that value is calling for trouble and perhaps even opens some attack surface on some systems due to such surprising behavior.

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

2 participants