don't leak file descriptors to help browser process (#455450)
This commit is contained in:
parent
3477043693
commit
ba752ca48e
30
xsane-0.995-close-fds.patch
Normal file
30
xsane-0.995-close-fds.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
diff -up xsane-0.995/src/xsane.c.close-fds xsane-0.995/src/xsane.c
|
||||||
|
--- xsane-0.995/src/xsane.c.close-fds 2007-09-28 17:24:56.000000000 +0200
|
||||||
|
+++ xsane-0.995/src/xsane.c 2008-07-15 17:48:17.000000000 +0200
|
||||||
|
@@ -3681,6 +3681,8 @@ static void xsane_show_doc_via_nsr(GtkWi
|
||||||
|
char *arg[5];
|
||||||
|
struct stat st;
|
||||||
|
char netscape_lock_path[PATH_MAX];
|
||||||
|
+ int open_max;
|
||||||
|
+ int i;
|
||||||
|
|
||||||
|
DBG(DBG_proc, "xsane_show_doc_via_nsr(%s)\n", name);
|
||||||
|
|
||||||
|
@@ -3725,6 +3727,17 @@ static void xsane_show_doc_via_nsr(GtkWi
|
||||||
|
ipc_file = fdopen(xsane.ipc_pipefd[1], "w");
|
||||||
|
}
|
||||||
|
|
||||||
|
+ open_max = (int) sysconf (_SC_OPEN_MAX);
|
||||||
|
+
|
||||||
|
+ DBG(DBG_info, "closing unneeded file descriptors\n");
|
||||||
|
+
|
||||||
|
+ /* leave stdin, stdout, stderr alone */
|
||||||
|
+ for (i = 3; i < open_max; i++) {
|
||||||
|
+ /* xsane.ipc_pipefd[0] is closed by now */
|
||||||
|
+ if (i != xsane.ipc_pipefd[1])
|
||||||
|
+ close (i);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
DBG(DBG_info, "trying to change user id for new subprocess:\n");
|
||||||
|
DBG(DBG_info, "old effective uid = %d\n", (int) geteuid());
|
||||||
|
setuid(getuid());
|
@ -3,12 +3,13 @@
|
|||||||
Name: xsane
|
Name: xsane
|
||||||
Summary: X Window System front-end for the SANE scanner interface
|
Summary: X Window System front-end for the SANE scanner interface
|
||||||
Version: 0.995
|
Version: 0.995
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
|
Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
|
||||||
Source1: xsane.desktop
|
Source1: xsane.desktop
|
||||||
Source2: xsane.conf.in
|
Source2: xsane.conf.in
|
||||||
Patch0: xsane-0.995-xdg-open.patch
|
Patch0: xsane-0.995-xdg-open.patch
|
||||||
Patch1: xsane-0.995-eula-license-size.patch
|
Patch1: xsane-0.995-eula-license-size.patch
|
||||||
|
Patch2: xsane-0.995-close-fds.patch
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.xsane.org/
|
URL: http://www.xsane.org/
|
||||||
Group: Applications/Multimedia
|
Group: Applications/Multimedia
|
||||||
@ -41,6 +42,7 @@ installed to use this package.
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1 -b .xdg-open
|
%patch0 -p1 -b .xdg-open
|
||||||
%patch1 -p1 -b .eula-license-size
|
%patch1 -p1 -b .eula-license-size
|
||||||
|
%patch2 -p1 -b .close-fds
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --enable-gimp
|
%configure --enable-gimp
|
||||||
@ -105,6 +107,9 @@ fi
|
|||||||
%config(noreplace) %{_sysconfdir}/gimp/plugins.d/xsane.conf
|
%config(noreplace) %{_sysconfdir}/gimp/plugins.d/xsane.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 15 2008 Nils Philippsen <nphilipp@redhat.com> - 0.995-4
|
||||||
|
- don't leak file descriptors to help browser process (#455450)
|
||||||
|
|
||||||
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.995-3
|
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.995-3
|
||||||
- Autorebuild for GCC 4.3
|
- Autorebuild for GCC 4.3
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user