Skip to content

Instantly share code, notes, and snippets.

@lbdyck
Created May 11, 2023 12:39
Show Gist options
  • Save lbdyck/a41792ba6284a15276c4c22915f42f65 to your computer and use it in GitHub Desktop.
Save lbdyck/a41792ba6284a15276c4c22915f42f65 to your computer and use it in GitHub Desktop.
TestUID0
/* 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