summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-05-15 16:25:01 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-05-15 16:25:01 +0000
commit7339b2a27868557ffcfea6cd7908323bca4f7a3a (patch)
tree85bf536e7bab841860f4a65d63717278b6ab8c72 /sshd.c
parentbdde330d2fb2a2ccc50659a592da5241f673b6d1 (diff)
- mouring@cvs.openbsd.org 2002/05/15 15:47:49
[kex.c monitor.c monitor_wrap.c sshd.c] 'monitor' variable clashes with at least one lame platform (NeXT). i Renamed to 'pmonitor'. provos@ - (bal) Fixed up PAM case. I think.
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/sshd.c b/sshd.c
index 0bd644777..45ccb3d47 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.241 2002/05/13 15:53:19 millert Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.242 2002/05/15 15:47:49 mouring Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -202,7 +202,7 @@ int *startup_pipes = NULL;
202int startup_pipe; /* in child */ 202int startup_pipe; /* in child */
203 203
204/* variables used for privilege separation */ 204/* variables used for privilege separation */
205extern struct monitor *monitor; 205extern struct monitor *pmonitor;
206extern int use_privsep; 206extern int use_privsep;
207 207
208/* Prototypes for various functions defined later in this file. */ 208/* Prototypes for various functions defined later in this file. */
@@ -566,9 +566,9 @@ privsep_preauth(void)
566 pid_t pid; 566 pid_t pid;
567 567
568 /* Set up unprivileged child process to deal with network data */ 568 /* Set up unprivileged child process to deal with network data */
569 monitor = monitor_init(); 569 pmonitor = monitor_init();
570 /* Store a pointer to the kex for later rekeying */ 570 /* Store a pointer to the kex for later rekeying */
571 monitor->m_pkex = &xxx_kex; 571 pmonitor->m_pkex = &xxx_kex;
572 572
573 pid = fork(); 573 pid = fork();
574 if (pid == -1) { 574 if (pid == -1) {
@@ -576,12 +576,12 @@ privsep_preauth(void)
576 } else if (pid != 0) { 576 } else if (pid != 0) {
577 debug2("Network child is on pid %d", pid); 577 debug2("Network child is on pid %d", pid);
578 578
579 close(monitor->m_recvfd); 579 close(pmonitor->m_recvfd);
580 authctxt = monitor_child_preauth(monitor); 580 authctxt = monitor_child_preauth(pmonitor);
581 close(monitor->m_sendfd); 581 close(pmonitor->m_sendfd);
582 582
583 /* Sync memory */ 583 /* Sync memory */
584 monitor_sync(monitor); 584 monitor_sync(pmonitor);
585 585
586 /* Wait for the child's exit status */ 586 /* Wait for the child's exit status */
587 while (waitpid(pid, &status, 0) < 0) 587 while (waitpid(pid, &status, 0) < 0)
@@ -591,7 +591,7 @@ privsep_preauth(void)
591 } else { 591 } else {
592 /* child */ 592 /* child */
593 593
594 close(monitor->m_sendfd); 594 close(pmonitor->m_sendfd);
595 595
596 /* Demote the child */ 596 /* Demote the child */
597 if (getuid() == 0 || geteuid() == 0) 597 if (getuid() == 0 || geteuid() == 0)
@@ -611,7 +611,7 @@ privsep_postauth(Authctxt *authctxt)
611 611
612 if (authctxt->pw->pw_uid == 0 || options.use_login) { 612 if (authctxt->pw->pw_uid == 0 || options.use_login) {
613 /* File descriptor passing is broken or root login */ 613 /* File descriptor passing is broken or root login */
614 monitor_apply_keystate(monitor); 614 monitor_apply_keystate(pmonitor);
615 use_privsep = 0; 615 use_privsep = 0;
616 return; 616 return;
617 } 617 }
@@ -624,21 +624,21 @@ privsep_postauth(Authctxt *authctxt)
624 } 624 }
625 625
626 /* New socket pair */ 626 /* New socket pair */
627 monitor_reinit(monitor); 627 monitor_reinit(pmonitor);
628 628
629 monitor->m_pid = fork(); 629 pmonitor->m_pid = fork();
630 if (monitor->m_pid == -1) 630 if (pmonitor->m_pid == -1)
631 fatal("fork of unprivileged child failed"); 631 fatal("fork of unprivileged child failed");
632 else if (monitor->m_pid != 0) { 632 else if (pmonitor->m_pid != 0) {
633 debug2("User child is on pid %d", monitor->m_pid); 633 debug2("User child is on pid %d", pmonitor->m_pid);
634 close(monitor->m_recvfd); 634 close(pmonitor->m_recvfd);
635 monitor_child_postauth(monitor); 635 monitor_child_postauth(pmonitor);
636 636
637 /* NEVERREACHED */ 637 /* NEVERREACHED */
638 exit(0); 638 exit(0);
639 } 639 }
640 640
641 close(monitor->m_sendfd); 641 close(pmonitor->m_sendfd);
642 642
643 /* Demote the private keys to public keys. */ 643 /* Demote the private keys to public keys. */
644 demote_sensitive_data(); 644 demote_sensitive_data();
@@ -647,7 +647,7 @@ privsep_postauth(Authctxt *authctxt)
647 do_setusercontext(authctxt->pw); 647 do_setusercontext(authctxt->pw);
648 648
649 /* It is safe now to apply the key state */ 649 /* It is safe now to apply the key state */
650 monitor_apply_keystate(monitor); 650 monitor_apply_keystate(pmonitor);
651} 651}
652 652
653static char * 653static char *
@@ -1459,7 +1459,7 @@ main(int ac, char **av)
1459 * the current keystate and exits 1459 * the current keystate and exits
1460 */ 1460 */
1461 if (use_privsep) { 1461 if (use_privsep) {
1462 mm_send_keystate(monitor); 1462 mm_send_keystate(pmonitor);
1463 exit(0); 1463 exit(0);
1464 } 1464 }
1465 1465