76 if (chdir(
"/dev") == -1)
_exit(0);
80 if (!(userext = env_get(
"LOCAL")))
_exit(0);
93 for (i = 0; i <
tofrom.len; ++i)
100 for (i = 0; i <
text.len; ++i)
101 if ((
text.s[i] < 32) || (
text.s[i] > 126))
106 if (!stralloc_cats(&
woof,
"\015\n"))
_exit(0);
108 if (!stralloc_cats(&
woof,
"\015\n"))
_exit(0);
111 fdutmp = open_read(UTMP_FILE);
112 if (fdutmp == -1)
_exit(0);
113 buffer_init(&
b,read,fdutmp,bufutmp,
sizeof(bufutmp));
115 while (buffer_get(&
b,(
char *)&
ut,
sizeof(
ut)) ==
sizeof(
ut))
116 if (!str_diffn(
ut.ut_name,
user,
sizeof(
ut.ut_name))) {
118 while ((
ut = getutxent()) != 0)
119 if (
ut->ut_type == USER_PROCESS && !str_diffn(
ut->ut_user,
user,
sizeof(
ut->ut_user))) {
122 byte_copy(line,
sizeof(
ut.ut_line),
ut.ut_line);
123 line[
sizeof(
ut.ut_line)] = 0;
125 byte_copy(line,
sizeof(
ut->ut_line),
ut->ut_line);
126 line[
sizeof(
ut->ut_line)] = 0;
128 if (line[0] ==
'/')
continue;
129 if (!line[0])
continue;
130 if (line[str_chr(line,
'.')])
continue;
132 fdtty = open_append(line);
133 if (
fdtty == -1)
continue;
134 if (fstat(
fdtty,&st) == -1) { close(
fdtty);
continue; }
135 if (!(st.st_mode & 0100)) { close(
fdtty);
continue; }
136 if (st.st_uid != getuid()) { close(
fdtty);
continue; }
int headerbody(buffer *b, void(*dohf)(), void(*hdone)(), void(*dobl)())