Changeset 703 for trunk/guitools/shared/rxrpclib.vrs
- Timestamp:
- Jun 13, 2012, 12:08:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/guitools/shared/rxrpclib.vrs
r675 r703 19 19 password = arg(3) 20 20 21 call VRSet VRWindow(), 'Pointer', 'Wait' 21 22 say ' 'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' ' 22 23 address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomgroups" 'debuglevel' >'samba.!msg 24 call VRSet VRWindow(), 'Pointer', '<default>' 23 25 24 26 rpc.enumdomgroups. = "" … … 75 77 password = arg(3) 76 78 79 call VRSet VRWindow(), 'Pointer', 'Wait' 77 80 say ' 'samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' ' 78 81 address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="enumdomusers" 'debuglevel' >'samba.!msg 82 call VRSet VRWindow(), 'Pointer', '<default>' 79 83 80 84 rpc.enumdomusers. = "" … … 133 137 usercred = '--user='username'%'password 134 138 139 call VRSet VRWindow(), 'Pointer', 'Wait' 135 140 say ' 'samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' ' 136 141 address cmd samba.!rpcclientexe' 'server' 'usercred' --command="enumprinters" 'debuglevel' >'samba.!msg 142 call VRSet VRWindow(), 'Pointer', '<default>' 137 143 138 144 rpc.enumprinters. = "" … … 183 189 password = arg(3) 184 190 191 call VRSet VRWindow(), 'Pointer', 'Wait' 185 192 say ' 'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' ' 186 193 address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netshareenum" 'debuglevel' >'samba.!msg 194 call VRSet VRWindow(), 'Pointer', '<default>' 187 195 188 196 rpc.netshareenum. = "" … … 235 243 share = arg(4) 236 244 245 call VRSet VRWindow(), 'Pointer', 'Wait' 237 246 say ' 'samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' ' 238 247 address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="netsharegetinfo 'share'" 'debuglevel' >'samba.!msg 248 call VRSet VRWindow(), 'Pointer', '<default>' 239 249 240 250 rpc.netsharegetinfo. = "" … … 343 353 userrid = arg(4) 344 354 355 call VRSet VRWindow(), 'Pointer', 'Wait' 345 356 say ' 'samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' ' 346 357 address cmd samba.!rpcclientexe' 'server' --user='username'%'password' --command="queryuser 'userrid'" 'debuglevel' >'samba.!msg 358 call VRSet VRWindow(), 'Pointer', '<default>' 347 359 348 360 rpc.queryuser. = "" … … 390 402 /*:VRX _rpcsrvinfo 391 403 */ 392 _rpcsrvinfo: procedure expose rpc. samba. options. debuglevel 404 _rpcsrvinfo: procedure expose rpc. samba. options. debuglevel tempdir 393 405 IF options.!debug == 1 THEN SAY time()" _rpcsrvinfo() started" 394 406 server = arg(1) 395 407 username = arg(2) 396 408 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) 397 417 398 418 usercred = '--user='username'%'password 399 419 if UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' then UserCred = '-N' 400 420 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>' 403 425 404 426 rpc.srvinfo. = "" 405 427 406 428 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) 413 437 Failure = 1 414 438 retval = 0 … … 421 445 422 446 SIGNAL ON SYNTAX NAME RPCERROR 423 do until lines( samba.!msg) = 0424 rpcline = linein( samba.!msg)447 do until lines(rpcinfo.!msg) = 0 448 rpcline = linein(rpcinfo.!msg) 425 449 if pos("creating default valid table",rpcline) <> 0 then iterate 426 450 … … 444 468 rpc.srvinfo.CAPABILITIES = "" 445 469 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) */ 447 471 if length(word(rpc.srvinfo.SERVERSTRING,I)) >=4 then leave 448 472 if length(word(rpc.srvinfo.SERVERSTRING,I)) = 2 | length(word(rpc.srvinfo.SERVERSTRING,I)) = 3 then do … … 460 484 SIGNAL OFF SYNTAX 461 485 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) 464 490 465 491 if Failure = 0 then do … … 477 503 478 504 RPCERROR: 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 481 510 say " rpc parsing error in line "sigl": "strip(sourceline(sigl)) 482 511 retval = -1
Note:
See TracChangeset
for help on using the changeset viewer.