Ignore:
Timestamp:
Jun 13, 2012, 12:08:42 PM (13 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: Updates in EVFSGUI/SMBMON/Shared code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/shared/rxrpclib.vrs

    r675 r703  
    1919    password = arg(3)
    2020
     21    call VRSet VRWindow(), 'Pointer', 'Wait'
    2122    say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' '
    2223    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' >'samba.!msg
     24    call VRSet VRWindow(), 'Pointer', '<default>'
    2325
    2426    rpc.enumdomgroups. = ""
     
    7577    password = arg(3)
    7678
     79    call VRSet VRWindow(), 'Pointer', 'Wait'
    7780    say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' '
    7881    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' >'samba.!msg
     82    call VRSet VRWindow(), 'Pointer', '<default>'
    7983
    8084    rpc.enumdomusers. = ""
     
    133137    usercred = '--user='username'%'password
    134138
     139    call VRSet VRWindow(), 'Pointer', 'Wait'
    135140    say     '  'samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' '
    136141    address cmd samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' >'samba.!msg
     142    call VRSet VRWindow(), 'Pointer', '<default>'
    137143
    138144    rpc.enumprinters. = ""
     
    183189    password = arg(3)
    184190
     191    call VRSet VRWindow(), 'Pointer', 'Wait'
    185192    say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' '
    186193    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' >'samba.!msg
     194    call VRSet VRWindow(), 'Pointer', '<default>'
    187195
    188196    rpc.netshareenum. = ""
     
    235243    share    = arg(4)
    236244
     245    call VRSet VRWindow(), 'Pointer', 'Wait'
    237246    say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' '
    238247    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' >'samba.!msg
     248    call VRSet VRWindow(), 'Pointer', '<default>'
    239249
    240250    rpc.netsharegetinfo. = ""
     
    343353    userrid  = arg(4)
    344354
     355    call VRSet VRWindow(), 'Pointer', 'Wait'
    345356    say '  'samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' '
    346357    address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' >'samba.!msg
     358    call VRSet VRWindow(), 'Pointer', '<default>'
    347359
    348360    rpc.queryuser. = ""
     
    390402/*:VRX         _rpcsrvinfo
    391403*/
    392 _rpcsrvinfo:  procedure expose rpc. samba. options.  debuglevel
     404_rpcsrvinfo:  procedure expose rpc. samba. options.  debuglevel tempdir
    393405    IF options.!debug == 1 THEN SAY time()" _rpcsrvinfo() started"
    394406    server   = arg(1)
    395407    username = arg(2)
    396408    password = arg(3)
     409
     410    /* Initialize temporary files */   
     411    rpcinfo.!msg = SysTempFileName(TempDir||"rpcinfo_msg.???")
     412    rpcinfo.!err = SysTempFileName(TempDir||"rpcinfo_err.???")
     413    ok = stream(rpcinfo.!msg,'c','close')
     414    ok = stream(rpcinfo.!err,'c','close')
     415    ok = SysFileDelete(rpcinfo.!msg)
     416    ok = SysFileDelete(rpcinfo.!err)
    397417
    398418    usercred = '--user='username'%'password
    399419    if UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'
    400420
    401     say     '  'samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'samba.!error' 1>'samba.!msg
    402     address cmd samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'samba.!error' 1>'samba.!msg
     421    call VRSet VRWindow(), 'Pointer', 'Wait'
     422    say     '  'samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'rpcinfo.!err' 1>'rpcinfo.!msg
     423    address cmd samba.!rpcclientexe' 'server' 'usercred' --command="srvinfo" 'debuglevel' 2>'rpcinfo.!err' 1>'rpcinfo.!msg
     424    call VRSet VRWindow(), 'Pointer', '<default>'
    403425
    404426    rpc.srvinfo. = ""
    405427
    406428    Failure = 0
    407     do while lines(samba.!error) > 0
    408         rpcline = linein(samba.!error)
    409         say "  "samba.!error":"rpcline
    410         if pos("UNSUCCESSFUL", rpcline) > 0 then do
    411             ok = stream(samba.!error,'c','close')
    412             ok = SysFileDelete(samba.!error)
     429    do while lines(rpcinfo.!err) > 0
     430        rpcline = linein(rpcinfo.!err)
     431        IF options.!debug == 1 THEN say "  "rpcinfo.!err': "'rpcline'"'
     432        if pos("UNSUCCESSFUL", translate(rpcline)) > 0 | pos("CANNOT CONNECT", translate(rpcline)) > 0 then do
     433            ok = stream(rpcinfo.!msg,'c','close')
     434            ok = stream(rpcinfo.!err,'c','close')
     435            ok = SysFileDelete(rpcinfo.!msg)
     436            ok = SysFileDelete(rpcinfo.!err)
    413437            Failure = 1
    414438            retval = 0
     
    421445
    422446    SIGNAL ON SYNTAX NAME RPCERROR
    423     do until lines(samba.!msg) = 0
    424         rpcline = linein(samba.!msg)
     447    do until lines(rpcinfo.!msg) = 0
     448        rpcline = linein(rpcinfo.!msg)
    425449        if pos("creating default valid table",rpcline) <> 0 then iterate
    426450
     
    444468            rpc.srvinfo.CAPABILITIES = ""
    445469            do I = 1 to words(rpc.srvinfo.SERVERSTRING)
    446                 say "Word "I":"word(rpc.srvinfo.SERVERSTRING,I)
     470                /* say "Word "I":"word(rpc.srvinfo.SERVERSTRING,I) */
    447471                if length(word(rpc.srvinfo.SERVERSTRING,I)) >=4 then leave
    448472                if length(word(rpc.srvinfo.SERVERSTRING,I)) = 2 | length(word(rpc.srvinfo.SERVERSTRING,I)) = 3 then do
     
    460484    SIGNAL OFF SYNTAX
    461485
    462     ok = stream(samba.!msg,'c','close')
    463     ok = SysFileDelete(samba.!msg)
     486    ok = stream(rpcinfo.!msg,'c','close')
     487    ok = stream(rpcinfo.!err,'c','close')
     488    ok = SysFileDelete(rpcinfo.!msg)
     489    ok = SysFileDelete(rpcinfo.!err)
    464490
    465491    if Failure = 0 then do
     
    477503
    478504RPCERROR:
    479     ok = stream(samba.!msg,'c','close')
    480     ok = SysFileDelete(samba.!msg)
     505    ok = stream(rpcinfo.!msg,'c','close')
     506    ok = stream(rpcinfo.!err,'c','close')
     507    ok = SysFileDelete(rpcinfo.!msg)
     508    ok = SysFileDelete(rpcinfo.!err)
     509
    481510    say "  rpc parsing error in line "sigl": "strip(sourceline(sigl))
    482511    retval = -1
Note: See TracChangeset for help on using the changeset viewer.