0

I have small script which creates a tmp files using mkstemp. My script was created using root user , but if I logged in as someother user other than root then my scripts runs but msktemp fails and says permission denied

sh: /tmp/tmpFile-khB5hH: Permission denied

Same thing while doing in RHEL 7 works and no Permission denied error, what is changed in RHEL 8. looks like RHEL 8 is checking logged on user vs effective user.

I tested this up in RHEL 7.5 and RHEL 8.4.

If someone know change in RHEL 8 which leads to permission problems please suggest. Thanks

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
cjoshi
  • 1
  • @Kusalananda drwxrwxrwt. 9 root root 195 Aug 15 06:48 /tmp – cjoshi Aug 15 '21 at 11:49
  • @steve nothing as such. – cjoshi Aug 15 '21 at 11:50
  • @steve well problem is happening because my logged on user is different from the effective use ..hence it says permission denied which it should not do. mkstemp is able to create the temp file in /tmp when logged on user and my script user is same.....thought in RHEL7 it works fine – cjoshi Aug 15 '21 at 11:53