[gpsd] update to 3.10

Miroslav Lichvar mlichvar at fedoraproject.org
Mon Nov 25 13:40:43 UTC 2013


commit c8c7b03095f9caad240dbc7e9ee251e6181de3a5
Author: Miroslav Lichvar <mlichvar at redhat.com>
Date:   Fri Nov 22 15:49:27 2013 +0100

    update to 3.10

 .gitignore          |    1 +
 gpsd-nolibcap.patch |  107 ++++++++++++++++++++++++++++++++++++++++++++++-----
 gpsd.spec           |    6 ++-
 sources             |    2 +-
 4 files changed, 104 insertions(+), 12 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7aa97fc..0098cc9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 /gpsd-3.5.tar.gz
 /gpsd-3.8.tar.gz
 /gpsd-3.9.tar.gz
+/gpsd-3.10.tar.gz
diff --git a/gpsd-nolibcap.patch b/gpsd-nolibcap.patch
index 7bea89e..bbfea1c 100644
--- a/gpsd-nolibcap.patch
+++ b/gpsd-nolibcap.patch
@@ -1,12 +1,99 @@
-diff -up gpsd-3.8/SConstruct.nolibcap gpsd-3.8/SConstruct
---- gpsd-3.8/SConstruct.nolibcap	2013-02-26 05:09:38.000000000 +0100
-+++ gpsd-3.8/SConstruct	2013-02-27 11:09:11.561350794 +0100
-@@ -490,7 +490,7 @@ else:
-     confdefs.append("/* #undef HAVE_LIBRT */\n")
+commit a128248dbcab3d15da72bdc77c53cbde8de0baa1
+Author: Miroslav Lichvar <mlichvar at redhat.com>
+Date:   Fri Nov 22 18:19:43 2013 +0100
+
+    Don't keep cap_sys_time capability.
+    
+    It's not necessary to keep the capability since time_pps_setparams is
+    called before root privileges are dropped.
+    
+    Signed-off-by: Eric S. Raymond <esr at thyrsus.com>
+
+diff --git a/SConstruct b/SConstruct
+index 4332fe4..c5120ae 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -455,7 +455,6 @@ if env.GetOption("clean") or env.GetOption("help"):
      rtlibs = []
+     usblibs = []
+     bluezlibs = []
+-    caplibs = []
+     ncurseslibs = []
+     confdefs = []
+     manbuilder = False
+@@ -558,14 +557,6 @@ else:
+         confdefs.append("/* #undef HAVE_LIBRT */\n")
+         rtlibs = []
  
