Bugzilla – Attachment 2251 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]
configure.ac tweeks
pw-gecos-3.diff (text/plain), 4.76 KB, created by
Tim Rice
on 2013-04-18 15:48:53 AEST
(
hide
)
Description:
configure.ac tweeks
Filename:
MIME Type:
Creator:
Tim Rice
Created:
2013-04-18 15:48:53 AEST
Size:
4.76 KB
patch
obsolete
>--- auth.c.old 2013-03-11 23:02:55.880336004 -0700 >+++ auth.c 2013-04-17 21:43:00.577637006 -0700 >@@ -721,10 +721,12 @@ > 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"; >--- configure.ac.old 2013-03-22 09:00:31.134096003 -0700 >+++ configure.ac 2013-04-17 22:28:16.213877020 -0700 >@@ -3302,9 +3302,16 @@ > 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])], >-[ >+[[ > #include <stdio.h> > #if HAVE_SYS_TYPES_H > # include <sys/types.h> >@@ -3312,7 +3319,7 @@ > #include <netinet/in.h> > #include <arpa/nameser.h> > #include <resolv.h> >-]) >+]]) > > AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], > ac_cv_have_ss_family_in_struct_ss, [ >@@ -3342,45 +3349,6 @@ > [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 > AC_CACHE_CHECK([for msg_accrights field in struct msghdr], > ac_cv_have_accrights_in_msghdr, [ >--- misc.c.old 2011-10-01 21:51:31.181039004 -0700 >+++ misc.c 2013-04-17 21:43:00.677637006 -0700 >@@ -206,16 +206,18 @@ > > 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); >--- monitor.c.old 2013-02-01 13:05:54.587174001 -0800 >+++ monitor.c 2013-04-17 21:43:00.687637023 -0700 >@@ -778,8 +778,10 @@ > 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); >--- monitor_wrap.c.old 2013-02-01 13:05:54.637174004 -0800 >+++ monitor_wrap.c 2013-04-17 21:43:00.787637009 -0700 >@@ -259,8 +259,10 @@ > 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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2086
:
2232
|
2237
|
2249
| 2251