summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-uw.c
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2020-08-21 00:00:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-08-21 00:00:13 +0000
commited358b3546c776c1c677fd88eb8f716cf6187510 (patch)
tree3c6134bcb2cda4b9dccc57b4a8b997a945aab62d /openbsd-compat/port-uw.c
parent22246b08952d746a7cc5a292570636cf4277598f (diff)
parent44a1065de8a58c51a021243a28bfa01e87822e4f (diff)
Merge changes I934c73d4,I28cdc9a0,I9e734da9,I3c079d86
* changes: UPSTREAM: depend UPSTREAM: upstream: avoid possible NULL deref; from Pedro Martelletto Revert "upstream: fix compilation with DEBUG_KEXDH; bz#3160 ok dtucker@" Merge upstream-master into master
Diffstat (limited to 'openbsd-compat/port-uw.c')
-rw-r--r--openbsd-compat/port-uw.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c
index db24dbb9..13221313 100644
--- a/openbsd-compat/port-uw.c
+++ b/openbsd-compat/port-uw.c
@@ -38,8 +38,6 @@
#include "xmalloc.h"
#include "packet.h"
-#include "buffer.h"
-#include "key.h"
#include "auth-options.h"
#include "log.h"
#include "misc.h" /* servconf.h needs misc.h for struct ForwardOptions */
@@ -47,12 +45,14 @@
#include "hostfile.h"
#include "auth.h"
#include "ssh.h"
+#include "ssh_api.h"
int nischeck(char *);
int
-sys_auth_passwd(Authctxt *authctxt, const char *password)
+sys_auth_passwd(struct ssh *ssh, const char *password)
{
+ Authctxt *authctxt = ssh->authctxt;
struct passwd *pw = authctxt->pw;
char *salt;
int result;
@@ -60,6 +60,9 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
/* Just use the supplied fake password if authctxt is invalid */
char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
+ if (pw_password == NULL)
+ return 0;
+
/* Check for users with no password. */
if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0)
return (1);
@@ -97,7 +100,7 @@ nischeck(char *namep)
if ((fd = fopen (password_file, "r")) == NULL) {
/*
- * If the passwd file has dissapeared we are in a bad state.
+ * If the passwd file has disappeared we are in a bad state.
* However, returning 0 will send us back through the
* authentication scheme that has checked the ia database for
* passwords earlier.