Created
May 11, 2023 12:39
-
-
Save lbdyck/a41792ba6284a15276c4c22915f42f65 to your computer and use it in GitHub Desktop.
TestUID0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This routine will test if the active user has the | |
ability to access UID 0 (superuser) | |
*/ | |
Check_UID0: | |
address syscall 'geteuid' /* get current euid */ | |
euid = retval | |
address syscall 'seteuid 0' /* try to set uid 0 */ | |
if retval /= 0 then do | |
gooduid0 = 1 | |
zedsmsg = 'Error.' | |
zedlmsg = 'Unable to get UID of 0, meaning you do not have' , | |
'access to BPX.SUPERUSER Facility class and will' , | |
'not be able to issue the Remount command.' | |
address ispexec 'setmsg msg(isrz001)' | |
return | |
end | |
address syscall 'seteuid' euid /* reset back */ | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment