From e66519d94207187a71d274ab70a6647318ed877d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 21 Mar 2005 22:46:34 +1100 Subject: - (dtucker) [configure.ac openbsd-compat/port-aix.h] Prevent redefinitions of setauthdb on AIX 5.3, reported by anders.liljegren at its.uu.se. --- openbsd-compat/port-aix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index a05ce9703..9e3dce4dd 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h @@ -1,4 +1,4 @@ -/* $Id: port-aix.h,v 1.24 2005/02/16 11:49:31 dtucker Exp $ */ +/* $Id: port-aix.h,v 1.25 2005/03/21 11:46:34 dtucker Exp $ */ /* * @@ -47,7 +47,9 @@ /* These should be in the system headers but are not. */ int usrinfo(int, char *, int); +#if (HAVE_DECL_SETAUTHDB == 0) int setauthdb(const char *, char *); +#endif /* these may or may not be in the headers depending on the version */ #if (HAVE_DECL_AUTHENTICATE == 0) int authenticate(char *, char *, int *, char **); -- cgit v1.2.3 From f3bb4341777eb44df1ca7db0d574f849821a186c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 31 Mar 2005 21:39:25 +1000 Subject: - (dtucker) [auth.h sshd.c openbsd-compat/port-aix.c] Bug #1006: fix bug in handling of password expiry messages returned by AIX's authentication routines, originally reported by robvdwal at sara.nl. --- ChangeLog | 5 ++++- auth.h | 4 ++++ openbsd-compat/port-aix.c | 4 ++-- sshd.c | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index a79ddda70..eba53b36e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ - jmc@cvs.openbsd.org 2005/03/18 17:05:00 [sshd_config.5] typo; + - (dtucker) [auth.h sshd.c openbsd-compat/port-aix.c] Bug #1006: fix bug in + handling of password expiry messages returned by AIX's authentication + routines, originally reported by robvdwal at sara.nl. 20050329 - (dtucker) [contrib/aix/buildbff.sh] Bug #1005: Look up only the user we're @@ -2402,4 +2405,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3731 2005/03/31 11:33:50 dtucker Exp $ +$Id: ChangeLog,v 1.3732 2005/03/31 11:39:25 dtucker Exp $ diff --git a/auth.h b/auth.h index 8d1f93403..471404e4e 100644 --- a/auth.h +++ b/auth.h @@ -30,6 +30,7 @@ #include "key.h" #include "hostfile.h" +#include "buffer.h" #include #ifdef HAVE_LOGIN_CAP @@ -68,6 +69,7 @@ struct Authctxt { char *krb5_ticket_file; char *krb5_ccname; #endif + Buffer *loginmsg; void *methoddata; }; /* @@ -185,6 +187,8 @@ void auth_debug_reset(void); struct passwd *fakepw(void); +int sys_auth_passwd(Authctxt *, const char *); + #define AUTH_FAIL_MSG "Too many authentication failures for %.100s" #define SKEY_PROMPT "\nS/Key Password: " diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index fa6a4ff7b..cf5d4b9a3 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -151,7 +151,7 @@ aix_valid_authentications(const char *user) * returns 0. */ int -sys_auth_passwd(Authctxt *ctxt, const char *password, Buffer *loginmsg) +sys_auth_passwd(Authctxt *ctxt, const char *password) { char *authmsg = NULL, *msg, *name = ctxt->pw->pw_name; int authsuccess = 0, expired, reenter, result; @@ -181,7 +181,7 @@ sys_auth_passwd(Authctxt *ctxt, const char *password, Buffer *loginmsg) */ expired = passwdexpired(name, &msg); if (msg && *msg) { - buffer_append(loginmsg, msg, strlen(msg)); + buffer_append(ctxt->loginmsg, msg, strlen(msg)); aix_remove_embedded_newlines(msg); } debug3("AIX/passwdexpired returned %d msg %.100s", expired, msg); diff --git a/sshd.c b/sshd.c index 11d618d11..b3fcc6964 100644 --- a/sshd.c +++ b/sshd.c @@ -1673,6 +1673,8 @@ main(int ac, char **av) authctxt = xmalloc(sizeof(*authctxt)); memset(authctxt, 0, sizeof(*authctxt)); + authctxt->loginmsg = &loginmsg; + /* XXX global for cleanup, access from other modules */ the_authctxt = authctxt; -- cgit v1.2.3 From df548bc31062fcc7f5ab618821ab4653b170ec60 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 24 May 2005 15:54:27 +1000 Subject: - (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure terminal modes are reset correctly. Fix from peak AT argo.troja.mff.cuni.cz; "looks ok" dtucker@ --- ChangeLog | 7 ++++++- openbsd-compat/readpassphrase.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index ecf83e4d5..0978c43ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20050512 + - (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure + terminal modes are reset correctly. Fix from peak AT argo.troja.mff.cuni.cz; + "looks ok" dtucker@ + 20050512 - (tim) [buildpkg.sh.in] missing ${PKG_INSTALL_ROOT} in init script hard link section. Bug 1038. @@ -2482,4 +2487,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3755 2005/05/12 17:32:19 tim Exp $ +$Id: ChangeLog,v 1.3756 2005/05/24 05:54:27 djm Exp $ diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 4ee1be5de..b5f4d1ce4 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -138,7 +138,9 @@ restart: /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, _T_FLUSH, &oterm); + for (;tcsetattr(input, _T_FLUSH, &oterm) == -1 && + errno == EINTR;) + ; (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); (void)sigaction(SIGINT, &saveint, NULL); -- cgit v1.2.3 From 308c8b147bb6a5598902870675c6c5d5975470aa Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 24 May 2005 16:39:03 +1000 Subject: nicer fix from millert@ --- openbsd-compat/readpassphrase.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index b5f4d1ce4..5138b4034 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -137,10 +137,11 @@ restart: (void)write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - for (;tcsetattr(input, _T_FLUSH, &oterm) == -1 && - errno == EINTR;) - ; + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 && + errno == EINTR) + continue; + } (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); (void)sigaction(SIGINT, &saveint, NULL); -- cgit v1.2.3 From 101afbbb170bdbc81026b0385ab735e9f23a2835 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 24 May 2005 16:42:00 +1000 Subject: restore portable-specific tweak --- openbsd-compat/readpassphrase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 5138b4034..eb060bdbf 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -138,7 +138,7 @@ restart: /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) { - while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 && + while (tcsetattr(input, _T_FLUSH, &oterm) == -1 && errno == EINTR) continue; } -- cgit v1.2.3 From ae8c91ec0749282e220f9c56efee1444a072cf62 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 25 May 2005 19:42:10 +1000 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory allocation when retrieving core Windows environment. Add CYGWIN variable to propagated variables. Patch from vinschen at redhat.com, ok djm@ --- ChangeLog | 5 ++++- openbsd-compat/bsd-cygwin_util.c | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index a7eab8fc9..24605b538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ idea, it is now known as UNSUPPORTED_POSIX_THREADS_HACK. Attempting to use USE_POSIX_THREADS will now generate an error so we don't silently change behaviour. ok djm@ + - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory + allocation when retrieving core Windows environment. Add CYGWIN variable + to propagated variables. Patch from vinschen at redhat.com, ok djm@ 20050524 - (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure @@ -2492,4 +2495,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3758 2005/05/25 06:18:09 dtucker Exp $ +$Id: ChangeLog,v 1.3759 2005/05/25 09:42:10 dtucker Exp $ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index f53abb6e2..b5e3cc52b 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -29,7 +29,7 @@ #include "includes.h" -RCSID("$Id: bsd-cygwin_util.c,v 1.13 2004/08/30 10:42:08 dtucker Exp $"); +RCSID("$Id: bsd-cygwin_util.c,v 1.14 2005/05/25 09:42:11 dtucker Exp $"); #ifdef HAVE_CYGWIN @@ -247,6 +247,7 @@ static struct wenv { { NL("COMMONPROGRAMFILES=") }, { NL("COMPUTERNAME=") }, { NL("COMSPEC=") }, + { NL("CYGWIN=") }, { NL("NUMBER_OF_PROCESSORS=") }, { NL("OS=") }, { NL("PATH=") }, @@ -260,7 +261,7 @@ static struct wenv { { NL("SYSTEMROOT=") }, { NL("TMP=") }, { NL("TEMP=") }, - { NL("WINDIR=") }, + { NL("WINDIR=") } }; char ** @@ -269,7 +270,7 @@ fetch_windows_environment(void) char **e, **p; int i, idx = 0; - p = xmalloc(WENV_SIZ * sizeof(char *)); + p = xmalloc((WENV_SIZ + 1) * sizeof(char *)); for (e = environ; *e != NULL; ++e) { for (i = 0; i < WENV_SIZ; ++i) { if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen)) -- cgit v1.2.3 From 5806767e5866d959078a1208ae969c2f8f2d1c7a Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 25 May 2005 19:42:40 +1000 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory allocation when retrieving core Windows environment. Add CYGWIN variable to propagated variables. Patch from vinschen at redhat.com, ok djm@ --- ChangeLog | 2 +- openbsd-compat/bsd-cygwin_util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd-compat') diff --git a/ChangeLog b/ChangeLog index 24605b538..7830d7d63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2495,4 +2495,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3759 2005/05/25 09:42:10 dtucker Exp $ +$Id: ChangeLog,v 1.3758.2.1 2005/05/25 09:42:40 dtucker Exp $ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index b5e3cc52b..ff394ec17 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -29,7 +29,7 @@ #include "includes.h" -RCSID("$Id: bsd-cygwin_util.c,v 1.14 2005/05/25 09:42:11 dtucker Exp $"); +RCSID("$Id: bsd-cygwin_util.c,v 1.13.4.1 2005/05/25 09:42:40 dtucker Exp $"); #ifdef HAVE_CYGWIN -- cgit v1.2.3