[openssh-commits] [openssh] 01/01: upstream: avoid spurious error message when ssh-keygen creates files

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jun 26 15:44:53 AEST 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 976c4f86286d52a0cb2aadf4a095d379c0da752e
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Jun 26 05:42:16 2020 +0000

    upstream: avoid spurious error message when ssh-keygen creates files
    
    outside ~/.ssh; with dtucker@
    
    OpenBSD-Commit-ID: ac0c662d44607e00ec78c266ee60752beb1c7e08
---
 Makefile.in  |  3 +--
 configure.ac |  8 +-------
 hostfile.c   | 10 ++++++----
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 99dfdced..30a7fff2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,7 +49,6 @@ PICFLAG=@PICFLAG@
 LIBS=@LIBS@
 K5LIBS=@K5LIBS@
 GSSLIBS=@GSSLIBS@
-SSHLIBS=@SSHLIBS@
 SSHDLIBS=@SSHDLIBS@
 LIBEDIT=@LIBEDIT@
 LIBFIDO2=@LIBFIDO2@
@@ -206,7 +205,7 @@ libssh.a: $(LIBSSH_OBJS)
 	$(RANLIB) $@
 
 ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
-	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) $(GSSLIBS)
+	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(GSSLIBS)
 
 sshd$(EXEEXT): libssh.a	$(LIBCOMPAT) $(SSHDOBJS)
 	$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS)
diff --git a/configure.ac b/configure.ac
index 0ea85bed..d6edb24f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4516,13 +4516,10 @@ AC_ARG_WITH([selinux],
 			  LIBS="$LIBS -lselinux"
 			],
 			AC_MSG_ERROR([SELinux support requires libselinux library]))
-		SSHLIBS="$SSHLIBS $LIBSELINUX"
-		SSHDLIBS="$SSHDLIBS $LIBSELINUX"
 		AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level])
-		LIBS="$save_LIBS"
+		LIBS="$save_LIBS $LIBSELINUX"
 	fi ]
 )
-AC_SUBST([SSHLIBS])
 AC_SUBST([SSHDLIBS])
 
 # Check whether user wants Kerberos 5 support
@@ -5483,9 +5480,6 @@ echo "         Libraries: ${LIBS}"
 if test ! -z "${SSHDLIBS}"; then
 echo "         +for sshd: ${SSHDLIBS}"
 fi
-if test ! -z "${SSHLIBS}"; then
-echo "          +for ssh: ${SSHLIBS}"
-fi
 
 echo ""
 
diff --git a/hostfile.c b/hostfile.c
index 1cc4dba9..936d8c9b 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.81 2020/06/26 05:02:03 dtucker Exp $ */
+/* $OpenBSD: hostfile.c,v 1.82 2020/06/26 05:42:16 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -465,9 +465,10 @@ hostfile_create_user_ssh_dir(const char *filename, int notify)
 		return;
 	len = p - filename;
 	dotsshdir = tilde_expand_filename("~/" _PATH_SSH_USER_DIR, getuid());
-	if ((strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0
-	    || stat(dotsshdir, &st)) == 0)
-		; /* do nothing, path not in ~/.ssh or dir already exists */
+	if (strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0)
+		goto out; /* not ~/.ssh prefixed */
+	if (stat(dotsshdir, &st) == 0)
+		goto out; /* dir already exists */
 	else if (errno != ENOENT)
 		error("Could not stat %s: %s", dotsshdir, strerror(errno));
 	else {
@@ -483,6 +484,7 @@ hostfile_create_user_ssh_dir(const char *filename, int notify)
 		ssh_selinux_setfscreatecon(NULL);
 #endif
 	}
+ out:
 	free(dotsshdir);
 }
 

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list