Changeset 1071 for branches


Ignore:
Timestamp:
Jun 5, 2020, 2:13:54 PM (5 years ago)
Author:
Alex Taylor
Message:

Prevent debug log from displaying password in rpcclient command line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-arcamap-2.5/shared/rxrpclib.vrs

    r1023 r1071  
    11/* Samba REXX Function Library for RPC calls */
    22
    3 /* 
     3/*
    44Copyright (C) 2007-2017 Herwig Bauernfeind for bww bitwise works GmbH.
    55
     
    2222/*   _rpcenumdomgroups(server,username,password)           */
    2323/*   _rpcenumdomusers(server,username,password)            */
    24 /*   _rpcenumprinters(server,username,password)            */ 
     24/*   _rpcenumprinters(server,username,password)            */
    2525/*   _rpcnetshareenum(server,username,password)            */
    2626/*   _rpcnetsharegetinfo(server,username,password,share)   */
     
    3636    username = arg(2)
    3737    password = arg(3)
    38 
    39     call VRSet VRWindow(), 'Pointer', 'Wait'
    40     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' '
     38    passmask = COPIES('*', LENGTH( password ))
     39
     40    call VRSet VRWindow(), 'Pointer', 'Wait'
     41    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="enumdomgroups" 'debuglevel' '
    4142    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' >'samba.!msg
    4243    call VRSet VRWindow(), 'Pointer', '<default>'
     
    7071        interpret dyn
    7172
    72     end   
     73    end
    7374    SIGNAL OFF SYNTAX
    7475    ok = stream(samba.!msg,'c','close')
     
    8586    end
    8687    IF options.!debug == 1 THEN SAY time()" _rpcenumdomgroups() done, "retval" "rpc.enumdomgroups.LOGONSTATUS
    87 return retval 
     88return retval
    8889
    8990/*:VRX         _rpcenumdomusers
     
    9495    username = arg(2)
    9596    password = arg(3)
    96 
    97     call VRSet VRWindow(), 'Pointer', 'Wait'
    98     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' '
     97    passmask = COPIES('*', LENGTH( password ))
     98
     99    call VRSet VRWindow(), 'Pointer', 'Wait'
     100    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="enumdomusers" 'debuglevel' '
    99101    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' >'samba.!msg
    100102    call VRSet VRWindow(), 'Pointer', '<default>'
     
    128130        interpret dyn
    129131
    130     end   
     132    end
    131133    SIGNAL OFF SYNTAX
    132134    ok = stream(samba.!msg,'c','close')
     
    152154    username = arg(2)
    153155    password = arg(3)
     156    passmask = COPIES('*', LENGTH( password ))
    154157
    155158    usercred = '--user='username'%'password
    156159
    157160    call VRSet VRWindow(), 'Pointer', 'Wait'
    158     say     '  'samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' '
     161    say     '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="enumprinters" 'debuglevel' '
    159162    address cmd samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' >'samba.!msg
    160163    call VRSet VRWindow(), 'Pointer', '<default>'
     
    183186            interpret dyn
    184187        end
    185     end   
     188    end
    186189    SIGNAL OFF SYNTAX
    187190    ok = stream(samba.!msg,'c','close')
     
    206209    username = arg(2)
    207210    password = arg(3)
    208 
    209     call VRSet VRWindow(), 'Pointer', 'Wait'
    210     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' '
     211    passmask = COPIES('*', LENGTH( password ))
     212
     213    call VRSet VRWindow(), 'Pointer', 'Wait'
     214    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="netshareenum" 'debuglevel' '
    211215    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' >'samba.!msg
    212216    call VRSet VRWindow(), 'Pointer', '<default>'
     
    235239            interpret dyn
    236240        end
    237     end   
     241    end
    238242    SIGNAL OFF SYNTAX
    239243    ok = stream(samba.!msg,'c','close')
     
    260264    password = arg(3)
    261265    share    = arg(4)
    262 
    263     call VRSet VRWindow(), 'Pointer', 'Wait'
    264     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' '
     266    passmask = COPIES('*', LENGTH( password ))
     267
     268    call VRSet VRWindow(), 'Pointer', 'Wait'
     269    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="netsharegetinfo 'share'" 'debuglevel' '
    265270    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' >'samba.!msg
    266271    call VRSet VRWindow(), 'Pointer', '<default>'
     
    285290            if Token = "TYPE" & left(Tvalue,2) = "0x" & length(Tvalue) = 3 then Token = "SHARETYPE"
    286291            if Token = "TYPE" & pos("SEC",Tvalue) > 1 then Token = "SECTYPE"
    287            
     292
    288293            dyn = 'rpc.netsharegetinfo.'Token' = "'Tvalue'"'
    289294            say "  "dyn
    290295            interpret dyn
    291296        end
    292     end   
     297    end
    293298    SIGNAL OFF SYNTAX
    294299    ok = stream(samba.!msg,'c','close')
     
    314319    password = arg(3)
    315320    grouprid = arg(4)
    316 
    317     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="querygroupmem 'grouprid'" 'debuglevel' '
     321    passmask = COPIES('*', LENGTH( password ))
     322
     323    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="querygroupmem 'grouprid'" 'debuglevel' '
    318324    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="querygroupmem 'grouprid'" 'debuglevel' >'samba.!msg
    319325
     
    346352        interpret dyn
    347353
    348     end   
     354    end
    349355    SIGNAL OFF SYNTAX
    350356    ok = stream(samba.!msg,'c','close')
     
    370376    password = arg(3)
    371377    userrid  = arg(4)
    372 
    373     call VRSet VRWindow(), 'Pointer', 'Wait'
    374     say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' '
     378    passmask = COPIES('*', LENGTH( password ))
     379
     380    call VRSet VRWindow(), 'Pointer', 'Wait'
     381    say '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="queryuser 'userrid'" 'debuglevel' '
    375382    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' >'samba.!msg
    376383    call VRSet VRWindow(), 'Pointer', '<default>'
     
    403410            interpret dyn
    404411        end
    405     end   
     412    end
    406413    SIGNAL OFF SYNTAX
    407414    ok = stream(samba.!msg,'c','close')
     
    417424    end
    418425    IF options.!debug == 1 THEN SAY time()" _rpcqueryuser() done, "retval" "rpc.queryuser.LOGONSTATUS
    419 return retval 
     426return retval
    420427/*:VRX         _rpcsrvinfo
    421428*/
     
    425432    username = arg(2)
    426433    password = arg(3)
    427 
    428     /* Initialize temporary files */   
     434    passmask = COPIES('*', LENGTH( password ))
     435
     436    /* Initialize temporary files */
    429437    rpcinfo.!msg = SysTempFileName(TempDir||"rpcinfo_msg.???")
    430438    rpcinfo.!err = SysTempFileName(TempDir||"rpcinfo_err.???")
     
    438446
    439447    call VRSet VRWindow(), 'Pointer', 'Wait'
    440     say     '  'samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'rpcinfo.!err' 1>'rpcinfo.!msg
     448    say     '  'samba.!rpcclientexe' 'server' --user='username'%'passmask' --command="srvinfo" 'debuglevel' 2>'rpcinfo.!err' 1>'rpcinfo.!msg
    441449    address cmd samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'rpcinfo.!err' 1>'rpcinfo.!msg
    442450    call VRSet VRWindow(), 'Pointer', '<default>'
Note: See TracChangeset for help on using the changeset viewer.