summaryrefslogtreecommitdiffstats
path: root/lib/libutil/login_fbtab.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-04-13 15:26:44 +0000
committermillert <millert@openbsd.org>1998-04-13 15:26:44 +0000
commit48397f5f5cec384f4d6401a898b4a62917c5cec5 (patch)
tree3a996a25a2e56e1444a4ca77a902030796d99e98 /lib/libutil/login_fbtab.c
parentfixup active vs. passive info (diff)
downloadwireguard-openbsd-48397f5f5cec384f4d6401a898b4a62917c5cec5.tar.xz
wireguard-openbsd-48397f5f5cec384f4d6401a898b4a62917c5cec5.zip
Use _PATH_DEV, not "/dev/"
Make init(8) call login_fbtab() correctly.
Diffstat (limited to 'lib/libutil/login_fbtab.c')
-rw-r--r--lib/libutil/login_fbtab.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libutil/login_fbtab.c b/lib/libutil/login_fbtab.c
index 646199568a6..25b0e82c2a4 100644
--- a/lib/libutil/login_fbtab.c
+++ b/lib/libutil/login_fbtab.c
@@ -66,6 +66,7 @@
#include <errno.h>
#include <dirent.h>
#include <unistd.h>
+#include <paths.h>
#include "util.h"
@@ -96,7 +97,7 @@ login_fbtab(tty, uid, gid)
*cp = 0; /* strip comment */
if ((cp = devname = strtok(buf, WSPACE)) == 0)
continue; /* empty or comment */
- if (strncmp(devname, "/dev/", sizeof("/dev/")-1) != 0 ||
+ if (strncmp(devname, _PATH_DEV, sizeof(_PATH_DEV) - 1) != 0 ||
(cp = strtok((char *) 0, WSPACE)) == 0 ||
*cp != '0' ||
sscanf(cp, "%o", &prot) == 0 ||
@@ -107,7 +108,7 @@ login_fbtab(tty, uid, gid)
cp ? cp : "(null)");
continue;
}
- if (strcmp(devname + 5, tty) == 0)
+ if (strcmp(devname + sizeof(_PATH_DEV) - 1, tty) == 0)
for (cp = strtok(cp, ":"); cp; cp = strtok(NULL, ":"))
login_protect(table, cp, prot, uid, gid);
}