Bugzilla – Attachment 2249 Details for
Bug 2086
passwd struct does not have pw_gecos member on Android
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
use AC_CHECK_MEMBERS for all struct passwd member checks
pw-gecos-2.diff (text/plain), 5.50 KB, created by
Damien Miller
on 2013-04-18 12:13:59 AEST
(
hide
)
Description:
use AC_CHECK_MEMBERS for all struct passwd member checks
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2013-04-18 12:13:59 AEST
Size:
5.50 KB
patch
obsolete
>Index: auth.c >=================================================================== >RCS file: /var/cvs/openssh/auth.c,v >retrieving revision 1.157 >diff -u -p -r1.157 auth.c >--- auth.c 12 Mar 2013 00:31:05 -0000 1.157 >+++ auth.c 18 Apr 2013 02:13:36 -0000 >@@ -721,10 +721,12 @@ fakepw(void) > fake.pw_name = "NOUSER"; > fake.pw_passwd = > "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; >+#ifdef HAVE_STRUCT_PASSWD_PW_GECOS > fake.pw_gecos = "NOUSER"; >+#endif > fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; > fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; >-#ifdef HAVE_PW_CLASS_IN_PASSWD >+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS > fake.pw_class = ""; > #endif > fake.pw_dir = "/nonexist"; >Index: configure.ac >=================================================================== >RCS file: /var/cvs/openssh/configure.ac,v >retrieving revision 1.519 >diff -u -p -r1.519 configure.ac >--- configure.ac 22 Mar 2013 01:49:15 -0000 1.519 >+++ configure.ac 18 Apr 2013 02:13:36 -0000 >@@ -3302,6 +3302,16 @@ OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [ > OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX]) > > AC_CHECK_MEMBERS([struct stat.st_blksize]) >+AC_CHECK_MEMBERS([ >+ struct passwd.pw_gecos, >+ struct passwd.pw_class, >+ struct passwd.pw_change, >+ struct passwd.pw_expire >+], [], [], [ >+#include <sys/types.h> >+#include <pwd.h> >+]) >+ > AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], > [Define if we don't have struct __res_state in resolv.h])], > [ >@@ -3340,45 +3350,6 @@ AC_CACHE_CHECK([for __ss_family field in > if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then > AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], > [Fields in struct sockaddr_storage]) >-fi >- >-AC_CACHE_CHECK([for pw_class field in struct passwd], >- ac_cv_have_pw_class_in_struct_passwd, [ >- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]], >- [[ struct passwd p; p.pw_class = 0; ]])], >- [ ac_cv_have_pw_class_in_struct_passwd="yes" ], >- [ ac_cv_have_pw_class_in_struct_passwd="no" >- ]) >-]) >-if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then >- AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1], >- [Define if your password has a pw_class field]) >-fi >- >-AC_CACHE_CHECK([for pw_expire field in struct passwd], >- ac_cv_have_pw_expire_in_struct_passwd, [ >- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]], >- [[ struct passwd p; p.pw_expire = 0; ]])], >- [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], >- [ ac_cv_have_pw_expire_in_struct_passwd="no" >- ]) >-]) >-if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then >- AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1], >- [Define if your password has a pw_expire field]) >-fi >- >-AC_CACHE_CHECK([for pw_change field in struct passwd], >- ac_cv_have_pw_change_in_struct_passwd, [ >- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]], >- [[ struct passwd p; p.pw_change = 0; ]])], >- [ ac_cv_have_pw_change_in_struct_passwd="yes" ], >- [ ac_cv_have_pw_change_in_struct_passwd="no" >- ]) >-]) >-if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then >- AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1], >- [Define if your password has a pw_change field]) > fi > > dnl make sure we're using the real structure members and not defines >Index: misc.c >=================================================================== >RCS file: /var/cvs/openssh/misc.c,v >retrieving revision 1.111 >diff -u -p -r1.111 misc.c >--- misc.c 22 Sep 2011 11:34:36 -0000 1.111 >+++ misc.c 18 Apr 2013 02:13:36 -0000 >@@ -206,16 +206,18 @@ pwcopy(struct passwd *pw) > > copy->pw_name = xstrdup(pw->pw_name); > copy->pw_passwd = xstrdup(pw->pw_passwd); >+#ifdef HAVE_STRUCT_PASSWD_PW_GECOS > copy->pw_gecos = xstrdup(pw->pw_gecos); >+#endif > copy->pw_uid = pw->pw_uid; > copy->pw_gid = pw->pw_gid; >-#ifdef HAVE_PW_EXPIRE_IN_PASSWD >+#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE > copy->pw_expire = pw->pw_expire; > #endif >-#ifdef HAVE_PW_CHANGE_IN_PASSWD >+#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE > copy->pw_change = pw->pw_change; > #endif >-#ifdef HAVE_PW_CLASS_IN_PASSWD >+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS > copy->pw_class = xstrdup(pw->pw_class); > #endif > copy->pw_dir = xstrdup(pw->pw_dir); >Index: monitor.c >=================================================================== >RCS file: /var/cvs/openssh/monitor.c,v >retrieving revision 1.155 >diff -u -p -r1.155 monitor.c >--- monitor.c 11 Dec 2012 23:44:39 -0000 1.155 >+++ monitor.c 18 Apr 2013 02:13:36 -0000 >@@ -778,8 +778,10 @@ mm_answer_pwnamallow(int sock, Buffer *m > buffer_put_string(m, pwent, sizeof(struct passwd)); > buffer_put_cstring(m, pwent->pw_name); > buffer_put_cstring(m, "*"); >+#ifdef HAVE_STRUCT_PASSWD_PW_GECOS > buffer_put_cstring(m, pwent->pw_gecos); >-#ifdef HAVE_PW_CLASS_IN_PASSWD >+#endif >+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS > buffer_put_cstring(m, pwent->pw_class); > #endif > buffer_put_cstring(m, pwent->pw_dir); >Index: monitor_wrap.c >=================================================================== >RCS file: /var/cvs/openssh/monitor_wrap.c,v >retrieving revision 1.91 >diff -u -p -r1.91 monitor_wrap.c >--- monitor_wrap.c 9 Jan 2013 05:12:19 -0000 1.91 >+++ monitor_wrap.c 18 Apr 2013 02:13:36 -0000 >@@ -259,8 +259,10 @@ mm_getpwnamallow(const char *username) > fatal("%s: struct passwd size mismatch", __func__); > pw->pw_name = buffer_get_string(&m, NULL); > pw->pw_passwd = buffer_get_string(&m, NULL); >+#ifdef HAVE_STRUCT_PASSWD_PW_GECOS > pw->pw_gecos = buffer_get_string(&m, NULL); >-#ifdef HAVE_PW_CLASS_IN_PASSWD >+#endif >+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS > pw->pw_class = buffer_get_string(&m, NULL); > #endif > pw->pw_dir = buffer_get_string(&m, NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2086
:
2232
|
2237
|
2249
|
2251