summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--auth.c4
-rw-r--r--configure.ac54
-rw-r--r--misc.c8
-rw-r--r--monitor.c4
-rw-r--r--monitor_wrap.c4
6 files changed, 30 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index cfd95e449..3fd81aa35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
120130423
2 - (djm) [auth.c configure.ac misc.c monitor.c monitor_wrap.c] Support
3 platforms, such as Android, that lack struct passwd.pw_gecos. Report
4 and initial patch from Nathan Osman bz#2086; feedback tim@ ok dtucker@
5
120130418 620130418
2 - (djm) [config.guess config.sub] Update to last versions before they switch 7 - (djm) [config.guess config.sub] Update to last versions before they switch
3 to GPL3. ok dtucker@ 8 to GPL3. ok dtucker@
diff --git a/auth.c b/auth.c
index 6128fa460..666c493dc 100644
--- a/auth.c
+++ b/auth.c
@@ -721,10 +721,12 @@ fakepw(void)
721 fake.pw_name = "NOUSER"; 721 fake.pw_name = "NOUSER";
722 fake.pw_passwd = 722 fake.pw_passwd =
723 "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; 723 "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";
724#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
724 fake.pw_gecos = "NOUSER"; 725 fake.pw_gecos = "NOUSER";
726#endif
725 fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; 727 fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid;
726 fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; 728 fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid;
727#ifdef HAVE_PW_CLASS_IN_PASSWD 729#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
728 fake.pw_class = ""; 730 fake.pw_class = "";
729#endif 731#endif
730 fake.pw_dir = "/nonexist"; 732 fake.pw_dir = "/nonexist";
diff --git a/configure.ac b/configure.ac
index 9777d597f..c30d547d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.520 2013/04/18 11:36:20 dtucker Exp $ 1# $Id: configure.ac,v 1.521 2013/04/23 04:25:53 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.520 $) 18AC_REVISION($Revision: 1.521 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -3303,9 +3303,16 @@ OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX])
3303OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX]) 3303OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
3304 3304
3305AC_CHECK_MEMBERS([struct stat.st_blksize]) 3305AC_CHECK_MEMBERS([struct stat.st_blksize])
3306AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class,
3307struct passwd.pw_change, struct passwd.pw_expire],
3308[], [], [[
3309#include <sys/types.h>
3310#include <pwd.h>
3311]])
3312
3306AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], 3313AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state],
3307 [Define if we don't have struct __res_state in resolv.h])], 3314 [Define if we don't have struct __res_state in resolv.h])],
3308[ 3315[[
3309#include <stdio.h> 3316#include <stdio.h>
3310#if HAVE_SYS_TYPES_H 3317#if HAVE_SYS_TYPES_H
3311# include <sys/types.h> 3318# include <sys/types.h>
@@ -3313,7 +3320,7 @@ AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [sta
3313#include <netinet/in.h> 3320#include <netinet/in.h>
3314#include <arpa/nameser.h> 3321#include <arpa/nameser.h>
3315#include <resolv.h> 3322#include <resolv.h>
3316]) 3323]])
3317 3324
3318AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], 3325AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
3319 ac_cv_have_ss_family_in_struct_ss, [ 3326 ac_cv_have_ss_family_in_struct_ss, [
@@ -3343,45 +3350,6 @@ if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3343 [Fields in struct sockaddr_storage]) 3350 [Fields in struct sockaddr_storage])
3344fi 3351fi
3345 3352
3346AC_CACHE_CHECK([for pw_class field in struct passwd],
3347 ac_cv_have_pw_class_in_struct_passwd, [
3348 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3349 [[ struct passwd p; p.pw_class = 0; ]])],
3350 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
3351 [ ac_cv_have_pw_class_in_struct_passwd="no"
3352 ])
3353])
3354if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3355 AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1],
3356 [Define if your password has a pw_class field])
3357fi
3358
3359AC_CACHE_CHECK([for pw_expire field in struct passwd],
3360 ac_cv_have_pw_expire_in_struct_passwd, [
3361 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3362 [[ struct passwd p; p.pw_expire = 0; ]])],
3363 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
3364 [ ac_cv_have_pw_expire_in_struct_passwd="no"
3365 ])
3366])
3367if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3368 AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1],
3369 [Define if your password has a pw_expire field])
3370fi
3371
3372AC_CACHE_CHECK([for pw_change field in struct passwd],
3373 ac_cv_have_pw_change_in_struct_passwd, [
3374 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3375 [[ struct passwd p; p.pw_change = 0; ]])],
3376 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
3377 [ ac_cv_have_pw_change_in_struct_passwd="no"
3378 ])
3379])
3380if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3381 AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1],
3382 [Define if your password has a pw_change field])
3383fi
3384
3385dnl make sure we're using the real structure members and not defines 3353dnl make sure we're using the real structure members and not defines
3386AC_CACHE_CHECK([for msg_accrights field in struct msghdr], 3354AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
3387 ac_cv_have_accrights_in_msghdr, [ 3355 ac_cv_have_accrights_in_msghdr, [
diff --git a/misc.c b/misc.c
index a7a23dcc6..9e287433a 100644
--- a/misc.c
+++ b/misc.c
@@ -206,16 +206,18 @@ pwcopy(struct passwd *pw)
206 206
207 copy->pw_name = xstrdup(pw->pw_name); 207 copy->pw_name = xstrdup(pw->pw_name);
208 copy->pw_passwd = xstrdup(pw->pw_passwd); 208 copy->pw_passwd = xstrdup(pw->pw_passwd);
209#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
209 copy->pw_gecos = xstrdup(pw->pw_gecos); 210 copy->pw_gecos = xstrdup(pw->pw_gecos);
211#endif
210 copy->pw_uid = pw->pw_uid; 212 copy->pw_uid = pw->pw_uid;
211 copy->pw_gid = pw->pw_gid; 213 copy->pw_gid = pw->pw_gid;
212#ifdef HAVE_PW_EXPIRE_IN_PASSWD 214#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
213 copy->pw_expire = pw->pw_expire; 215 copy->pw_expire = pw->pw_expire;
214#endif 216#endif
215#ifdef HAVE_PW_CHANGE_IN_PASSWD 217#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
216 copy->pw_change = pw->pw_change; 218 copy->pw_change = pw->pw_change;
217#endif 219#endif
218#ifdef HAVE_PW_CLASS_IN_PASSWD 220#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
219 copy->pw_class = xstrdup(pw->pw_class); 221 copy->pw_class = xstrdup(pw->pw_class);
220#endif 222#endif
221 copy->pw_dir = xstrdup(pw->pw_dir); 223 copy->pw_dir = xstrdup(pw->pw_dir);
diff --git a/monitor.c b/monitor.c
index 8006b833c..6560740b6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -778,8 +778,10 @@ mm_answer_pwnamallow(int sock, Buffer *m)
778 buffer_put_string(m, pwent, sizeof(struct passwd)); 778 buffer_put_string(m, pwent, sizeof(struct passwd));
779 buffer_put_cstring(m, pwent->pw_name); 779 buffer_put_cstring(m, pwent->pw_name);
780 buffer_put_cstring(m, "*"); 780 buffer_put_cstring(m, "*");
781#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
781 buffer_put_cstring(m, pwent->pw_gecos); 782 buffer_put_cstring(m, pwent->pw_gecos);
782#ifdef HAVE_PW_CLASS_IN_PASSWD 783#endif
784#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
783 buffer_put_cstring(m, pwent->pw_class); 785 buffer_put_cstring(m, pwent->pw_class);
784#endif 786#endif
785 buffer_put_cstring(m, pwent->pw_dir); 787 buffer_put_cstring(m, pwent->pw_dir);
diff --git a/monitor_wrap.c b/monitor_wrap.c
index ea654a73f..3304f5bf2 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -259,8 +259,10 @@ mm_getpwnamallow(const char *username)
259 fatal("%s: struct passwd size mismatch", __func__); 259 fatal("%s: struct passwd size mismatch", __func__);
260 pw->pw_name = buffer_get_string(&m, NULL); 260 pw->pw_name = buffer_get_string(&m, NULL);
261 pw->pw_passwd = buffer_get_string(&m, NULL); 261 pw->pw_passwd = buffer_get_string(&m, NULL);
262#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
262 pw->pw_gecos = buffer_get_string(&m, NULL); 263 pw->pw_gecos = buffer_get_string(&m, NULL);
263#ifdef HAVE_PW_CLASS_IN_PASSWD 264#endif
265#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
264 pw->pw_class = buffer_get_string(&m, NULL); 266 pw->pw_class = buffer_get_string(&m, NULL);
265#endif 267#endif
266 pw->pw_dir = buffer_get_string(&m, NULL); 268 pw->pw_dir = buffer_get_string(&m, NULL);