vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F 5c20fa
diff -up openssh-5.6p1/log.h.wIm openssh-5.6p1/log.h
Jan F 5c20fa
--- openssh-5.6p1/log.h.wIm	2008-06-13 02:22:54.000000000 +0200
Jan F 5c20fa
+++ openssh-5.6p1/log.h	2011-01-11 10:35:32.000000000 +0100
Jan F 5c20fa
@@ -63,6 +63,7 @@ void     verbose(const char *, ...) __at
Jan F 5c20fa
 void     debug(const char *, ...) __attribute__((format(printf, 1, 2)));
Jan F 5c20fa
 void     debug2(const char *, ...) __attribute__((format(printf, 1, 2)));
Jan F 5c20fa
 void     debug3(const char *, ...) __attribute__((format(printf, 1, 2)));
Jan F 5c20fa
+void	 debug_wIm(const char *);
Jan F 5c20fa
 
Jan F 5c20fa
 void	 do_log(LogLevel, const char *, va_list);
Jan F 5c20fa
 void	 cleanup_exit(int) __attribute__((noreturn));
Jan F 5c20fa
diff -up openssh-5.6p1/Makefile.in.wIm openssh-5.6p1/Makefile.in
Jan F 5c20fa
--- openssh-5.6p1/Makefile.in.wIm	2010-05-12 08:51:39.000000000 +0200
Jan F 5c20fa
+++ openssh-5.6p1/Makefile.in	2011-01-11 10:35:32.000000000 +0100
Jan F 5c20fa
@@ -69,7 +69,7 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o b
Jan F 5c20fa
 	cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
Jan F 5c20fa
 	compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
Jan F 5c20fa
 	log.o match.o md-sha256.o moduli.o nchan.o packet.o \
Jan F 5c20fa
-	readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \
Jan F 5c20fa
+	readpass.o rsa.o ttymodes.o whereIam.o xmalloc.o addrmatch.o \
Jan F 5c20fa
 	atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \
Jan F 5c20fa
 	monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \
Jan F 5c20fa
 	kexgex.o kexdhc.o kexgexc.o msg.o progressmeter.o dns.o \
Jan F 5c20fa
diff -up openssh-5.6p1/sshd.c.wIm openssh-5.6p1/sshd.c
Jan F 5c20fa
--- openssh-5.6p1/sshd.c.wIm	2010-04-16 07:56:22.000000000 +0200
Jan F 5c20fa
+++ openssh-5.6p1/sshd.c	2011-01-11 10:35:32.000000000 +0100
Jan F 5c20fa
@@ -139,6 +139,9 @@ int deny_severity;
Jan F 5c20fa
 
Jan F 5c20fa
 extern char *__progname;
Jan F 5c20fa
 
Jan F 5c20fa
+/* trace of fork processes */
Jan F 5c20fa
+extern int whereIam;
Jan F 5c20fa
+
Jan F 5c20fa
 /* Server configuration options. */
Jan F 5c20fa
 ServerOptions options;
Jan F 5c20fa
 
Jan F 5c20fa
@@ -652,6 +655,7 @@ privsep_preauth(Authctxt *authctxt)
Jan F 5c20fa
 	} else {
Jan F 5c20fa
 		/* child */
Jan F 5c20fa
 
Jan F 5c20fa
+		whereIam = 1;
Jan F 5c20fa
 		close(pmonitor->m_sendfd);
Jan F 5c20fa
 
Jan F 5c20fa
 		/* Demote the child */
Jan F 5c20fa
@@ -693,6 +697,7 @@ privsep_postauth(Authctxt *authctxt)
Jan F 5c20fa
 		exit(0);
Jan F 5c20fa
 	}
Jan F 5c20fa
 
Jan F 5c20fa
+	whereIam = 2;
Jan F 5c20fa
 	close(pmonitor->m_sendfd);
Jan F 5c20fa
 
Jan F 5c20fa
 	/* Demote the private keys to public keys. */
Jan F 5c20fa
@@ -1299,6 +1304,8 @@ main(int ac, char **av)
Jan F 5c20fa
 	Key *key;
Jan F 5c20fa
 	Authctxt *authctxt;
Jan F 5c20fa
 
Jan F 5c20fa
+	whereIam = 0;
Jan F 5c20fa
+
Jan F 5c20fa
 #ifdef HAVE_SECUREWARE
Jan F 5c20fa
 	(void)set_auth_parameters(ac, av);
Jan F 5c20fa
 #endif
Jan F 5c20fa
diff -up openssh-5.6p1/whereIam.c.wIm openssh-5.6p1/whereIam.c
Jan F 5c20fa
--- openssh-5.6p1/whereIam.c.wIm	2011-01-11 10:35:32.000000000 +0100
Jan F 5c20fa
+++ openssh-5.6p1/whereIam.c	2011-01-11 10:35:32.000000000 +0100
Jan F 5c20fa
@@ -0,0 +1,9 @@
Jan F 5c20fa
+
Jan F 5c20fa
+int whereIam = -1;
Jan F 5c20fa
+
Jan F 5c20fa
+void debug_wIm(const char *txt)
Jan F 5c20fa
+{
Jan F 5c20fa
+	debug("%s wIm = %d, euid=%d", txt, whereIam, geteuid());
Jan F 5c20fa
+}
Jan F 5c20fa
+
Jan F 5c20fa
+