/**/
call RxFuncAdd "SysLoadFuncs" , "REXXUTIL" , "SysLoadFuncs"
call SysLoadFuncs
call RxFuncAdd "ChkStLoadFuncs" , "CHKSTDLL" , "ChkStLoadFuncs"
call ChkStLoadFuncs
parse arg input
if left(input,1) = '?' then do
say 'CHKUNREV - version 2.12'
say '(c) Copyright International Business Machines Corporation 1994.'
say 'All rights Reserved'
say
say 'CHKURALL: This application will unrevoke all users found to be revoked'
say "          It's main purpose is to assist in migrating from old database"
say '          levels to the latest version.'
say
say 'Calling Convention'
say '------------------'
say 'CHKURALL /DB:database_location'
say
say 'where:-'
say '   database_location = alternative location of the chkstore database'
say '                       This is optional, the default being locate the'
say '                       database on the LOGON alias.'
exit 0
end
revoke_user = ''
ChkstorFile = 'CHKSTORE.DBF'
parse value ChkStNetUser() with myuserid mycomputername mydomain
if mydomain = '' then do
say 'No userid is logged on'
return 3
end
domain_server = ChkStDCName(mydomain)
if pos('ERROR',domain_server) <> 0 then do
say 'unable to determine the domain controller for domain' domain 'error was' domain_server
return 5
end
if pos('/DB:',input) <> 0 then ,
parse var input '/DB:'db_location
else db_location = 'logon'
if left(db_location,1) <> '\' & substr(db_location,2,1) <> ':' & ,
left(db_location,1) <> '.' then do
parse value ChkStNetAlias(domain_server,db_location) with alias_server alias_path
if pos('ERROR',alias_server) <> 0 then do
say 'error trying to resolve' db_location 'on' domain_server 'error was' alias_server
return 6
end
if strip(alias_server,'L','\') <> computername then ,
alias_drive  = alias_server'\'translate(alias_path,'$',':')
else
alias_drive = alias_path
end
else ,
alias_drive = strip(db_location,'t','\')
ChkstorFile = alias_drive||'\'||ChkstorFile
if stream(ChkstorFile,'c','query exists') <> '' then do
entries = ChkStReadFile(ChkstorFile)
if pos('ERROR:',entries) <> 0 then do
say 'No' ChkstorFile 'on the current working directory'
say 'cannot unrevoke all users'
exit 8
end
do i = 1 to entries
if SubStr(filedata.i,25,1) = 'R' then do
say 'user' left(filedata.i,8) 'found to be revoked'
revoke_user = revoke_user strip(left(filedata.i,8))
end
end
end
call chkunrev input revoke_user
