View | Details | Raw Unified | Return to bug 2086 | Differences between
and this patch

Collapse All | Expand All

(-)auth.c (-1 / +3 lines)
Lines 721-730 fakepw(void) Link Here
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";
(-)configure.ac (-39 / +10 lines)
Lines 3302-3307 OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [ Link Here
3302
OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
3302
OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
3303
3303
3304
AC_CHECK_MEMBERS([struct stat.st_blksize])
3304
AC_CHECK_MEMBERS([struct stat.st_blksize])
3305
AC_CHECK_MEMBERS([
3306
	struct passwd.pw_gecos,
3307
	struct passwd.pw_class,
3308
	struct passwd.pw_change,
3309
	struct passwd.pw_expire
3310
], [], [], [
3311
#include <sys/types.h>
3312
#include <pwd.h>
3313
])
3314
3305
AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state],
3315
AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state],
3306
	[Define if we don't have struct __res_state in resolv.h])],
3316
	[Define if we don't have struct __res_state in resolv.h])],
3307
[
3317
[
Lines 3340-3384 AC_CACHE_CHECK([for __ss_family field in Link Here
3340
if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3350
if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3341
	AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
3351
	AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
3342
		[Fields in struct sockaddr_storage])
3352
		[Fields in struct sockaddr_storage])
3343
fi
3344
3345
AC_CACHE_CHECK([for pw_class field in struct passwd],
3346
		ac_cv_have_pw_class_in_struct_passwd, [
3347
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3348
	[[ struct passwd p; p.pw_class = 0; ]])],
3349
	[ ac_cv_have_pw_class_in_struct_passwd="yes" ],
3350
	[ ac_cv_have_pw_class_in_struct_passwd="no" 
3351
	])
3352
])
3353
if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3354
	AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1],
3355
		[Define if your password has a pw_class field])
3356
fi
3357
3358
AC_CACHE_CHECK([for pw_expire field in struct passwd],
3359
		ac_cv_have_pw_expire_in_struct_passwd, [
3360
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3361
	[[ struct passwd p; p.pw_expire = 0; ]])],
3362
	[ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
3363
	[ ac_cv_have_pw_expire_in_struct_passwd="no" 
3364
	])
3365
])
3366
if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3367
	AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1],
3368
		[Define if your password has a pw_expire field])
3369
fi
3370
3371
AC_CACHE_CHECK([for pw_change field in struct passwd],
3372
		ac_cv_have_pw_change_in_struct_passwd, [
3373
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3374
	[[ struct passwd p; p.pw_change = 0; ]])],
3375
	[ ac_cv_have_pw_change_in_struct_passwd="yes" ],
3376
	[ ac_cv_have_pw_change_in_struct_passwd="no" 
3377
	])
3378
])
3379
if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3380
	AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1],
3381
		[Define if your password has a pw_change field])
3382
fi
3353
fi
3383
3354
3384
dnl make sure we're using the real structure members and not defines
3355
dnl make sure we're using the real structure members and not defines
(-)misc.c (-3 / +5 lines)
Lines 206-221 pwcopy(struct passwd *pw) Link Here
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);
(-)monitor.c (-1 / +3 lines)
Lines 778-785 mm_answer_pwnamallow(int sock, Buffer *m Link Here
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);
(-)monitor_wrap.c (-1 / +3 lines)
Lines 259-266 mm_getpwnamallow(const char *username) Link Here
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);

Return to bug 2086