* src/su.c: Add brackets and parenthesis.
* src/su.c: Avoid implicit conversion of pointers to booleans.
This commit is contained in:
parent
05e4cf9aae
commit
614e95af39
@ -1,3 +1,8 @@
|
||||
2008-08-29 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/su.c: Add brackets and parenthesis.
|
||||
* src/su.c: Avoid implicit conversion of pointers to booleans.
|
||||
|
||||
2008-08-29 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/list.c: Remove historical comment.
|
||||
|
7
src/su.c
7
src/su.c
@ -132,8 +132,10 @@ static int iswheel (const char *username)
|
||||
struct group *grp;
|
||||
|
||||
grp = getgrnam ("wheel"); /* !USE_PAM, no need for xgetgrnam */
|
||||
if (!grp || !grp->gr_mem)
|
||||
if ( (NULL ==grp)
|
||||
|| (NULL == grp->gr_mem)) {
|
||||
return 0;
|
||||
}
|
||||
return is_on_list (grp->gr_mem, username);
|
||||
}
|
||||
#endif /* !USE_PAM */
|
||||
@ -158,11 +160,12 @@ static void su_failure (const char *tty)
|
||||
{
|
||||
sulog (tty, 0, oldname, name); /* log failed attempt */
|
||||
#ifdef USE_SYSLOG
|
||||
if (getdef_bool ("SYSLOG_SU_ENAB"))
|
||||
if (getdef_bool ("SYSLOG_SU_ENAB")) {
|
||||
SYSLOG (((0 != pwent.pw_uid) ? LOG_INFO : LOG_NOTICE,
|
||||
"- %s %s:%s", tty,
|
||||
('\0' != oldname[0]) ? oldname : "???",
|
||||
('\0' != name[0]) ? name : "???"));
|
||||
}
|
||||
closelog ();
|
||||
#endif
|
||||
exit (1);
|
||||
|
Loading…
Reference in New Issue
Block a user