aboutsummaryrefslogtreecommitdiff
path: root/src/kadmin/passwd/unit-test/config/unix.exp
blob: bd8382e19e222289b667a112460e8f033cd8dc3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Hack around Solaris 9 kernel race condition that causes last output
# from a pty to get dropped.
if { $PRIOCNTL_HACK } {
    catch {exec priocntl -s -c FX -m 30 -p 30 -i pid [getpid]}
    rename spawn oldspawn
    proc spawn { args } {
	upvar 1 spawn_id spawn_id
	set newargs {}
	set inflags 1
	set eatnext 0
	foreach arg $args {
	    if { $arg == "-ignore" \
		     || $arg == "-open" \
		     || $arg == "-leaveopen" } {
		lappend newargs $arg
		set eatnext 1
		continue
	    }
	    if [string match "-*" $arg] {
		lappend newargs $arg
		continue
	    }
	    if { $eatnext } {
		set eatnext 0
		lappend newargs $arg
		continue
	    }
	    if { $inflags } {
		set inflags 0
		set newargs [concat $newargs {priocntl -e -c FX -p 0}]
	    }
	    lappend newargs $arg
	}
	set pid [eval oldspawn $newargs]
	return $pid
    }
}

#
# kpasswd_version -- extract and print the version number of kpasswd
#

proc kpasswd_version {} {
	global KPASSWD
	catch "exec ident $KPASSWD" tmp
	if [regexp {Id: kpasswd.c,v ([0-9]+\.[0-9]+)} $tmp \
		dummy version] then {
		clone_output "$KPASSWD version $version\n"
	} else {
		clone_output "$KPASSWD version <unknown>\n"
	}
}
#
# kpasswd_load -- loads the program
#
proc kpasswd_load {} {
	#
}

# kpasswd_exit -- clean up and exit
proc kpasswd_exit {} {
	#
}

#
# kpasswd_start -- start kpasswd running
#
proc kpasswd_start { args } {
	global KPASSWD
	global spawn_id

	verbose "% $KPASSWD $args" 1
	eval spawn $KPASSWD $args
}