~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/tests/dejagnu/krb-root/telnet.exp

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    return
26
26
}
27
27
 
28
 
# Remove old wrapper script
29
 
    catch "exec rm -f $tmppwd/login.wrap"
30
 
 
31
 
# Start up a root shell.
32
 
if ![setup_root_shell telnet] {
33
 
    return
34
 
}
35
 
 
36
 
# Make sure .k5login is reasonable.
37
 
if ![check_k5login rlogin] {
38
 
    stop_root_shell
39
 
    return
40
 
}
41
 
 
42
 
# Set up the kerberos database.
43
 
if {![get_hostname] \
44
 
    || ![setup_kerberos_files] \
45
 
    || ![setup_kerberos_env] \
46
 
    || ![setup_kerberos_db 0]} {
47
 
    stop_root_shell
48
 
    return
49
 
}
50
 
 
51
28
# A procedure to start up the telnet daemon.
52
29
 
53
30
proc start_telnet_daemon { args } {
70
47
    # we don't need to use inetd.  The portbase+8 is the port to listen at.
71
48
    # Note that tmppwd here is a shell variable, which is set in
72
49
    # setup_root_shell, not a TCL variable.
73
 
    send -i $rlogin_spawn_id "sh -c \"$TELNETD $args -debug -t \$tmppwd/srvtab -R $REALMNAME -L $tmppwd/login.wrap -X KERBEROS_V4 [expr 8 + $portbase]\" &\r"
 
50
    send -i $rlogin_spawn_id "sh -c \"$TELNETD $args -debug -t \$tmppwd/srvtab -R $REALMNAME -L $tmppwd/login.wrap [expr 8 + $portbase]\" &\r"
74
51
    expect {
75
52
        -i $rlogin_spawn_id 
76
53
        -re "$ROOT_PROMPT" { }
427
404
    stop_telnet_daemon
428
405
}
429
406
 
430
 
# Run the test.  Logging in sometimes takes a while, so increase the
431
 
# timeout.
432
 
set oldtimeout $timeout
433
 
set timeout 60
434
 
set status [catch telnet_test msg]
435
 
set timeout $oldtimeout
436
 
 
437
 
# Shut down the kerberos daemons, the telnet daemon, and the rlogin
438
 
# process.
439
 
stop_kerberos_daemons
440
 
 
441
 
stop_telnet_daemon
442
 
 
443
 
stop_root_shell
444
 
 
445
 
if { $status != 0 } {
446
 
    send_error "ERROR: error in telnet.exp\n"
447
 
    send_error "$msg\n"
448
 
    exit 1
 
407
run_once telnet {
 
408
    # Remove old wrapper script
 
409
    catch "exec rm -f $tmppwd/login.wrap"
 
410
 
 
411
    # Start up a root shell.
 
412
    if ![setup_root_shell telnet] {
 
413
        return
 
414
    }
 
415
 
 
416
    # Make sure .k5login is reasonable.
 
417
    if ![check_k5login rlogin] {
 
418
        stop_root_shell
 
419
        return
 
420
    }
 
421
 
 
422
    # Set up the kerberos database.
 
423
    if {![get_hostname] \
 
424
            || ![setup_kerberos_files] \
 
425
            || ![setup_kerberos_env] \
 
426
            || ![setup_kerberos_db 0]} {
 
427
        stop_root_shell
 
428
        return
 
429
    }
 
430
 
 
431
    # Run the test.  Logging in sometimes takes a while, so increase the
 
432
    # timeout.
 
433
    set oldtimeout $timeout
 
434
    set timeout 60
 
435
    set status [catch telnet_test msg]
 
436
    set timeout $oldtimeout
 
437
 
 
438
    # Shut down the kerberos daemons, the telnet daemon, and the rlogin
 
439
    # process.
 
440
    stop_kerberos_daemons
 
441
 
 
442
    stop_telnet_daemon
 
443
 
 
444
    stop_root_shell
 
445
 
 
446
    if { $status != 0 } {
 
447
        send_error "ERROR: error in telnet.exp\n"
 
448
        send_error "$msg\n"
 
449
        exit 1
 
450
    }
449
451
}