Yes, this is really weird -- it makes gpsd work on most systems but not
on many modern ones that don't have serial.

Something like below might be appropriate (untested)

johannes

--- gpsd-2.39.orig/configure.ac 2009-08-28 14:56:07.491959141 +0200
+++ gpsd-2.39/configure.ac      2009-08-28 15:02:49.719470100 +0200
@@ -710,6 +710,17 @@ else
   AC_MSG_RESULT([nobody])
 fi
 
+dnl check for privilege revocation group at compile-time
+AC_ARG_ENABLE(gpsd-group,
+  AC_HELP_STRING([--enable-gpsd-group=groupname],
+                [GPSD privilege revokation group, use if /dev/ttyS0 not 
found]),
+  [ac_group=$enableval])
+AC_MSG_CHECKING([privilege revokation group])
+if test x"$ac_user" != "xnobody"; then
+    AC_MSG_RESULT([$ac_group])
+       AC_DEFINE_UNQUOTED([GPSD_GROUP], "$ac_group", [GPSD privilege 
revokation group])
+fi
+
 dnl check for port speed fixed at compile-time
 AC_ARG_ENABLE(fixed-port-speed,
   AC_HELP_STRING([--enable-fixed-port-speed=nnn],
--- gpsd-2.39.orig/gpsd.c       2009-08-28 14:52:26.259466630 +0200
+++ gpsd-2.39/gpsd.c    2009-08-28 14:55:21.179470310 +0200
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <assert.h>
 #include <pwd.h>
+#include <grp.h>
 #include <stdbool.h>
 #include <math.h>
 
@@ -1555,6 +1556,13 @@ int main(int argc, char *argv[])
            if (setgid(stb.st_gid) != 0)
                gpsd_report(LOG_ERROR, "setgid() failed, errno %s\n", 
strerror(errno));
        }
+#ifdef GPSD_GROUP
+       else {
+               struct group *grp = getgrnam(GPSD_GROUP);
+               if (grp)
+                       (void)setgid(grp->gr_gid);
+       }
+#endif
        pw = getpwnam(GPSD_USER);
        if (pw)
            (void)seteuid(pw->pw_uid);
--- gpsd-2.39.orig/gpsd_config.h.in     2009-08-28 14:55:46.779458871 +0200
+++ gpsd-2.39/gpsd_config.h.in  2009-08-28 14:56:03.439474778 +0200
@@ -47,6 +47,9 @@
 /* GPSD privilege revokation user */
 #undef GPSD_USER
 
+/* GPSD group */
+#undef GPSD_GROUP
+
 /* Define to 1 if you have `alloca', as a function or macro. */
 #undef HAVE_ALLOCA
 





-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to