Lines Matching refs:entryx
119 struct utmpx entryx; in main() local
161 load_utmpx_struct(&entryx, argv); in main()
162 check_utmpx(&entryx); in main()
168 if (fstatat(devfd, entryx.ut_line, &stat_arg, 0) < 0) { in main()
188 err = invalid_utmpx(&entryx, rutmpx); in main()
198 if (pututxline(&entryx) == (struct utmpx *)NULL) { in main()
226 load_utmpx_struct(struct utmpx *entryx, char *argv[]) in load_utmpx_struct() argument
233 (void) memset(entryx, 0, sizeof (struct utmpx)); in load_utmpx_struct()
249 (void) strncpy(entryx->ut_user, user, sizeof (entryx->ut_user)); in load_utmpx_struct()
250 (void) strncpy(entryx->ut_id, id, sizeof (entryx->ut_id)); in load_utmpx_struct()
251 (void) strncpy(entryx->ut_line, line, sizeof (entryx->ut_line)); in load_utmpx_struct()
254 entryx->ut_pid = temp; in load_utmpx_struct()
257 entryx->ut_type = temp; in load_utmpx_struct()
260 entryx->ut_exit.e_termination = temp; in load_utmpx_struct()
263 entryx->ut_exit.e_exit = temp; in load_utmpx_struct()
269 if (entryx->ut_type == USER_PROCESS) in load_utmpx_struct()
270 setuserx(*entryx); in load_utmpx_struct()
273 entryx->ut_tv.tv_sec = temp; in load_utmpx_struct()
276 entryx->ut_tv.tv_usec = temp; in load_utmpx_struct()
279 entryx->ut_session = temp; in load_utmpx_struct()
282 cp = (unsigned char *)entryx->pad; in load_utmpx_struct()
283 for (i = 0; i < temp && (i>>1) < sizeof (entryx->pad); i += 2) in load_utmpx_struct()
287 entryx->ut_syslen = temp; in load_utmpx_struct()
289 (void) strlcpy(entryx->ut_host, host, sizeof (entryx->ut_host)); in load_utmpx_struct()
308 check_utmpx(struct utmpx *entryx) in check_utmpx() argument
319 user = malloc(sizeof (entryx->ut_user) +1); in check_utmpx()
320 (void) strncpy(user, entryx->ut_user, sizeof (entryx->ut_user)); in check_utmpx()
321 user[sizeof (entryx->ut_user)] = '\0'; in check_utmpx()
325 (void) strlcat(strcpy(buf, "/dev/"), entryx->ut_line, sizeof (buf)); in check_utmpx()
341 entryx->ut_user, uid, getuid()); in check_utmpx()
345 } else if (entryx->ut_type != DEAD_PROCESS) { in check_utmpx()
346 dprintf("Bad user name: %s \n", entryx->ut_user); in check_utmpx()
353 if (!(entryx->ut_type == USER_PROCESS || in check_utmpx()
354 entryx->ut_type == DEAD_PROCESS)) { in check_utmpx()
355 dprintf("Bad type type = %d\n", entryx->ut_type); in check_utmpx()
365 if (entryx->ut_type == USER_PROCESS && entryx->ut_pid != getppid()) { in check_utmpx()
366 dprintf("Bad pid = %d\n", entryx->ut_pid); in check_utmpx()
376 hostlen = strlen(entryx->ut_host) + 1; in check_utmpx()
377 if (entryx->ut_syslen != hostlen) { in check_utmpx()
379 entryx->ut_host, entryx->ut_syslen, hostlen); in check_utmpx()
380 entryx->ut_syslen = hostlen; in check_utmpx()
383 if (bad_hostname(entryx->ut_host, entryx->ut_syslen) == 1) { in check_utmpx()
384 dprintf("Bad hostname name = %s\n", entryx->ut_host); in check_utmpx()
387 check_id(entryx->ut_id, entryx->ut_line); in check_utmpx()