2 # Utilities
for driving smbclient
7 set smb_prompt
"smb: \\\\>"
9 # Spawn smbclient and wait
for a prompt
11 proc spawn_smbclient
{ args } {
18 spawn smbclient
[lindex $
args 0] [lindex $
args 1] [lindex $
args 2] \
19 [lindex $
args 3] [lindex $
args 4] [lindex $
args 5] \
25 $smb_prompt
{ set result
1 }
26 timeout
{ perror
"timed out spawning smbclient" }
27 eof
{ perror
"end of file spawning smbclient" }
33 # Run a command and wait
for a prompt
35 proc do_smbclient
{ args } {
36 set action
[lindex $
args 0]
37 set description
[lindex $
args 1]
48 timeout
{ perror
"timed out $description"; return -1}
49 eof
{ perror
"end of file $description"; return -1 }
52 verbose $expect_out
(buffer
)
53 return $expect_out
(buffer
)