rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone
f09e2e
diff -up openssh-5.9p1/Makefile.in.wIm openssh-5.9p1/Makefile.in
f09e2e
--- openssh-5.9p1/Makefile.in.wIm	2011-08-05 22:15:18.000000000 +0200
f09e2e
+++ openssh-5.9p1/Makefile.in	2011-09-12 16:24:18.643674014 +0200
f09e2e
@@ -66,7 +66,7 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o b
f09e2e
 	cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
f09e2e
 	compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
f09e2e
 	log.o match.o md-sha256.o moduli.o nchan.o packet.o \
f09e2e
-	readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \
f09e2e
+	readpass.o rsa.o ttymodes.o whereIam.o xmalloc.o addrmatch.o \
f09e2e
 	atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \
f09e2e
 	monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \
f09e2e
 	kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \
f09e2e
diff -up openssh-5.9p1/log.h.wIm openssh-5.9p1/log.h
f09e2e
--- openssh-5.9p1/log.h.wIm	2011-06-20 06:42:23.000000000 +0200
f09e2e
+++ openssh-5.9p1/log.h	2011-09-12 16:34:52.984674326 +0200
f09e2e
@@ -65,6 +65,8 @@ void     verbose(const char *, ...) __at
f09e2e
 void     debug(const char *, ...) __attribute__((format(printf, 1, 2)));
f09e2e
 void     debug2(const char *, ...) __attribute__((format(printf, 1, 2)));
f09e2e
 void     debug3(const char *, ...) __attribute__((format(printf, 1, 2)));
f09e2e
+void	 _debug_wIm_body(const char *, int, const char *, const char *, int);
f09e2e
+#define	debug_wIm(a,b) _debug_wIm_body(a,b,__func__,__FILE__,__LINE__)
f09e2e
 
f09e2e
 
f09e2e
 void	 set_log_handler(log_handler_fn *, void *);
f09e2e
diff -up openssh-5.9p1/sshd.c.wIm openssh-5.9p1/sshd.c
f09e2e
--- openssh-5.9p1/sshd.c.wIm	2011-06-23 11:45:51.000000000 +0200
f09e2e
+++ openssh-5.9p1/sshd.c	2011-09-12 16:38:35.787816490 +0200
f09e2e
@@ -140,6 +140,9 @@ int deny_severity;
f09e2e
 
f09e2e
 extern char *__progname;
f09e2e
 
f09e2e
+/* trace of fork processes */
f09e2e
+extern int whereIam;
f09e2e
+
f09e2e
 /* Server configuration options. */
f09e2e
 ServerOptions options;
f09e2e
 
f09e2e
@@ -666,6 +669,7 @@ privsep_preauth(Authctxt *authctxt)
f09e2e
 		return 1;
f09e2e
 	} else {
f09e2e
 		/* child */
f09e2e
+		whereIam = 1;
f09e2e
 		close(pmonitor->m_sendfd);
f09e2e
 		close(pmonitor->m_log_recvfd);
f09e2e
 
f09e2e
@@ -715,6 +719,7 @@ privsep_postauth(Authctxt *authctxt)
f09e2e
 
f09e2e
 	/* child */
f09e2e
 
f09e2e
+	whereIam = 2;
f09e2e
 	close(pmonitor->m_sendfd);
f09e2e
 	pmonitor->m_sendfd = -1;
f09e2e
 
f09e2e
@@ -1325,6 +1330,8 @@ main(int ac, char **av)
f09e2e
 	Key *key;
f09e2e
 	Authctxt *authctxt;
f09e2e
 
f09e2e
+	whereIam = 0;
f09e2e
+
f09e2e
 #ifdef HAVE_SECUREWARE
f09e2e
 	(void)set_auth_parameters(ac, av);
f09e2e
 #endif
f09e2e
diff -up openssh-5.9p1/whereIam.c.wIm openssh-5.9p1/whereIam.c
f09e2e
--- openssh-5.9p1/whereIam.c.wIm	2011-09-12 16:24:18.722674167 +0200
f09e2e
+++ openssh-5.9p1/whereIam.c	2011-09-12 16:24:18.724674418 +0200
f09e2e
@@ -0,0 +1,12 @@
f09e2e
+
f09e2e
+int whereIam = -1;
f09e2e
+
f09e2e
+void _debug_wIm_body(const char *txt, int val, const char *func, const char *file, int line)
f09e2e
+{
f09e2e
+	if (txt)
f09e2e
+		debug("%s=%d, %s(%s:%d) wIm = %d, uid=%d, euid=%d", txt, val, func, file, line, whereIam, getuid(), geteuid());
f09e2e
+	else
f09e2e
+		debug("%s(%s:%d) wIm = %d, uid=%d, euid=%d", func, file, line, whereIam, getuid(), geteuid());
f09e2e
+}
f09e2e
+
f09e2e
+