]> andersk Git - openssh.git/commitdiff
- mpech@cvs.openbsd.org 2002/06/11 05:46:20
authormouring <mouring>
Tue, 11 Jun 2002 16:42:49 +0000 (16:42 +0000)
committermouring <mouring>
Tue, 11 Jun 2002 16:42:49 +0000 (16:42 +0000)
     [auth-krb4.c monitor.h serverloop.c session.c ssh-agent.c sshd.c]
     pid_t cleanup. Markus need this now to keep hacking.
     markus@, millert@ ok

ChangeLog
auth-krb4.c
monitor.h
serverloop.c
session.c
ssh-agent.c
sshd.c

index 56f727d3e2c9b1ea1ce0d8682d307f1ce8f899eb..4647fe75df2dca2358ee410f9cf5452a2b43dbe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      run less code with euid==0 if ssh is installed setuid root
      just switch the euid, don't switch the complete set of groups
      (this is only needed by sshd). ok provos@
+   - mpech@cvs.openbsd.org 2002/06/11 05:46:20
+     [auth-krb4.c monitor.h serverloop.c session.c ssh-agent.c sshd.c]
+     pid_t cleanup. Markus need this now to keep hacking.
+     markus@, millert@ ok
 
 20020609
  - (bal) OpenBSD CVS Sync
index 2a3cf53146e6d99c7a382a964037376293b297e8..1cc528aa0a9dfb1ff5da92884aca8cae5c3986d6 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-krb4.c,v 1.26 2002/03/18 01:30:10 dugsong Exp $");
+RCSID("$OpenBSD: auth-krb4.c,v 1.27 2002/06/11 05:46:20 mpech Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -57,8 +57,8 @@ krb4_init(void *context)
                if (lstat("/ticket", &st) != -1)
                        tkt_root = "/ticket/";
 #endif /* AFS */
-               snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%d",
-                   tkt_root, authctxt->pw->pw_uid, getpid());
+               snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%ld",
+                   tkt_root, authctxt->pw->pw_uid, (long)getpid());
                krb_set_tkt_string(authctxt->krb4_ticket_file);
        }
        /* Register ticket cleanup in case of fatal error. */
index c87ad572d9f1a83150d0fae8658e0b0d59170ff2..69114b532e36649cfc71b021cee05828129cd55b 100644 (file)
--- a/monitor.h
+++ b/monitor.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: monitor.h,v 1.5 2002/06/06 01:09:41 stevesk Exp $     */
+/*     $OpenBSD: monitor.h,v 1.6 2002/06/11 05:46:20 mpech Exp $       */
 
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -60,7 +60,7 @@ struct monitor {
        struct mm_master        *m_zback;
        struct mm_master        *m_zlib;
        struct Kex              **m_pkex;
-       int                      m_pid;
+       pid_t                    m_pid;
 };
 
 struct monitor *monitor_init(void);
index 38b1cf7ba8074a92cd7f202e2a94ed3e2258a4b7..1a148fcbea3be8f5b982e93490c792e1052b274a 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.101 2002/03/30 18:51:15 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.102 2002/06/11 05:46:20 mpech Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -674,8 +674,8 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
                if (errno != EINTR)
                        packet_disconnect("wait: %.100s", strerror(errno));
        if (wait_pid != pid)
-               error("Strange, wait returned pid %d, expected %d",
-                   wait_pid, pid);
+               error("Strange, wait returned pid %ld, expected %ld",
+                   (long)wait_pid, (long)pid);
 
        /* Check if it exited normally. */
        if (WIFEXITED(wait_status)) {
index d2a460f8985efe5fc2220948c8df4478cf194d9a..a2d8a9c43df3198fbb2fa08dde2e1a0751d1139a 100644 (file)
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.136 2002/06/10 22:28:41 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.137 2002/06/11 05:46:20 mpech Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -162,8 +162,8 @@ auth_input_request_forwarding(struct passwd * pw)
                auth_sock_dir = NULL;
                return 0;
        }
