Module Name:    src
Committed By:   christos
Date:           Tue Aug 16 09:42:21 UTC 2011

Modified Files:
        src/crypto/external/bsd/openssh/bin/sshd: Makefile
        src/crypto/external/bsd/openssh/dist: ldapauth.c ssh-agent.c

Log Message:
kill non-literal format strings or document them.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/openssh/dist/ldapauth.c
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/ssh-agent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssh/bin/sshd/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.6 src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.7
--- src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.6	Sun Jul 24 23:03:10 2011
+++ src/crypto/external/bsd/openssh/bin/sshd/Makefile	Tue Aug 16 05:42:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/07/25 03:03:10 christos Exp $
+#	$NetBSD: Makefile,v 1.7 2011/08/16 09:42:21 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -21,6 +21,7 @@
 .if defined(HAVE_GCC) || defined(HAVE_PCC)
 COPTS.auth-options.c=	-Wno-pointer-sign
 .endif
+COPTS.ldapauth.c=	-Wno-format-nonliteral	# XXX: should fix
 
 .if (${USE_PAM} != "no")
 SRCS+=	auth-pam.c

Index: src/crypto/external/bsd/openssh/dist/ldapauth.c
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.c:1.1 src/crypto/external/bsd/openssh/dist/ldapauth.c:1.2
--- src/crypto/external/bsd/openssh/dist/ldapauth.c:1.1	Sun Nov 21 13:59:04 2010
+++ src/crypto/external/bsd/openssh/dist/ldapauth.c	Tue Aug 16 05:42:21 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: ldapauth.c,v 1.1 2010/11/21 18:59:04 adam Exp $	*/
-/* $Id: ldapauth.c,v 1.1 2010/11/21 18:59:04 adam Exp $
+/*	$NetBSD: ldapauth.c,v 1.2 2011/08/16 09:42:21 christos Exp $	*/
+/* $Id: ldapauth.c,v 1.2 2011/08/16 09:42:21 christos Exp $
  */
 
 /*
@@ -23,7 +23,7 @@
  *
  */
 #include "includes.h"
-__RCSID("$NetBSD: ldapauth.c,v 1.1 2010/11/21 18:59:04 adam Exp $");
+__RCSID("$NetBSD: ldapauth.c,v 1.2 2011/08/16 09:42:21 christos Exp $");
 
 #ifdef WITH_LDAP_PUBKEY
 #include <stdarg.h>
@@ -456,6 +456,7 @@
         return FAILURE;
 
     /* build filter for LDAP request */
+/*###459 [cc] error: format not a string literal, argument types not checked%%%*/
     REQUEST_GROUP(filter, l->fgroup, user);
 
     if (ldap_search_st( l->ld, 

Index: src/crypto/external/bsd/openssh/dist/ssh-agent.c
diff -u src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.6 src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.7
--- src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.6	Sun Jul 24 23:03:11 2011
+++ src/crypto/external/bsd/openssh/dist/ssh-agent.c	Tue Aug 16 05:42:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssh-agent.c,v 1.6 2011/07/25 03:03:11 christos Exp $	*/
+/*	$NetBSD: ssh-agent.c,v 1.7 2011/08/16 09:42:21 christos Exp $	*/
 /* $OpenBSD: ssh-agent.c,v 1.171 2010/11/21 01:01:13 djm Exp $ */
 /*
  * Author: Tatu Ylonen <y...@cs.hut.fi>
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: ssh-agent.c,v 1.6 2011/07/25 03:03:11 christos Exp $");
+__RCSID("$NetBSD: ssh-agent.c,v 1.7 2011/08/16 09:42:21 christos Exp $");
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/queue.h>
@@ -1101,6 +1101,29 @@
 	exit(1);
 }
 
+static void
+csh_setenv(const char *name, const char *value)
+{
+	printf("setenv %s %s;\n", name, value);
+}
+
+static void
+csh_unsetenv(const char *name)
+{
+	printf("unsetenv %s;\n", name);
+}
+
+static void
+sh_setenv(const char *name, const char *value)
+{
+	printf("%s=%s; export %s;\n", name, value, name);
+}
+
+static void
+sh_unsetenv(const char *name)
+{
+	printf("unset %s;\n", name);
+}
 int
 main(int ac, char **av)
 {
@@ -1108,7 +1131,6 @@
 	int sock, fd, ch, result, saved_errno;
 	u_int nalloc;
 	char *shell, *pidstr, *agentsocket = NULL;
-	const char *format;
 	fd_set *readsetp = NULL, *writesetp = NULL;
 	struct sockaddr_un sunaddr;
 	struct rlimit rlim;
@@ -1118,6 +1140,8 @@
 	char pidstrbuf[1 + 3 * sizeof pid];
 	struct timeval *tvp = NULL;
 	size_t len;
+	void (*f_setenv)(const char *, const char *);
+	void (*f_unsetenv)(const char *);
 
 	/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
 	sanitise_stdfd();
@@ -1173,6 +1197,13 @@
 		    strncmp(shell + len - 3, "csh", 3) == 0)
 			c_flag = 1;
 	}
+	if (c_flag) {
+		f_setenv = csh_setenv;
+		f_unsetenv = csh_unsetenv;
+	} else {
+		f_setenv = sh_setenv;
+		f_unsetenv = sh_unsetenv;
+	}
 	if (k_flag) {
 		const char *errstr = NULL;
 
@@ -1193,9 +1224,8 @@
 			perror("kill");
 			exit(1);
 		}
-		format = c_flag ? "unsetenv %s;\n" : "unset %s;\n";
-		printf(format, SSH_AUTHSOCKET_ENV_NAME);
-		printf(format, SSH_AGENTPID_ENV_NAME);
+		(*f_unsetenv)(SSH_AUTHSOCKET_ENV_NAME);
+		(*f_unsetenv)(SSH_AGENTPID_ENV_NAME);
 		printf("echo Agent pid %ld killed;\n", (long)pid);
 		exit(0);
 	}
@@ -1245,9 +1275,7 @@
 	 */
 	if (d_flag) {
 		log_init(__progname, SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH, 1);
-		format = c_flag ? "setenv %s %s;\n" : "%s=%s; export %s;\n";
-		printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name,
-		    SSH_AUTHSOCKET_ENV_NAME);
+		(*f_setenv)(SSH_AUTHSOCKET_ENV_NAME, socket_name);
 		printf("echo Agent pid %ld;\n", (long)parent_pid);
 		goto skip;
 	}
@@ -1260,11 +1288,8 @@
 		close(sock);
 		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);
+			(*f_setenv)(SSH_AUTHSOCKET_ENV_NAME, socket_name);
+			(*f_setenv)(SSH_AGENTPID_ENV_NAME, pidstrbuf);
 			printf("echo Agent pid %ld;\n", (long)pid);
 			exit(0);
 		}

Reply via email to