Check-in [6cdd98d6d0]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updated to use "eval" in the shell for safer execution
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6cdd98d6d027231dd4a906a163164ecb971fcab9
User & Date: rkeene 2014-07-02 06:36:15
Context
2014-07-03
06:21
Added a "jobs" command and some basic work towards supporting passwords Leaf check-in: 3b303ae685 user: rkeene tags: trunk
2014-07-02
06:36
Updated to use "eval" in the shell for safer execution check-in: 6cdd98d6d0 user: rkeene tags: trunk
06:29
Initial work to date check-in: cf468d004f user: rkeene tags: trunk
Changes

Changes to bin/netexec.

34
35
36
37
38
39
40






41
42
43
44
45
46
47
48
49
50
51
52
53
54
	}
	arglist {
		set argv $arg
	}
}

set hosts $opts(file)







proc issue_command_to_host {host cmdid} {
	set sock $::socks($host)

	catch {
		puts -nonewline $sock "echo START_$cmdid;"
		puts -nonewline $sock "$::commands($cmdid);"
		puts -nonewline $sock "echo;"
		puts $sock "echo END_$cmdid;"

		flush $sock
	}
}








>
>
>
>
>
>






|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
	}
	arglist {
		set argv $arg
	}
}

set hosts $opts(file)

proc shell_quote {arg} {
	set retval [string map [list "'" "'\\''"] $arg]

	return $retval
}

proc issue_command_to_host {host cmdid} {
	set sock $::socks($host)

	catch {
		puts -nonewline $sock "echo START_$cmdid;"
		puts -nonewline $sock "eval '[shell_quote $::commands($cmdid)]';"
		puts -nonewline $sock "echo;"
		puts $sock "echo END_$cmdid;"

		flush $sock
	}
}