From 630c23f5000186f3c7439b4329fa8fe937e34bda Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:26:35 +0000 Subject: import rhnsd-5.0.13-10.el7 --- diff --git a/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-7.1-el7.patch b/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-7.1-el7.patch deleted file mode 100644 index cf5d04c..0000000 --- a/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-7.1-el7.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/rhnsd.c b/rhnsd.c -index ad2100d..493aac0 100644 ---- a/rhnsd.c -+++ b/rhnsd.c -@@ -310,8 +310,12 @@ static int write_pid (const char *file) - FILE *fp; - - fp = fopen (file, "w"); -- if (fp == NULL) -- return -1; -+ if (fp == NULL) { -+ return -1; -+ } else if (chmod (file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) != 0) { -+ fclose(fp); -+ return -1; -+ } - - fprintf (fp, "%d\n", getpid ()); - if (fflush (fp) || ferror (fp)) { -diff --git a/rhnsd.spec b/rhnsd.spec -index 333a555..8ef3a39 100644 ---- a/rhnsd.spec -+++ b/rhnsd.spec -@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. - URL: https://fedorahosted.org/spacewalk - Name: rhnsd - Version: 5.0.13 --Release: 7%{?dist} -+Release: 7.1%{?dist} - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - - BuildRequires: gettext -@@ -138,6 +138,9 @@ rm -fr $RPM_BUILD_ROOT - %doc LICENSE - - %changelog -+* Tue Sep 12 2017 Gennadii Altukhov 5.0.13-7.1 -+- Resolves: #1489119 - change permissions for rhnsd.pid (galt@redhat.com) -+ - * Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 - - Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com) - diff --git a/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch b/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch new file mode 100644 index 0000000..054fe84 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch @@ -0,0 +1,75 @@ +diff --git a/rhnsd.c b/rhnsd.c +index ad2100d..896b433 100644 +--- a/rhnsd.c ++++ b/rhnsd.c +@@ -176,7 +176,6 @@ int main (int argc, char **argv) + + if (setsid() < 0) + exit(EXIT_FAILURE); +- umask(0); + + chdir ("/"); + +@@ -310,8 +309,12 @@ static int write_pid (const char *file) + FILE *fp; + + fp = fopen (file, "w"); +- if (fp == NULL) +- return -1; ++ if (fp == NULL) { ++ return -1; ++ } else if (chmod (file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) != 0) { ++ fclose(fp); ++ return -1; ++ } + + fprintf (fp, "%d\n", getpid ()); + if (fflush (fp) || ferror (fp)) { +@@ -397,6 +400,10 @@ static int rhn_do_action(void) + + /* close the read end of the pipe */ + close(fds[0]); ++ ++ /* close syslog file descriptor */ ++ closelog(); ++ + /* redirect stdout */ + if (fds[1] != STDOUT_FILENO) { + dup2(fds[1], STDOUT_FILENO); +@@ -406,6 +413,9 @@ static int rhn_do_action(void) + /* make sure this child has a stderr */ + dup2(STDOUT_FILENO, STDERR_FILENO); + ++ /* open a new syslog connection for the child */ ++ openlog("rhnsd", LOG_CONS | LOG_ODELAY | LOG_PID, LOG_DAEMON); ++ + /* syslog for safekeeping */ + syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); + +diff --git a/rhnsd.spec b/rhnsd.spec +index 333a555..42ad138 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. + URL: https://fedorahosted.org/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 7%{?dist} ++Release: 8%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,13 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 ++- Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) ++- Resolves: #1489989 - umask(0) does not reset to default umask ++ (tkasparek@redhat.com) ++- Resolves: #1475039 - close and reopen syslog when redirecting child output ++ (martin.matuska@axelspringer.de) ++ + * Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 + - Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com) + diff --git a/SOURCES/rhnsd-5.0.13-7.1-el7-to-rhnsd-5.0.13-7.2-el7.patch b/SOURCES/rhnsd-5.0.13-7.1-el7-to-rhnsd-5.0.13-7.2-el7.patch deleted file mode 100644 index cce3c73..0000000 --- a/SOURCES/rhnsd-5.0.13-7.1-el7-to-rhnsd-5.0.13-7.2-el7.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/rhnsd.c b/rhnsd.c -index 493aac0..77cfeb3 100644 ---- a/rhnsd.c -+++ b/rhnsd.c -@@ -401,6 +401,10 @@ static int rhn_do_action(void) - - /* close the read end of the pipe */ - close(fds[0]); -+ -+ /* close syslog file descriptor */ -+ closelog(); -+ - /* redirect stdout */ - if (fds[1] != STDOUT_FILENO) { - dup2(fds[1], STDOUT_FILENO); -@@ -410,6 +414,9 @@ static int rhn_do_action(void) - /* make sure this child has a stderr */ - dup2(STDOUT_FILENO, STDERR_FILENO); - -+ /* open a new syslog connection for the child */ -+ openlog("rhnsd", LOG_CONS | LOG_ODELAY | LOG_PID, LOG_DAEMON); -+ - /* syslog for safekeeping */ - syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); - -diff --git a/rhnsd.spec b/rhnsd.spec -index 8ef3a39..b55ea15 100644 ---- a/rhnsd.spec -+++ b/rhnsd.spec -@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. - URL: https://fedorahosted.org/spacewalk - Name: rhnsd - Version: 5.0.13 --Release: 7.1%{?dist} -+Release: 7.2%{?dist} - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - - BuildRequires: gettext -@@ -138,6 +138,10 @@ rm -fr $RPM_BUILD_ROOT - %doc LICENSE - - %changelog -+* Tue Oct 31 2017 Tomas Kasparek 5.0.13-7.2 -+- Resolves: #1506911 - close and reopen syslog when redirecting child output -+ (martin.matuska@axelspringer.de) -+ - * Tue Sep 12 2017 Gennadii Altukhov 5.0.13-7.1 - - Resolves: #1489119 - change permissions for rhnsd.pid (galt@redhat.com) - diff --git a/SOURCES/rhnsd-5.0.13-7.2-el7-to-rhnsd-5.0.13-7.3-el7.patch b/SOURCES/rhnsd-5.0.13-7.2-el7-to-rhnsd-5.0.13-7.3-el7.patch deleted file mode 100644 index f58e492..0000000 --- a/SOURCES/rhnsd-5.0.13-7.2-el7-to-rhnsd-5.0.13-7.3-el7.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/rhnsd.c b/rhnsd.c -index 77cfeb3..896b433 100644 ---- a/rhnsd.c -+++ b/rhnsd.c -@@ -176,7 +176,6 @@ int main (int argc, char **argv) - - if (setsid() < 0) - exit(EXIT_FAILURE); -- umask(0); - - chdir ("/"); - -diff --git a/rhnsd.spec b/rhnsd.spec -index b55ea15..c7ed440 100644 ---- a/rhnsd.spec -+++ b/rhnsd.spec -@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. - URL: https://fedorahosted.org/spacewalk - Name: rhnsd - Version: 5.0.13 --Release: 7.2%{?dist} -+Release: 7.3%{?dist} - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - - BuildRequires: gettext -@@ -138,6 +138,10 @@ rm -fr $RPM_BUILD_ROOT - %doc LICENSE - - %changelog -+* Tue Oct 31 2017 Tomas Kasparek 5.0.13-7.3 -+- Resolves: #1506910 - umask(0) does not reset to default umask -+ (tkasparek@redhat.com) -+ - * Tue Oct 31 2017 Tomas Kasparek 5.0.13-7.2 - - Resolves: #1506911 - close and reopen syslog when redirecting child output - (martin.matuska@axelspringer.de) diff --git a/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch b/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch new file mode 100644 index 0000000..7cc729d --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch @@ -0,0 +1,131 @@ +diff --git a/rhnsd.c b/rhnsd.c +index 896b433..6190c0a 100644 +--- a/rhnsd.c ++++ b/rhnsd.c +@@ -49,9 +49,6 @@ static int write_pid (const char *file); + static void print_version (FILE *stream, struct argp_state *state); + void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + +-/* Current rhn_check pid */ +-pid_t rhn_check_pid; +- + /* Definitions of arguments for argp functions. */ + static const struct argp_option options[] = + { +@@ -148,34 +145,16 @@ int main (int argc, char **argv) + if (!foreground) { + int i; + +- pid_t pid; +- pid = fork(); +- if (pid < 0) +- exit (EXIT_FAILURE); +- +- if (pid > 0) +- exit(EXIT_SUCCESS); +- ++ if (fork ()) ++ exit (0); + + for (i = 0; i < getdtablesize(); i++) + close (i); + +- /* read from /dev/null */ +- int devnull = open("/dev/null", O_RDONLY); +- if ((devnull >= 0) && (devnull != STDIN_FILENO)) { +- dup2(devnull, STDIN_FILENO); +- close(devnull); +- } +- +- pid = fork(); +- if (pid < 0) +- exit (EXIT_FAILURE); +- +- if (pid > 0) +- exit(EXIT_SUCCESS); ++ if (fork ()) ++ exit (0); + +- if (setsid() < 0) +- exit(EXIT_FAILURE); ++ setsid(); + + chdir ("/"); + +@@ -273,13 +252,11 @@ Written by %s.\n\ + static void termination_handler (int signum) + { + syslog(LOG_NOTICE, "Exiting"); +- /* Send SIGTERM to current running rhn_check +- * and wait for it to exit. */ +- kill(rhn_check_pid, SIGTERM); +- wait(NULL); ++ + /* Clean up pid file. */ + unlink (_PATH_RHNDPID); +- exit(EXIT_SUCCESS); ++ ++ exit (EXIT_SUCCESS); + } + + /* Returns 1 if the process in pid file FILE is running, 0 if not. */ +@@ -417,11 +394,10 @@ static int rhn_do_action(void) + openlog("rhnsd", LOG_CONS | LOG_ODELAY | LOG_PID, LOG_DAEMON); + + /* syslog for safekeeping */ +- syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); ++ syslog(LOG_DEBUG, "running program %s", RHN_CHECK); + + unset_signal_handlers (); + /* exec binary helper */ +- rhn_check_pid = getpid(); + args[0] = RHN_CHECK; + execv(RHN_CHECK, args); + +@@ -431,7 +407,6 @@ static int rhn_do_action(void) + strerror(errno)); + exit(errno); + } else if (child > 0) { +- set_signal_handlers(); + int ret = 1; + char *buf, buffer[10]; + int bufsize = 0; +diff --git a/rhnsd.init b/rhnsd.init +index dead8bf..ee3e811 100644 +--- a/rhnsd.init ++++ b/rhnsd.init +@@ -53,7 +53,7 @@ start() { + + stop() { + echo -n $"Stopping Spacewalk Daemon: " +- killproc rhnsd -TERM ++ killproc rhnsd + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then +diff --git a/rhnsd.spec b/rhnsd.spec +index 42ad138..2a192f6 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. + URL: https://fedorahosted.org/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 8%{?dist} ++Release: 9%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,12 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 ++- Related: #1499793 - revert previous reboot loop changes ++ (tkasparek@redhat.com) ++- Resolves: #1499793 - Revert "1260527 RHEL7 rhnsd reload doesn't work" ++ (tkasparek@redhat.com) ++ + * Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 + - Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) + - Resolves: #1489989 - umask(0) does not reset to default umask diff --git a/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch b/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch new file mode 100644 index 0000000..d2ac8a5 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch @@ -0,0 +1,30 @@ +diff --git a/rhnsd.spec b/rhnsd.spec +index 2a192f6..8f2e5ae 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -1,11 +1,11 @@ + Summary: Spacewalk query daemon + License: GPLv2 + Group: System Environment/Base +-Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz +-URL: https://fedorahosted.org/spacewalk ++Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz ++URL: https://github.com/spacewalkproject/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 9%{?dist} ++Release: 10%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,10 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Thu Oct 19 2017 Tomas Kasparek 5.0.13-10 ++- Resolves: #1503955 - upstream project has migrated to github ++ (tkasparek@redhat.com) ++ + * Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 + - Related: #1499793 - revert previous reboot loop changes + (tkasparek@redhat.com) diff --git a/SPECS/rhnsd.spec b/SPECS/rhnsd.spec index 39907aa..12c9a60 100644 --- a/SPECS/rhnsd.spec +++ b/SPECS/rhnsd.spec @@ -1,19 +1,19 @@ Summary: Spacewalk query daemon License: GPLv2 Group: System Environment/Base -Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz +Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz Patch0: rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch Patch1: rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch Patch2: rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch Patch3: rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch Patch4: rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch -Patch5: rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-7.1-el7.patch -Patch6: rhnsd-5.0.13-7.1-el7-to-rhnsd-5.0.13-7.2-el7.patch -Patch7: rhnsd-5.0.13-7.2-el7-to-rhnsd-5.0.13-7.3-el7.patch -URL: https://fedorahosted.org/spacewalk +Patch5: rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch +Patch6: rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch +Patch7: rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch +URL: https://github.com/spacewalkproject/spacewalk Name: rhnsd Version: 5.0.13 -Release: 7.3%{?dist} +Release: 10%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext @@ -154,16 +154,22 @@ rm -fr $RPM_BUILD_ROOT %doc LICENSE %changelog -* Tue Oct 31 2017 Tomas Kasparek 5.0.13-7.3 -- Resolves: #1506910 - umask(0) does not reset to default umask +* Thu Oct 19 2017 Tomas Kasparek 5.0.13-10 +- Resolves: #1503955 - upstream project has migrated to github (tkasparek@redhat.com) -* Tue Oct 31 2017 Tomas Kasparek 5.0.13-7.2 -- Resolves: #1506911 - close and reopen syslog when redirecting child output - (martin.matuska@axelspringer.de) +* Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 +- Related: #1499793 - revert previous reboot loop changes + (tkasparek@redhat.com) +- Resolves: #1499793 - Revert "1260527 RHEL7 rhnsd reload doesn't work" + (tkasparek@redhat.com) -* Tue Sep 12 2017 Gennadii Altukhov 5.0.13-7.1 -- Resolves: #1489119 - change permissions for rhnsd.pid (galt@redhat.com) +* Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 +- Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) +- Resolves: #1489989 - umask(0) does not reset to default umask + (tkasparek@redhat.com) +- Resolves: #1475039 - close and reopen syslog when redirecting child output + (martin.matuska@axelspringer.de) * Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 - Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com)