1/*- 2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; 43#endif 44static const char rcsid[] = |
45 "$FreeBSD: head/release/picobsd/tinyware/login/pico-login.c 146187 2005-05-13 16:31:11Z ume $"; |
46#endif /* not lint */ 47 48/* 49 * login [ name ] 50 * login -h hostname (for telnetd, etc.) 51 * login -f name (for pre-authenticated login: datakit, xterm, etc.) 52 */ 53 --- 27 unchanged lines hidden (view full) --- 81#ifdef USE_PAM 82#include <security/pam_appl.h> 83#include <security/openpam.h> 84#include <sys/wait.h> 85#endif /* USE_PAM */ 86 87#include "pathnames.h" 88 |
89void badlogin(char *); 90void checknologin(void); 91void dolastlog(int); 92void getloginname(void); 93void motd(const char *); 94int rootterm(char *); 95void sigint(int); 96void sleepexit(int); --- 127 unchanged lines hidden (view full) --- 224 &res); 225 if (ga_err == 0) { 226 char hostbuf[MAXHOSTNAMELEN]; 227 228 getnameinfo(res->ai_addr, 229 res->ai_addrlen, 230 hostbuf, 231 sizeof(hostbuf), NULL, 0, |
232 NI_NUMERICHOST); |
233 optarg = strdup(hostbuf); 234 if (optarg == NULL) { 235 syslog(LOG_NOTICE, 236 "strdup(): %m"); 237 sleepexit(1); 238 } 239 } else 240 optarg = "invalid hostname"; --- 228 unchanged lines hidden (view full) --- 469 hints.ai_family = AF_UNSPEC; 470 ga_err = getaddrinfo(full_hostname, NULL, &hints, 471 &res); 472 if (ga_err == 0) { 473 char hostbuf[MAXHOSTNAMELEN]; 474 475 getnameinfo(res->ai_addr, res->ai_addrlen, 476 hostbuf, sizeof(hostbuf), NULL, 0, |
477 NI_NUMERICHOST); |
478 if ((optarg = strdup(hostbuf)) == NULL) { 479 syslog(LOG_NOTICE, "strdup(): %m"); 480 sleepexit(1); 481 } 482 } else 483 optarg = NULL; 484 if (res != NULL) 485 freeaddrinfo(res); --- 602 unchanged lines hidden --- |