-       snprintf(auth_sock_name, MAXPATHLEN, "%s/agent.%d",
-                auth_sock_dir, (int) getpid());
+       snprintf(auth_sock_name, MAXPATHLEN, "%s/agent.%ld",
+                auth_sock_dir, (long) getpid());
 
        /* delete agent socket on fatal() */
        fatal_add_cleanup(auth_sock_cleanup_proc, pw);
@@ -435,7 +435,7 @@ do_authenticated1(Authctxt *authctxt)
 void
 do_exec_no_pty(Session *s, const char *command)
 {
-       int pid;
+       pid_t pid;
 
 #ifdef USE_PIPES
        int pin[2], pout[2], perr[2];
@@ -1430,12 +1430,12 @@ session_dump(void)
        int i;
        for (i = 0; i < MAX_SESSIONS; i++) {
                Session *s = &sessions[i];
-               debug("dump: used %d session %d %p channel %d pid %d",
+               debug("dump: used %d session %d %p channel %d pid %ld",
                    s->used,
                    s->self,
                    s,
                    s->chanid,
-                   s->pid);
+                   (long)s->pid);
        }
 }
 
@@ -1493,13 +1493,13 @@ static Session *
 session_by_pid(pid_t pid)
 {
        int i;
-       debug("session_by_pid: pid %d", pid);
+       debug("session_by_pid: pid %ld", (long)pid);
        for (i = 0; i < MAX_SESSIONS; i++) {
                Session *s = &sessions[i];
                if (s->used && s->pid == pid)
                        return s;
        }
-       error("session_by_pid: unknown pid %d", pid);
+       error("session_by_pid: unknown pid %ld", (long)pid);
        session_dump();
        return NULL;
 }
@@ -1789,8 +1789,8 @@ session_exit_message(Session *s, int status)
        if ((c = channel_lookup(s->chanid)) == NULL)
                fatal("session_exit_message: session %d: no channel %d",
                    s->self, s->chanid);
