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

can't exucute a file in /tmp directory #642

Open
weiyuan-jiang opened this issue Aug 27, 2024 · 3 comments
Open

can't exucute a file in /tmp directory #642

weiyuan-jiang opened this issue Aug 27, 2024 · 3 comments

Comments

@weiyuan-jiang
Copy link
Contributor

Some users got issues when executing a file in the temporary directory.

GEOSgcm_App/gcm_setup

Lines 2606 to 2610 in 4ceccc3

echo cat $LOCDIR/$FILE.tmp \| awk \'\{if \( \$1 \~ \"${string}\" \) \
\{sub \( \/${string}\/ ,\"\#${string}\" \)\;print\} else print\}\' \> $LOCDIR/$FILE > $TMPCMD
chmod +x $TMPCMD
$TMPCMD
/bin/rm -f $TMPCMD

I suggest to execute the command directly without writing to a file

@weiyuan-jiang
Copy link
Contributor Author

@sshakoor1 @mathomp4

echo cat $LOCDIR/$FILE.tmp | awk '{if ( $1 ~ "${string}" ) {sub ( /${string}/ ,"#${string}" );print} else print}' > $LOCDIR/$FILE

@mathomp4
Copy link
Member

@weiyuan-jiang There might be a simple "fix" for discover (e.g., not NAS or local machines).

It turns out both LOCAL_TMPDIR and TSE_TMPDIR exist on login nodes! So, what we might just do is near the top of gcm_setup say "If discover, setenv TMPDIR=$LOCAL_TMPDIR".

Then, mktemp will use that and that does not have the noexec bit that /tmp has set.

@mathomp4
Copy link
Member

For NAS, we'd need to think but then again, we've never really had this issues at NAS. But if we did, I can sort of think of ways to work around that even there.

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

3 participants
@mathomp4 @weiyuan-jiang and others