[Pkg-shadow-commits] r3471 - in upstream/trunk: . src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Mon Aug 15 14:22:33 UTC 2011
Author: nekral-guest
Date: 2011-08-15 14:22:33 +0000 (Mon, 15 Aug 2011)
New Revision: 3471
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/groupmod.c
Log:
* src/groupmod.c: Ignore return value from snprintf.
* src/groupmod.c: Add static qualifier to the cleanup structures.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2011-08-15 09:56:43 UTC (rev 3470)
+++ upstream/trunk/ChangeLog 2011-08-15 14:22:33 UTC (rev 3471)
@@ -1,5 +1,10 @@
2011-08-15 Nicolas François <nicolas.francois at centraliens.net>
+ * src/groupmod.c: Ignore return value from snprintf.
+ * src/groupmod.c: Add static qualifier to the cleanup structures.
+
+2011-08-15 Nicolas François <nicolas.francois at centraliens.net>
+
* src/usermod.c: Do not assign static to NULL.
* src/usermod.c (date_to_str): buf needs to be unique (e.g.
independent from negativ), and is an out buffer.
Modified: upstream/trunk/src/groupmod.c
===================================================================
--- upstream/trunk/src/groupmod.c 2011-08-15 09:56:43 UTC (rev 3470)
+++ upstream/trunk/src/groupmod.c 2011-08-15 14:22:33 UTC (rev 3471)
@@ -80,10 +80,10 @@
static gid_t group_id;
static gid_t group_newid;
-struct cleanup_info_mod info_passwd;
-struct cleanup_info_mod info_group;
+static struct cleanup_info_mod info_passwd;
+static struct cleanup_info_mod info_group;
#ifdef SHADOWGRP
-struct cleanup_info_mod info_gshadow;
+static struct cleanup_info_mod info_gshadow;
#endif
static bool
@@ -522,14 +522,14 @@
#endif
info_passwd.audit_msg = xmalloc (512);
- snprintf (info_group.audit_msg, 511,
- "changing %s; ", gr_dbname ());
+ (void) snprintf (info_group.audit_msg, 511,
+ "changing %s; ", gr_dbname ());
#ifdef SHADOWGRP
- snprintf (info_gshadow.audit_msg, 511,
- "changing %s; ", sgr_dbname ());
+ (void) snprintf (info_gshadow.audit_msg, 511,
+ "changing %s; ", sgr_dbname ());
#endif
- snprintf (info_passwd.audit_msg, 511,
- "changing %s; ", pw_dbname ());
+ (void) snprintf (info_passwd.audit_msg, 511,
+ "changing %s; ", pw_dbname ());
info_group.action = info_group.audit_msg
+ strlen (info_group.audit_msg);
@@ -540,14 +540,18 @@
info_passwd.action = info_passwd.audit_msg
+ strlen (info_passwd.audit_msg);
- snprintf (info_group.action, 511 - strlen (info_group.audit_msg),
- "group %s/%lu", group_name, (unsigned long int) group_id);
+ (void) snprintf (info_group.action,
+ 511 - strlen (info_group.audit_msg),
+ "group %s/%lu",
+ group_name, (unsigned long int) group_id);
#ifdef SHADOWGRP
- snprintf (info_gshadow.action, 511 - strlen (info_group.audit_msg),
- "group %s", group_name);
+ (void) snprintf (info_gshadow.action,
+ 511 - strlen (info_group.audit_msg),
+ "group %s", group_name);
#endif
- snprintf (info_passwd.action, 511 - strlen (info_group.audit_msg),
- "group %s/%lu", group_name, (unsigned long int) group_id);
+ (void) snprintf (info_passwd.action,
+ 511 - strlen (info_group.audit_msg),
+ "group %s/%lu", group_name, (unsigned long int) group_id);
if (nflg) {
strncat (info_group.action, ", new name: ",
@@ -579,15 +583,15 @@
if (gflg) {
strncat (info_group.action, ", new gid: ",
511 - strlen (info_group.audit_msg));
- snprintf (info_group.action+strlen (info_group.action),
- 511 - strlen (info_group.audit_msg),
- "%lu", (unsigned long int) group_newid);
+ (void) snprintf (info_group.action+strlen (info_group.action),
+ 511 - strlen (info_group.audit_msg),
+ "%lu", (unsigned long int) group_newid);
strncat (info_passwd.action, ", new gid: ",
511 - strlen (info_passwd.audit_msg));
- snprintf (info_passwd.action+strlen (info_passwd.action),
- 511 - strlen (info_passwd.audit_msg),
- "%lu", (unsigned long int) group_newid);
+ (void) snprintf (info_passwd.action+strlen (info_passwd.action),
+ 511 - strlen (info_passwd.audit_msg),
+ "%lu", (unsigned long int) group_newid);
}
info_group.audit_msg[511] = '\0';
#ifdef SHADOWGRP
More information about the Pkg-shadow-commits
mailing list