-       debug("session_exit_message: session %d channel %d pid %d",
-           s->self, s->chanid, s->pid);
+       debug("session_exit_message: session %d channel %d pid %ld",
+           s->self, s->chanid, (long)s->pid);
 
        if (WIFEXITED(status)) {
                channel_request_start(s->chanid, "exit-status", 0);
@@ -1829,7 +1829,7 @@ session_exit_message(Session *s, int status)
 void
 session_close(Session *s)
 {
-       debug("session_close: session %d pid %d", s->self, s->pid);
+       debug("session_close: session %d pid %ld", s->self, (long)s->pid);
        if (s->ttyfd != -1) {
                fatal_remove_cleanup(session_pty_cleanup, (void *)s);
                session_pty_cleanup(s);
@@ -1853,7 +1853,8 @@ session_close_by_pid(pid_t pid, int status)
 {
        Session *s = session_by_pid(pid);
        if (s == NULL) {
-               debug("session_close_by_pid: no session for pid %d", pid);
+               debug("session_close_by_pid: no session for pid %ld",
+                   (long)pid);
                return;
        }
        if (s->chanid != -1)
@@ -1873,7 +1874,8 @@ session_close_by_channel(int id, void *arg)
                debug("session_close_by_channel: no session for id %d", id);
                return;
        }
-       debug("session_close_by_channel: channel %d child %d", id, s->pid);
+       debug("session_close_by_channel: channel %d child %ld",
+           id, (long)s->pid);
        if (s->pid != 0) {
                debug("session_close_by_channel: channel %d: has child", id);
                /*
index 9489260644aab7d976d1d0da96ee98eef59e1a28..b89ead6e5f8543fff63110d6b73ec25a466ffeb4 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "includes.h"
 #include "openbsd-compat/fake-queue.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.90 2002/06/09 13:32:01 markus Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.91 2002/06/11 05:46:20 mpech Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/md5.h>
@@ -1043,7 +1043,7 @@ main(int ac, char **av)
                format = c_flag ? "unsetenv %s;\n" : "unset %s;\n";
                printf(format, SSH_AUTHSOCKET_ENV_NAME);
                printf(format, SSH_AGENTPID_ENV_NAME);
-               printf("echo Agent pid %d killed;\n", pid);
+               printf("echo Agent pid %ld killed;\n", (long)pid);
                exit(0);
        }
        parent_pid = getpid();
@@ -1055,8 +1055,8 @@ main(int ac, char **av)
                        perror("mkdtemp: private socket dir");
                        exit(1);
                }
-               snprintf(socket_name, sizeof socket_name, "%s/agent.%d", socket_dir,
-                   parent_pid);
+               snprintf(socket_name, sizeof socket_name, "%s/agent.%ld", socket_dir,
+                   (long)parent_pid);
        } else {
                /* Try to use specified agent socket */
                socket_dir[0] = '\0';
@@ -1102,7 +1102,7 @@ main(int ac, char **av)
                format = c_flag ? "setenv %s %s;\n" : "%s=%s; export %s;\n";
                printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name,
                    SSH_AUTHSOCKET_ENV_NAME);
-               printf("echo Agent pid %d;\n", parent_pid);
+               printf("echo Agent pid %ld;\n", (long)parent_pid);
                goto skip;
        }
        pid = fork();
@@ -1112,14 +1112,14 @@ main(int ac, char **av)
        }
        if (pid != 0) {         /* Parent - execute the given command. */
                close(sock);
-               snprintf(pidstrbuf, sizeof pidstrbuf, "%d", pid);
+               snprintf(pidstrbuf, sizeof pidstrbuf, "%ld", (long)pid);
                if (ac == 0) {
                        format = c_flag ? "setenv %s %s;\n" : "%s=%s; export %s;\n";
                        printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name,
                            SSH_AUTHSOCKET_ENV_NAME);
                        printf(format, SSH_AGENTPID_ENV_NAME, pidstrbuf,
                            SSH_AGENTPID_ENV_NAME);
-                       printf("echo Agent pid %d;\n", pid);
+                       printf("echo Agent pid %ld;\n", (long)pid);
                        exit(0);
                }
                if (setenv(SSH_AUTHSOCKET_ENV_NAME, socket_name, 1) == -1 ||
diff --git a/sshd.c b/sshd.c
index 2f810b9c12877a9be769febcab7855e5cd012eef..705d4768b77ef753b9dd054274910e7d56815e09 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.244 2002/05/29 11:21:57 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.245 2002/06/11 05:46:20 mpech Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -574,7 +574,7 @@ privsep_preauth(void)
        if (pid == -1) {
                fatal("fork of unprivileged child failed");
        } else if (pid != 0) {
-               debug2("Network child is on pid %d", pid);
+               debug2("Network child is on pid %ld", (long)pid);
 
                close(pmonitor->m_recvfd);
                authctxt = monitor_child_preauth(pmonitor);
@@ -630,7 +630,7 @@ privsep_postauth(Authctxt *authctxt)
        if (pmonitor->m_pid == -1)
                fatal("fork of unprivileged child failed");
        else if (pmonitor->m_pid != 0) {
-               debug2("User child is on pid %d", pmonitor->m_pid);
+               debug2("User child is on pid %ld", (long)pmonitor->m_pid);
                close(pmonitor->m_recvfd);
                monitor_child_postauth(pmonitor);
 
@@ -1173,7 +1173,7 @@ main(int ac, char **av)
                         */
                        f = fopen(options.pid_file, "wb");
                        if (f) {
-                               fprintf(f, "%u\n", (u_int) getpid());
+                               fprintf(f, "%ld\n", (long) getpid());
                                fclose(f);
                        }
                }
@@ -1320,7 +1320,7 @@ main(int ac, char **av)
                                if (pid < 0)
                                        error("fork: %.100s", strerror(errno));
                                else
-                                       debug("Forked child %d.", pid);
+                                       debug("Forked child %ld.", (long)pid);
 
                                close(startup_p[1]);
 
This page took 0.071937 seconds and 5 git commands to generate.