summaryrefslogtreecommitdiffstats
path: root/libexec/telnetd/sys_term.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/telnetd/sys_term.c')
-rw-r--r--libexec/telnetd/sys_term.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 306449a..b1ca5c4 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -190,6 +190,7 @@ int ttyfd = -1;
#include <sys/types.h>
#include <libutil.h>
+#include <paths.h>
int cleanopen __P((char *));
void scrub_env __P((void));
@@ -512,7 +513,8 @@ int *ptynum;
#endif
#ifndef __hpux
- (void) strcpy(line, "/dev/ptyXX");
+ (void) strcpy(line, _PATH_DEV);
+ (void) strcat(line, "ptyXX");
p1 = &line[8];
p2 = &line[9];
#else
@@ -563,7 +565,7 @@ int *ptynum;
struct stat sb;
for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) {
- (void) sprintf(myline, "/dev/pty/%03d", *ptynum);
+ (void) sprintf(myline, "%spty/%03d", _PATH_DEV, *ptynum);
p = open(myline, 2);
if (p < 0)
continue;
@@ -1325,7 +1327,7 @@ login_tty(t)
* the indirect /dev/tty interface.
*/
close(t);
- if ((t = open("/dev/tty", O_RDWR)) < 0)
+ if ((t = open(_PATH_TTY, O_RDWR)) < 0)
fatalperror(net, "open(/dev/tty)");
# endif
# else
@@ -1414,7 +1416,7 @@ startslave(host, autologin, autoname)
wtmp.ut_pid = pid;
SCPYN(wtmp.ut_user, "LOGIN");
SCPYN(wtmp.ut_host, host);
- SCPYN(wtmp.ut_line, line + sizeof("/dev/") - 1);
+ SCPYN(wtmp.ut_line, line + sizeof(_PATH_DEV) - 1);
#ifndef __hpux
SCPYN(wtmp.ut_id, wtmp.ut_line+3);
#else
@@ -1546,7 +1548,7 @@ start_login(host, autologin, name)
bzero(&utmpx, sizeof(utmpx));
SCPYN(utmpx.ut_user, ".telnet");
- SCPYN(utmpx.ut_line, line + sizeof("/dev/") - 1);
+ SCPYN(utmpx.ut_line, line + sizeof(_PATH_DEV) - 1);
utmpx.ut_pid = pid;
utmpx.ut_id[0] = 't';
utmpx.ut_id[1] = 'n';
@@ -1823,7 +1825,7 @@ cleanup(sig)
# if (BSD > 43) || defined(convex)
char *p;
- p = line + sizeof("/dev/") - 1;
+ p = line + sizeof(_PATH_DEV) - 1;
if (logout(p))
logwtmp(p, "", "");
(void)chmod(line, 0666);
@@ -2102,7 +2104,7 @@ rmut()
* This updates the utmpx and utmp entries and make a wtmp/x entry
*/
- SCPYN(utmpx.ut_line, line + sizeof("/dev/") - 1);
+ SCPYN(utmpx.ut_line, line + sizeof(_PATH_DEV) - 1);
utxp = getutxline(&utmpx);
if (utxp) {
utxp->ut_type = DEAD_PROCESS;
@@ -2163,7 +2165,7 @@ rmut()
}
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
- line[strlen("/dev/")] = 'p';
+ line[strlen(_PATH_DEV)] = 'p';
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
} /* end of rmut */
OpenPOWER on IntegriCloud