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

Collapse All | Expand All

(-)a/configure.ac (+2 lines)
Lines 836-841 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) Link Here
836
	dnl Target SUSv3/POSIX.1-2001 plus BSD specifics.
836
	dnl Target SUSv3/POSIX.1-2001 plus BSD specifics.
837
	dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE
837
	dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE
838
	CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE"
838
	CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE"
839
	AC_DEFINE([BROKEN_CLOSEFROM], [1], [broken in chroots on older kernels])
839
	AC_DEFINE([PAM_TTY_KLUDGE], [1],
840
	AC_DEFINE([PAM_TTY_KLUDGE], [1],
840
		[Work around problematic Linux PAM modules handling of PAM_TTY])
841
		[Work around problematic Linux PAM modules handling of PAM_TTY])
841
	AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
842
	AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
Lines 1817-1822 AC_CHECK_FUNCS([ \ Link Here
1817
	cap_rights_limit \
1818
	cap_rights_limit \
1818
	clock \
1819
	clock \
1819
	closefrom \
1820
	closefrom \
1821
	close_range \
1820
	dirfd \
1822
	dirfd \
1821
	endgrent \
1823
	endgrent \
1822
	err \
1824
	err \
(-)a/openbsd-compat/bsd-closefrom.c (-1 / +6 lines)
Lines 16-22 Link Here
16
16
17
#include "includes.h"
17
#include "includes.h"
18
18
19
#ifndef HAVE_CLOSEFROM
19
#if !defined(HAVE_CLOSEFROM) || defined(BROKEN_CLOSEFROM)
20
20
21
#include <sys/types.h>
21
#include <sys/types.h>
22
#include <sys/param.h>
22
#include <sys/param.h>
Lines 130-135 closefrom(int lowfd) Link Here
130
    DIR *dirp;
130
    DIR *dirp;
131
    int len;
131
    int len;
132
132
133
#ifdef HAVE_CLOSE_RANGE
134
	if (close_range(lowfd, INT_MAX, 0) == 0)
135
		return;
136
#endif
137
133
    /* Check for a /proc/$$/fd directory. */
138
    /* Check for a /proc/$$/fd directory. */
134
    len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
139
    len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
135
    if (len > 0 && (size_t)len < sizeof(fdpath) && (dirp = opendir(fdpath))) {
140
    if (len > 0 && (size_t)len < sizeof(fdpath) && (dirp = opendir(fdpath))) {

Return to bug 3349