mirror of
https://github.com/sheumann/hush.git
synced 2025-01-13 21:31:51 +00:00
sync with mainstream, but check more
This commit is contained in:
parent
081d6d4380
commit
7673ccad60
@ -37,7 +37,7 @@ void print_login_issue(const char *issue_file, const char *tty)
|
|||||||
{
|
{
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
int c;
|
int c;
|
||||||
char buf[256];
|
char buf[256+1];
|
||||||
const char *outbuf;
|
const char *outbuf;
|
||||||
time_t t;
|
time_t t;
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
@ -82,8 +82,8 @@ void print_login_issue(const char *issue_file, const char *tty)
|
|||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
case 'o':
|
case 'o':
|
||||||
getdomainname(buf, sizeof(buf));
|
c = getdomainname(buf, sizeof(buf) - 1);
|
||||||
buf[sizeof(buf) - 1] = '\0';
|
buf[c >= 0 ? c : 0] = '\0';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -120,7 +120,7 @@ void print_login_prompt(void)
|
|||||||
{
|
{
|
||||||
char buf[MAXHOSTNAMELEN+1];
|
char buf[MAXHOSTNAMELEN+1];
|
||||||
|
|
||||||
gethostname(buf, MAXHOSTNAMELEN);
|
if(gethostname(buf, MAXHOSTNAMELEN) == 0)
|
||||||
fputs(buf, stdout);
|
fputs(buf, stdout);
|
||||||
|
|
||||||
fputs(LOGIN, stdout);
|
fputs(LOGIN, stdout);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user