fix one error in closing file descriptors
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
This commit is contained in:
parent
a0b1a450d2
commit
0cd89e34e3
@ -0,0 +1,27 @@
|
|||||||
|
From 1c9b021e78dc67b9cdca5f9ad10cbde08418ee28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Arthur de Jong <arthur@arthurdejong.org>
|
||||||
|
Date: Mon, 10 Oct 2022 23:15:06 +0200
|
||||||
|
Subject: [PATCH] Fix off-by one error in closing file descriptors
|
||||||
|
|
||||||
|
This could leave file descriptor 3 open from the parent process starting
|
||||||
|
nslcd.
|
||||||
|
---
|
||||||
|
nslcd/daemonize.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/nslcd/daemonize.c b/nslcd/daemonize.c
|
||||||
|
index d11d358..be3b386 100644
|
||||||
|
--- a/nslcd/daemonize.c
|
||||||
|
+++ b/nslcd/daemonize.c
|
||||||
|
@@ -50,7 +50,7 @@ void daemonize_closefds(void)
|
||||||
|
hope we closed enough */
|
||||||
|
if (i < 0)
|
||||||
|
i = 32;
|
||||||
|
- for (; i > 3; i--)
|
||||||
|
+ for (; i > 2; i--)
|
||||||
|
close(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: nss-pam-ldapd
|
Name: nss-pam-ldapd
|
||||||
Version: 0.9.12
|
Version: 0.9.12
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: NSS and PAM libraries for name lookups and authentication using LDAP
|
Summary: NSS and PAM libraries for name lookups and authentication using LDAP
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://arthurdejong.org/nss-pam-ldapd/
|
URL: http://arthurdejong.org/nss-pam-ldapd/
|
||||||
@ -13,6 +13,7 @@ Source4: nslcd.service
|
|||||||
|
|
||||||
Patch0: 0001-Disable-pylint-tests.patch
|
Patch0: 0001-Disable-pylint-tests.patch
|
||||||
Patch1: 0002-Watch-for-uint32_t-overflows.patch
|
Patch1: 0002-Watch-for-uint32_t-overflows.patch
|
||||||
|
Patch2: backport-Fix-off-by-one-error-in-closing-file-descriptors.patch
|
||||||
|
|
||||||
BuildRequires: gcc, openldap-devel, krb5-devel, autoconf, automake, pam-devel, systemd-units
|
BuildRequires: gcc, openldap-devel, krb5-devel, autoconf, automake, pam-devel, systemd-units
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
@ -100,6 +101,12 @@ getent passwd nslcd > /dev/null || \
|
|||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Oct 19 2022 yixiangzhike <yixiangzhike007@163.com> - 0.9.12-2
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:fix off-by one error in closing file descriptors
|
||||||
|
|
||||||
* Mon Feb 21 2022 yixiangzhike <yixiangzhike007@163.com> - 0.9.12-1
|
* Mon Feb 21 2022 yixiangzhike <yixiangzhike007@163.com> - 0.9.12-1
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user