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]
23 $smb_prompt { set result 1 }
24 timeout { perror "timed out spawning smbclient" }
25 eof { perror "end of file spawning smbclient" }
31 # Run a command and wait for a prompt
33 proc do_smbclient { args } {
34 set action [lindex $args 0]
35 set description [lindex $args 1]
46 timeout { perror "timed out $description"; return -1}
47 eof { perror "end of file description"; return -1 }
50 verbose $expect_out(buffer)
51 return $expect_out(buffer)