]> andersk Git - openssh.git/commitdiff
- (dtucker) [auth.c loginrec.h openbsd-compat/{bsd-cray,port-aix}.{c,h}]
authordtucker <dtucker>
Wed, 2 Feb 2005 06:10:11 +0000 (06:10 +0000)
committerdtucker <dtucker>
Wed, 2 Feb 2005 06:10:11 +0000 (06:10 +0000)
   Make record_failed_login() call provide hostname rather than having the
   implementations having to do lookups themselves.  Only affects AIX and
   UNICOS (the latter only uses the "user" parameter anyway).  ok djm@

ChangeLog
auth.c
loginrec.h
openbsd-compat/bsd-cray.c
openbsd-compat/bsd-cray.h
openbsd-compat/port-aix.c
openbsd-compat/port-aix.h

index 5d395d5d9930f2af322add200b0d1bdd06075cf7..8532e157b9b9943459950472033c86ccac45f64a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 20050202
  - (dtucker) [configure.ac openbsd-compat/realpath.c] Sync up with realpath
    rev 1.11 from OpenBSD and make it use fchdir if available.  ok djm@
+ - (dtucker) [auth.c loginrec.h openbsd-compat/{bsd-cray,port-aix}.{c,h}]
+   Make record_failed_login() call provide hostname rather than having the
+   implementations having to do lookups themselves.  Only affects AIX and
+   UNICOS (the latter only uses the "user" parameter anyway).  ok djm@
 
 20050201
  - (dtucker) [log.c] Bug #973: force log_init() to open syslog, since on some
diff --git a/auth.c b/auth.c
index 4698e3990ea951eab679002f207cadd6095f6137..dfc1be37460c60834972bcdb30c3e7d10a973bf4 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -50,6 +50,7 @@ RCSID("$OpenBSD: auth.c,v 1.57 2005/01/22 08:17:59 dtucker Exp $");
 #include "misc.h"
 #include "bufaux.h"
 #include "packet.h"
+#include "loginrec.h"
 
 /* import */
 extern ServerOptions options;
@@ -244,7 +245,8 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
 
 #ifdef CUSTOM_FAILED_LOGIN
        if (authenticated == 0 && strcmp(method, "password") == 0)
-               record_failed_login(authctxt->user, "ssh");
+               record_failed_login(authctxt->user,
+                   get_canonical_hostname(options.use_dns), "ssh");
 #endif
 }
 
@@ -468,7 +470,8 @@ getpwnamallow(const char *user)
                logit("Invalid user %.100s from %.100s",
                    user, get_remote_ipaddr());
 #ifdef CUSTOM_FAILED_LOGIN
-               record_failed_login(user, "ssh");
+               record_failed_login(user,
+                   get_canonical_hostname(options.use_dns), "ssh");
 #endif
                return (NULL);
        }
index 38b7f859e629199af87a79375585ab42a479d271..53607cb4bd7237b8ce79b2e46cd57257f75dfac7 100644 (file)
@@ -132,4 +132,6 @@ char *line_fullname(char *dst, const char *src, int dstsize);
 char *line_stripname(char *dst, const char *src, int dstsize);
 char *line_abbrevname(char *dst, const char *src, int dstsize);
 
+void record_failed_login(const char *, const char *, const char *);
+
 #endif /* _HAVE_LOGINREC_H_ */
index 9761a8b94dca00b2389e420200130fec31a1c669..8439d9b3e6de61374790b892236d1c40c46d6ec5 100644 (file)
@@ -171,7 +171,7 @@ cray_access_denied(char *username)
  * record_failed_login: generic "login failed" interface function
  */
 void
-record_failed_login(const char *user, const char *ttyname)
+record_failed_login(const char *user, const char *hostname, const char *ttyname)
 {
        cray_login_failure((char *)user, IA_UDBERR);
 }
index 8c9dd060d465c2b713dc9557f681da7c14ace604..be9fad9f0bf15fee9a31cd30b8dfe76f9ea2b63d 100644 (file)
@@ -42,10 +42,10 @@ void cray_init_job(struct passwd *);
 void cray_job_termination_handler(int);
 void cray_login_failure(char *, int );
 int cray_access_denied(char *);
-#define CUSTOM_FAILED_LOGIN 1
-void record_failed_login(const char *, const char *);
 extern char cray_tmpdir[];
 
+#define CUSTOM_FAILED_LOGIN 1
+
 #ifndef IA_SSHD
 # define IA_SSHD IA_LOGIN
 #endif
index e7eb179ec12f743fbd955fe2cf468d52651b75b0..79d180211f626e008c1ae111dc887ed310edfa44 100644 (file)
@@ -28,8 +28,6 @@
 #include "auth.h"
 #include "ssh.h"
 #include "log.h"
-#include "servconf.h"
-#include "canohost.h"
 #include "xmalloc.h"
 #include "buffer.h"
 
@@ -38,7 +36,6 @@
 #include <uinfo.h>
 #include "port-aix.h"
 
-extern ServerOptions options;
 extern Buffer loginmsg;
 
 # ifdef HAVE_SETAUTHDB
@@ -280,10 +277,8 @@ sys_auth_record_login(const char *user, const char *host, const char *ttynm)
  * record_failed_login: generic "login failed" interface function
  */
 void
-record_failed_login(const char *user, const char *ttyname)
+record_failed_login(const char *user, const char *hostname, const char *ttyname)
 {
-       char *hostname = (char *)get_canonical_hostname(options.use_dns);
-
        if (geteuid() != 0)
                return;
 
index 891fa8aa17324446b723ed62108694a24e8aa232..f4aaf8464e577192a6084ee405346c9d67fab067 100644 (file)
@@ -68,7 +68,6 @@ int sys_auth_allowed_user(struct passwd *);
 # define CUSTOM_SYS_AUTH_RECORD_LOGIN 1
 int sys_auth_record_login(const char *, const char *, const char *);
 # define CUSTOM_FAILED_LOGIN 1
-void record_failed_login(const char *, const char *);
 #endif
 
 void aix_setauthdb(const char *);
This page took 0.085274 seconds and 5 git commands to generate.