in reply to Re^2: Not understanding the code to drop privileges in perlsec
in thread Not understanding the code to drop privileges in perlsec

Thank you very much!

On SO I have been told to set the script suid or sgid, which leads to nowhere because the interpreter does not care about those flags. I admit that I should have written a further comment that describes my solution to that problem and my new findings.

However, in the first post here, I have described that I have amended the code with print statements and what happened then. From the post:

"My tests seem to confirm that point of view. I have made a test environment in Linux (Debian bullseye) where I can run the script setsuid-root or setsuid-other_user, and have inserted print statements after every assignment. Regardless of what my real user id was, and regardless of the setsuid of the script, I never encountered a situation where $UID and $orig_UID were different immediately before executing line 7."

And that's still my problem. After I had learned how to execute a script suid / sgid, I have conducted a lot of tests, but could not construct a situation where lines 7 and 8 actually would effect anything.

  • Comment on Re^3: Not understanding the code to drop privileges in perlsec