* Removed unused gid parameter of syslog_sg().

* The loginname and tty buffers are never changed. Add the const qualifier.
This commit is contained in:
nekral-guest 2008-01-06 12:31:06 +00:00
parent d85b926a14
commit 5c6f68cd8f
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2008-01-06 Nicolas François <nicolas.francois@centraliens.net>
* src/newgrp.c: Removed unused gid parameter of syslog_sg().
* src/newgrp.c: The loginname and tty buffers are never changed.
Add the const qualifier.
2008-01-06 Nicolas François <nicolas.francois@centraliens.net> 2008-01-06 Nicolas François <nicolas.francois@centraliens.net>
* src/chpasswd.c, src/chgpasswd.c: The crypt_method string always * src/chpasswd.c, src/chgpasswd.c: The crypt_method string always

View File

@ -58,7 +58,7 @@ static void usage (void);
static void check_perms (const struct group *grp, static void check_perms (const struct group *grp,
struct passwd *pwd, struct passwd *pwd,
const char *groupname); const char *groupname);
static void syslog_sg (gid_t gid, const char *name, const char *group); static void syslog_sg (const char *name, const char *group);
/* /*
* usage - print command usage message * usage - print command usage message
@ -194,10 +194,10 @@ failure:
* The loggout will also be logged when the user will quit the * The loggout will also be logged when the user will quit the
* sg/newgrp session. * sg/newgrp session.
*/ */
static void syslog_sg (gid_t gid, const char *name, const char *group) static void syslog_sg (const char *name, const char *group)
{ {
char *loginname = getlogin (); const char *loginname = getlogin ();
char *tty = ttyname (0); const char *tty = ttyname (0);
if (loginname != NULL) if (loginname != NULL)
loginname = xstrdup (loginname); loginname = xstrdup (loginname);
@ -547,7 +547,7 @@ int main (int argc, char **argv)
*/ */
#ifdef USE_SYSLOG #ifdef USE_SYSLOG
if (getdef_bool ("SYSLOG_SG_ENAB")) { if (getdef_bool ("SYSLOG_SG_ENAB")) {
syslog_sg (gid, name, group); syslog_sg (name, group);
} }
#endif /* USE_SYSLOG */ #endif /* USE_SYSLOG */