Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/openssh/dist - Avoid uninitialized varia...
details: https://anonhg.NetBSD.org/src/rev/82ad602d3a8c
branches: trunk
changeset: 343439:82ad602d3a8c
user: seanb <seanb%NetBSD.org@localhost>
date: Thu Feb 04 15:04:11 2016 +0000
description:
- Avoid uninitialized variable usage in do_nologin() when HAVE_LOGIN_CAP
isn't defined (which doesn't apply to NetBSD but...) and a root
login is being evaluated.
- From upstream.
diffstat:
crypto/external/bsd/openssh/dist/session.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r ed3f57958772 -r 82ad602d3a8c crypto/external/bsd/openssh/dist/session.c
--- a/crypto/external/bsd/openssh/dist/session.c Thu Feb 04 02:48:37 2016 +0000
+++ b/crypto/external/bsd/openssh/dist/session.c Thu Feb 04 15:04:11 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: session.c,v 1.16 2015/07/06 15:09:17 christos Exp $ */
+/* $NetBSD: session.c,v 1.17 2016/02/04 15:04:11 seanb Exp $ */
/* $OpenBSD: session.c,v 1.278 2015/04/24 01:36:00 deraadt Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-__RCSID("$NetBSD: session.c,v 1.16 2015/07/06 15:09:17 christos Exp $");
+__RCSID("$NetBSD: session.c,v 1.17 2016/02/04 15:04:11 seanb Exp $");
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/un.h>
@@ -1339,16 +1339,17 @@
if (login_getcapbool(lc, "ignorenologin", 0) || pw->pw_uid == 0)
return;
nl = login_getcapstr(lc, "nologin", def_nl, def_nl);
-
+#else
+ if (pw->pw_uid == 0)
+ return;
+ nl = def_nl;
+#endif
if (stat(nl, &sb) == -1) {
if (nl != def_nl)
free(nl);
return;
}
-#else
- if (pw->pw_uid)
- nl = def_nl;
-#endif
+
/* /etc/nologin exists. Print its contents if we can and exit. */
logit("User %.100s not allowed because %s exists", pw->pw_name, nl);
if ((f = fopen(nl, "r")) != NULL) {
Home |
Main Index |
Thread Index |
Old Index