|
Lines 656-662
Link Here
|
| 656 |
void |
656 |
void |
| 657 |
do_exec(Session *s, const char *command) |
657 |
do_exec(Session *s, const char *command) |
| 658 |
{ |
658 |
{ |
| 659 |
if (forced_command) { |
659 |
if (forced_passwd_change) { |
|
|
660 |
char *user = s->pw->pw_name; |
| 661 |
char *msg; |
| 662 |
|
| 663 |
if (s->ttyfd == -1) { |
| 664 |
packet_disconnect("Password for %.100s has expired and cannot be changed without a pty", user); |
| 665 |
return; |
| 666 |
} |
| 667 |
|
| 668 |
msg = "Password for %.100s has expired, running 'passwd' to reset it"; |
| 669 |
command = "passwd"; |
| 670 |
log(msg, user); |
| 671 |
packet_send_debug(msg, user); |
| 672 |
|
| 673 |
} else if (forced_command) { |
| 660 |
original_command = command; |
674 |
original_command = command; |
| 661 |
command = forced_command; |
675 |
command = forced_command; |
| 662 |
debug("Forced command '%.900s'", command); |
676 |
debug("Forced command '%.900s'", command); |