Resolves: #1012930 - proposed fix for selinux denial

This commit is contained in:
Ales Ledvinka 2013-10-24 16:39:13 +02:00
parent 0473a026c7
commit d623593258
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,34 @@
diff -up watchdog-5.13/src/test_binary.c.rhsel watchdog-5.13/src/test_binary.c
--- watchdog-5.13/src/test_binary.c.rhsel 2013-10-24 15:53:53.375647812 +0200
+++ watchdog-5.13/src/test_binary.c 2013-10-24 15:54:05.201666469 +0200
@@ -101,11 +101,11 @@ int check_bin(char *tbinary, time_t time
* to cause trouble, so make them go to their respective files */
strcpy(filename_buf, logdir);
strcat(filename_buf, "/test-bin.stdout");
- if (!freopen(filename_buf, "a+", stdout))
+ if (!freopen(filename_buf, "a", stdout))
exit (errno);
strcpy(filename_buf, logdir);
strcat(filename_buf, "/test-bin.stderr");
- if (!freopen(filename_buf, "a+", stderr))
+ if (!freopen(filename_buf, "a", stderr))
exit (errno);
/* now start binary */
diff -up watchdog-5.13/src/watchdog.c.rhsel watchdog-5.13/src/watchdog.c
--- watchdog-5.13/src/watchdog.c.rhsel 2013-10-24 15:58:09.245051038 +0200
+++ watchdog-5.13/src/watchdog.c 2013-10-24 15:58:15.958061605 +0200
@@ -148,11 +148,11 @@ static int repair(char *rbinary, int res
* So make stdout and stderr go to their respective files */
strcpy(filename_buf, logdir);
strcat(filename_buf, "/repair-bin.stdout");
- if (!freopen(filename_buf, "a+", stdout))
+ if (!freopen(filename_buf, "a", stdout))
exit (errno);
strcpy(filename_buf, logdir);
strcat(filename_buf, "/repair-bin.stderr");
- if (!freopen(filename_buf, "a+", stderr))
+ if (!freopen(filename_buf, "a", stderr))
exit (errno);
/* now start binary */

View File

@ -1,7 +1,7 @@
Summary: Software and/or Hardware watchdog daemon
Name: watchdog
Version: 5.13
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+
URL: http://sourceforge.net/projects/watchdog/
@ -15,6 +15,7 @@ Source4: watchdog.service
# Sent upstream on 2013-05-16.
Patch1: 0001-watchdog-Clearer-help-output.patch
Patch2: 0002-wd_identify-wd_keepalive-Document-c-config-file-in-h.patch
Patch3: 0003-watchdog-5.13-rhsel.patch
BuildRequires: systemd-units
@ -44,6 +45,7 @@ expiration) initiated by the BMC.
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
cp %{SOURCE2} .
cp %{SOURCE3} .
@ -122,6 +124,9 @@ fi
%changelog
* Thu Oct 24 2013 Ales Ledvinka <aledvink@redhat.com> - 5.13-5
- Selinux: do not reopen descriptors for reading when only appending.
* Fri Aug 9 2013 Richard W.M. Jones <rjones@redhat.com> - 5.13-4
- Fix License field (software is GPLv2+, not "GPL+").