* libmisc/hushed.c, lib/prototypes.h, src/login.c: Change the

hushed() prototype to take a username instead of a passwd
	structure in argument. The passwd entry is retrieved withing
	hushed().
This commit is contained in:
nekral-guest
2009-04-20 11:48:59 +00:00
parent 87ac185752
commit 1bcf2ffb59
4 changed files with 18 additions and 5 deletions

View File

@ -3,7 +3,7 @@
* Copyright (c) 1991 - 1993, Chip Rosenthal
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2003 - 2005, Tomasz Kłoczko
* Copyright (c) 2008 , Nicolas François
* Copyright (c) 2008 - 2009, Nicolas François
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -47,8 +47,9 @@
* Look in the hushed-logins file (or user's home directory) to see
* if the user is to receive the login-time messages.
*/
bool hushed (const struct passwd *pw)
bool hushed (const char *username)
{
const struct passwd *pw;
char *hushfile;
char buf[BUFSIZ];
bool found;
@ -64,6 +65,11 @@ bool hushed (const struct passwd *pw)
return false;
}
pw = getspnam (username);
if (NULL == pw) {
return false;
}
/*
* If this is not a fully rooted path then see if the
* file exists in the user's home directory.