--if config.CheckLib('libcap'):
-+if False and config.CheckLib('libcap'):
-     confdefs.append("#define HAVE_LIBCAP 1\n")
-     # System library - no special flags
-     caplibs = ["-lcap"]
+-    if config.CheckLib('libcap'):
+-        confdefs.append("#define HAVE_LIBCAP 1\n")
+-        # System library - no special flags
+-        caplibs = ["-lcap"]
+-    else:
+-        confdefs.append("/* #undef HAVE_LIBCAP */\n")
+-        caplibs = []
+-
+     if env['dbus_export'] and config.CheckPKG('dbus-1'):
+         confdefs.append("#define HAVE_DBUS 1\n")
+         dbus_libs = pkg_config('dbus-1')
+@@ -957,7 +948,7 @@ if qt_env:
+ # The libraries have dependencies on system libraries
+ 
+ gpslibs = ["-lgps", "-lm"]
+-gpsdlibs = ["-lgpsd"] + usblibs + bluezlibs + gpslibs + caplibs
++gpsdlibs = ["-lgpsd"] + usblibs + bluezlibs + gpslibs
+ 
+ 
+ # We need to be able to make a static client library for ad-hoc testing.
+diff --git a/gpsd.c b/gpsd.c
+index 76d1850..d7fce5f 100644
+--- a/gpsd.c
++++ b/gpsd.c
+@@ -44,11 +44,6 @@
+ 
+ #include "gpsd_config.h"
+ 
+-#if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S)
+-#include <sys/capability.h>
+-#include <sys/prctl.h>
+-#endif /* HAVE_LIBCAP */
+-
+ #include "gpsd.h"
+ #include "sockaddr.h"
+ #include "gps_json.h"
+@@ -2039,13 +2034,6 @@ int main(int argc, char *argv[])
+ 	struct passwd *pw;
+ 	struct stat stb;
+ 
+-#if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S)
+- 	/* set flag: keep privileges across setuid() call */
+-	if (prctl(PR_SET_KEEPCAPS, 1L, 0L, 0L, 0L) == -1)
+-	    gpsd_report(context.debug, LOG_ERR,
+-			"prctl(PR_SET_KEEPCAPS, 1L ) failed\n");
+-#endif /* HAVE_LIBCAP */
+-
+ 	/* make default devices accessible even after we drop privileges */
+ 	for (i = optind; i < argc; i++)
+ 	    /* coverity[toctou] */
+@@ -2091,21 +2079,6 @@ int main(int argc, char *argv[])
+ 			    "setuid() failed, errno %s\n",
+ 			    strerror(errno));
+ 	/*@+type@*/
+-
+- #if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S)
+-	/* drop root capabilities, except CAP_SYS_TIME for 1PPS support */
+-	{
+-	    cap_t caps = cap_from_text("cap_sys_time=pe");
+-
+-	    if (!caps)
+-		gpsd_report(context.debug, LOG_ERR, "cap_from_text() failed.\n");
+-	    else if (cap_set_proc(caps) == -1) {
+-		gpsd_report(context.debug, LOG_ERR,
+-			    "cap_set_proc() failed to drop root privs\n");
+-		cap_free(caps);
+-	    }
+-	}
+-#endif /* HAVE_LIBCAP */
+     }
+     gpsd_report(context.debug, LOG_INF,
+ 		"running with effective group ID %d\n", getegid());
diff --git a/gpsd.spec b/gpsd.spec
index dcadf30..7517650 100644
--- a/gpsd.spec
+++ b/gpsd.spec
@@ -1,5 +1,5 @@
 Name: gpsd
-Version: 3.9
+Version: 3.10
 Release: 2%{?dist}
 Summary: Service daemon for mediating access to a GPS
 
@@ -9,6 +9,7 @@ URL: http://catb.org/gpsd/
 Source0: http://download.savannah.gnu.org/releases/gpsd/%{name}-%{version}.tar.gz
 Source10: gpsd.service
 Source11: gpsd.sysconfig
+# PPS seems to be working without cap_sys_time
 Patch1: gpsd-nolibcap.patch
 
 BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python-devel
@@ -82,6 +83,7 @@ scons \
 	systemd=yes \
 	libQgpsmm=no \
 	debug=yes \
+	leapfetch=no \
 	prefix="" \
 	sysconfdif=%{_sysconfdir} \
 	bindir=%{_bindir} \
@@ -198,6 +200,7 @@ done
 %files clients
 %{_bindir}/cgps
 %{_bindir}/gegps
+%{_bindir}/gps2udp
 %{_bindir}/gpscat
 %{_bindir}/gpsdecode
 %{_bindir}/gpspipe
@@ -207,6 +210,7 @@ done
 %{_bindir}/xgpsspeed
 %{_mandir}/man1/gegps.1*
 %{_mandir}/man1/gps.1*
+%{_mandir}/man1/gps2udp.1*
 %{_mandir}/man1/gpsdecode.1*
 %{_mandir}/man1/gpspipe.1*
 %{_mandir}/man1/lcdgps.1*
diff --git a/sources b/sources
index 2f6012b..8f6af6a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-53a88f24a0973d23427e82e9a8914f19  gpsd-3.9.tar.gz
+fc5b03aae38b9b5b6880b31924d0ace3  gpsd-3.10.tar.gz


More information about the scm-commits mailing list