Compare commits

...

14 Commits
master ... f26

Author SHA1 Message Date
Frank Ch. Eigler b8ad224227 Merge branch 'f28' into f26
* f28:
  Backport fix for removed timers in kernel 4.15 (#1546563)
  Fixes for gcc 8.0.1
  Remove %clean section
  Remove BuildRoot definition
  Escape macros in %changelog
  Fix very old Requires
  Rebuilt for libjson-c.so.3
2018-02-22 10:40:16 -05:00
Frank Ch. Eigler 0384025141 Merge remote-tracking branch 'origin/f27' into f28
* origin/f27:
  Backport fix for removed timers in kernel 4.15 (#1546563)
2018-02-22 10:39:08 -05:00
Stan Cox d65c8777af Fixes for gcc 8.0.1 2018-02-14 11:25:36 -05:00
Stan Cox f70df36055 Fixes for gcc 8.0.1 2018-02-14 11:12:36 -05:00
Igor Gnatenko 75c387b28c
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 09:07:51 +01:00
Igor Gnatenko 2c11815ddb Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 00:42:22 +01:00
Igor Gnatenko 9be34952bf
Escape macros in %changelog
Reference: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Y2ZUKK2B7T2IKXPMODNF6HB2O5T5TS6H/
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-09 09:06:23 +01:00
Igor Gnatenko ac3f11bfc6
Fix very old Requires
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-07 17:44:25 +01:00
Björn Esser 64e8afca44
Rebuilt for libjson-c.so.3 2017-12-10 20:50:43 +01:00
Frank Ch. Eigler 846f2b32c6 Merge branch 'master' into f26
* master:
  rhbz1504009 - python2 ftbfs
  upstream release 3.2
  Rebuilt after RPM update (№ 3)
  Update systemtap to use modern (rpm >= 4.6) API
  Rebuilt for RPM soname bump
  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
  Automated weekly systemtap rawhide release: 0.20170512gitc67d8f274b21
  Automated weekly systemtap rawhide release: 0.20170410gitcbf2583808d6
  Automated weekly systemtap rawhide release: 0.20170406git83d186dc7f5c
  Automated weekly systemtap rawhide release: 0.20170321git272146660f54
  Rebuild for dyninst 9.3
2017-10-20 10:13:17 -04:00
Frank Ch. Eigler f6d32ace8f upstream 3.2 release 2017-10-18 14:20:46 -04:00
Frank Ch. Eigler 43d514b856 kernel 4.11 support 2017-05-15 15:38:09 -04:00
Frank Ch. Eigler cdc8fbe05c rhbz1439914 2017-04-06 17:06:04 -04:00
Stan Cox 61c8529211 rebuild for dyninst 9.3.1 2017-03-16 16:48:33 -04:00
2 changed files with 230 additions and 12 deletions

208
rhbz1544711.patch Normal file
View File

@ -0,0 +1,208 @@
commit a8e317b60 (HEAD -> master, origin/master, origin/HEAD)
Author: Stan Cox <scox@redhat.com>
Date: Tue Feb 13 22:38:03 2018 -0500
Fixes for gcc 8
* includes/sys/sdt.h (__SDT_COND_SIGNED): Add CT, cast type argument
Author: Will Cohen <wcohen.redhat.com>
* stap-serverd.cxx (generate_mok, handleRequest, handle_connection):
Catch format overflow
* translate.cxx (translate_pass): Use ref in catch.
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index 940f74483..c0c5a492c 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -119,8 +119,8 @@ struct __sdt_type
#define __SDT_ALWAYS_SIGNED(T) \
template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
-#define __SDT_COND_SIGNED(T) \
-template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 1); };
+#define __SDT_COND_SIGNED(T,CT) \
+template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
__SDT_ALWAYS_SIGNED(signed char)
__SDT_ALWAYS_SIGNED(short)
__SDT_ALWAYS_SIGNED(int)
@@ -141,14 +141,14 @@ __SDT_ALWAYS_SIGNED(const volatile short)
__SDT_ALWAYS_SIGNED(const volatile int)
__SDT_ALWAYS_SIGNED(const volatile long)
__SDT_ALWAYS_SIGNED(const volatile long long)
-__SDT_COND_SIGNED(char)
-__SDT_COND_SIGNED(wchar_t)
-__SDT_COND_SIGNED(volatile char)
-__SDT_COND_SIGNED(volatile wchar_t)
-__SDT_COND_SIGNED(const char)
-__SDT_COND_SIGNED(const wchar_t)
-__SDT_COND_SIGNED(const volatile char)
-__SDT_COND_SIGNED(const volatile wchar_t)
+__SDT_COND_SIGNED(char, char)
+__SDT_COND_SIGNED(wchar_t, wchar_t)
+__SDT_COND_SIGNED(volatile char, char)
+__SDT_COND_SIGNED(volatile wchar_t, wchar_t)
+__SDT_COND_SIGNED(const char, char)
+__SDT_COND_SIGNED(const wchar_t, wchar_t)
+__SDT_COND_SIGNED(const volatile char, char)
+__SDT_COND_SIGNED(const volatile wchar_t, wchar_t)
#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
/* __SDT_COND_SIGNED(char16_t) */
/* __SDT_COND_SIGNED(char32_t) */
diff --git a/stap-serverd.cxx b/stap-serverd.cxx
index b8f70114c..063c3c587 100644
--- a/stap-serverd.cxx
+++ b/stap-serverd.cxx
@@ -1607,6 +1607,7 @@ generate_mok(string &mok_fingerprint)
char tmpdir[PATH_MAX] = { '\0' };
string public_cert_path, private_cert_path, destdir;
mode_t old_umask;
+ int retlen;
mok_fingerprint.clear ();
@@ -1631,7 +1632,14 @@ generate_mok(string &mok_fingerprint)
}
// Make a temporary directory to store results in.
- snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ());
+ retlen = snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ());
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Could not create %s name", "temporary directory"));
+ tmpdir[0] = '\0';
+ goto cleanup;
+ }
+
if (mkdtemp (tmpdir) == NULL)
{
server_error (_F("Could not create temporary directory %s: %s", tmpdir,
@@ -1704,6 +1712,7 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
unsigned u;
unsigned i;
FILE* f;
+ int retlen;
// Save the server version. Do this early, so the client knows what version of the server
// it is dealing with, even if the request is not fully completed.
@@ -1782,7 +1791,12 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
struct stat st;
char *arg;
- snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i);
+ retlen = snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i);
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "path"));
+ return;
+ }
rc = stat(stapargfile, & st);
if (rc) break;
@@ -1888,7 +1902,15 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
{
glob_t globber;
char pattern[PATH_MAX];
- snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str());
+ int retlen;
+
+ retlen = snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str());
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "pattern"));
+ return;
+ }
+
rc = glob (pattern, GLOB_ERR, NULL, &globber);
if (rc)
server_error (_F("Unable to find a module in %s", new_staptmpdir.c_str()));
@@ -2164,6 +2186,7 @@ handle_connection (void *arg)
copy for each connection.*/
vector<string> argv;
PRInt32 bytesRead;
+ int retlen;
/* Detatch to avoid a memory leak */
if(max_threads > 0)
@@ -2213,7 +2236,13 @@ handle_connection (void *arg)
#endif
secStatus = SECFailure;
- snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp");
+ retlen = snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp");
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "temporary directory"));
+ tmpdir[0]=0; /* prevent /bin/rm */
+ goto cleanup;
+ }
rc1 = mkdtemp(tmpdir);
if (! rc1)
{
@@ -2223,9 +2252,20 @@ handle_connection (void *arg)
}
/* Create a temporary files names and directories. */
- snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir);
+ retlen = snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir);
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "request.zip path"));
+ goto cleanup;
+ }
+
+ retlen = snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir);
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "request directory path"));
+ goto cleanup;
+ }
- snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir);
rc = mkdir(requestDirName, 0700);
if (rc)
{
@@ -2233,7 +2273,13 @@ handle_connection (void *arg)
goto cleanup;
}
- snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir);
+ retlen = snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir);
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "response directory path"));
+ goto cleanup;
+ }
+
rc = mkdir(responseDirName, 0700);
if (rc)
{
@@ -2243,7 +2289,12 @@ handle_connection (void *arg)
// Set this early, since it gets used for errors to be returned to the client.
stapstderr = string(responseDirName) + "/stderr";
- snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir);
+ retlen = snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir);
+ if (retlen < 0 || retlen >= PATH_MAX)
+ {
+ server_error (_F("Error creating %s name", "response.zip path"));
+ goto cleanup;
+ }
/* Read data from the socket.
* If the user is requesting/requiring authentication, authenticate
diff --git a/translate.cxx b/translate.cxx
index 1240a80ec..4ade06fdd 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -7860,7 +7860,7 @@ translate_pass (systemtap_session& s)
if (versions.size() >= 3 && s.verbose > 1)
clog << _F("ignoring extra parts of compat version: %s", s.compatible.c_str()) << endl;
}
- catch (const runtime_error)
+ catch (const runtime_error&)
{
throw SEMANTIC_ERROR(_F("parse error in compatibility version: %s", s.compatible.c_str()));
}

View File

@ -72,16 +72,20 @@
%define dracutbindir %{_bindir}
%endif
# To avoid testsuite/*/*.stp has shebang which doesn't start with '/'
%undefine __brp_mangle_shebangs
Name: systemtap
Version: 3.2
Release: 3%{?dist}
Release: 7%{?dist}
# for version, see also configure.ac
Patch10: rhbz1504009.patch
Patch11: rhbz1544711.patch
# redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1546563
# upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=22551
Patch11: rhbz1546563.patch
Patch12: rhbz1546563.patch
# Packaging abstract:
#
@ -117,7 +121,6 @@ URL: http://sourceware.org/systemtap/
Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz
# Build*
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gcc-c++
BuildRequires: gettext-devel
BuildRequires: pkgconfig(nss)
@ -216,10 +219,7 @@ Group: Development/System
License: GPLv2+
URL: http://sourceware.org/systemtap/
Requires: systemtap-devel = %{version}-%{release}
# On RHEL[45], /bin/mktemp comes from the 'mktemp' package. On newer
# distributions, /bin/mktemp comes from the 'coreutils' package. To
# avoid a specific RHEL[45] Requires, we'll do a file-based require.
Requires: nss /bin/mktemp
Requires: nss coreutils
Requires: zip unzip
Requires(pre): shadow-utils
Requires(post): chkconfig
@ -486,6 +486,7 @@ cd ..
%patch10 -p1
%patch11 -p1
%patch12 -p1
%build
@ -710,9 +711,6 @@ done
touch $RPM_BUILD_ROOT%{dracutstap}/params.conf
%endif
%clean
rm -rf ${RPM_BUILD_ROOT}
%pre runtime
getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr
getent group stapsys >/dev/null || groupadd -g 157 -r stapsys 2>/dev/null || groupadd -r stapsys
@ -1166,9 +1164,21 @@ done
# PRERELEASE
%changelog
* Thu Feb 22 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 3.2-3
* Thu Feb 22 2018 Sergey Avseyev <sergey.avseyev@gmail.com> - 3.2-7
- rhbz1546563 (backport fix for removed timers in kernel 4.15)
* Tue Feb 13 2018 Stan Cox <scox@redhat.com> - 3.2-6
- rebuilt
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.2-5
- Escape macros in %%changelog
* Wed Feb 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.2-4
- Fix very old Requires
* Sun Dec 10 2017 Björn Esser <besser82@fedoraproject.org> - 3.2-3
- Rebuilt for libjson-c.so.3
* Fri Oct 20 2017 Frank Ch. Eigler <fche@redhat.com> - 3.2-2
- rhbz1504009 (dtrace -G -o /dev/null)
@ -1194,7 +1204,7 @@ done
- Upstream release.
* Mon Jul 07 2014 Josh Stone <jistone@redhat.com>
- Flip with_dyninst to an %ifarch whitelist.
- Flip with_dyninst to an %%ifarch whitelist.
* Wed Apr 30 2014 Jonathan Lebon <jlebon@redhat.com> - 2.5-1
- Upstream release.