8792c50fc0
Suggestions and testing by jolan@ and steven@ - Thanks! ok jolan, steven
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
$OpenBSD: patch-gpsd_c,v 1.2 2006/10/27 23:47:23 ckuethe Exp $
|
|
--- gpsd.c.orig Fri Jun 9 06:34:09 2006
|
|
+++ gpsd.c Wed Jun 14 19:24:24 2006
|
|
@@ -64,7 +64,7 @@
|
|
* The name of a tty device from which to pick up whatever the local
|
|
* owning group for tty devices is. Used when we drop privileges.
|
|
*/
|
|
-#define PROTO_TTY "/dev/ttyS0"
|
|
+#define PROTO_TTY "/dev/tty00"
|
|
|
|
static fd_set all_fds;
|
|
static int debuglevel;
|
|
@@ -1244,7 +1244,7 @@ int main(int argc, char *argv[])
|
|
(void)chmod(argv[i], stb.st_mode|S_IRGRP|S_IWGRP);
|
|
/*
|
|
* Drop privileges. Up to now we've been running as root. Instead,
|
|
- * set the user ID to 'nobody' and the group ID to the owning group
|
|
+ * set the user ID to '_gpsd' and the group ID to the owning group
|
|
* of a prototypical TTY device. This limits the scope of any
|
|
* compromises in the code. It requires that all GPS devices have
|
|
* their group read/write permissions set.
|
|
@@ -1254,7 +1254,7 @@ int main(int argc, char *argv[])
|
|
if (setgid(stb.st_gid) != 0)
|
|
gpsd_report(0, "setgid() failed, errno %s\n", strerror(errno));
|
|
}
|
|
- pw = getpwnam("nobody");
|
|
+ pw = getpwnam("_gpsd");
|
|
if (pw)
|
|
(void)setuid(pw->pw_uid);
|
|
}
|