[Pkg-shadow-commits] r1407 - in upstream/trunk: . lib libmisc src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Mon Nov 19 20:25:37 UTC 2007
Author: nekral-guest
Date: 2007-11-19 20:25:36 +0000 (Mon, 19 Nov 2007)
New Revision: 1407
Modified:
upstream/trunk/ChangeLog
upstream/trunk/lib/commonio.c
upstream/trunk/lib/groupio.c
upstream/trunk/lib/nscd.c
upstream/trunk/lib/pwio.c
upstream/trunk/lib/sgroupio.c
upstream/trunk/lib/shadowio.c
upstream/trunk/libmisc/getdate.y
upstream/trunk/libmisc/tz.c
upstream/trunk/src/groupmems.c
upstream/trunk/src/login.c
upstream/trunk/src/newusers.c
upstream/trunk/src/nologin.c
Log:
Fix some compilation warnings:
* src/login.c: "dereferencing type-punned pointer will break
strict-aliasing rules", add a variable indirection: ptr_pam_user.
* lib/commonio.c: do not initialize the sb stat structure.
* lib/pwio.c, lib/shadowio.c, lib/sgroupio.c, lib/groupio.c:
initialize the security context if WITH_SELINUX.
* lib/nscd.c: The service argument is not const (used in the exec*
parameters). This matches with the prototype definition.
* src/groupmems.c: Avoid ++i when i is also used in the same line.
* src/newusers.c: i is positive every time it is compared. Add
cast to unsigned int.
* src/nologin.c: Use a main() prototype with no arguments.
* libmisc/getdate.y: Initialize the type and value fields of the
terminating entry for each TABLE.
* libmisc/tz.c: Use "TZ=CST6CDT" as the default timezone.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/ChangeLog 2007-11-19 20:25:36 UTC (rev 1407)
@@ -1,5 +1,23 @@
2007-11-19 Nicolas François <nicolas.francois at centraliens.net>
+ Fix some compilation warnings:
+ * src/login.c: "dereferencing type-punned pointer will break
+ strict-aliasing rules", add a variable indirection: ptr_pam_user.
+ * lib/commonio.c: do not initialize the sb stat structure.
+ * lib/pwio.c, lib/shadowio.c, lib/sgroupio.c, lib/groupio.c:
+ initialize the security context if WITH_SELINUX.
+ * lib/nscd.c: The service argument is not const (used in the exec*
+ parameters). This matches with the prototype definition.
+ * src/groupmems.c: Avoid ++i when i is also used in the same line.
+ * src/newusers.c: i is positive every time it is compared. Add
+ cast to unsigned int.
+ * src/nologin.c: Use a main() prototype with no arguments.
+ * libmisc/getdate.y: Initialize the type and value fields of the
+ terminating entry for each TABLE.
+ * libmisc/tz.c: Use "TZ=CST6CDT" as the default timezone.
+
+2007-11-19 Nicolas François <nicolas.francois at centraliens.net>
+
* man/pl/Makefile.am: Add getspnam.3 to EXTRA_DIST since it is
generated with shadow.3.
* man/generate_translations.mak: Clean all the manpages, based on
Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/commonio.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -53,7 +53,7 @@
int res;
#if defined(S_ISLNK)
- struct stat sb = { 0 };
+ struct stat sb;
if (lstat (new, &sb) == 0 && S_ISLNK (sb.st_mode)) {
if (realpath (new, resolved_path) == NULL) {
perror ("realpath in lrename()");
Modified: upstream/trunk/lib/groupio.c
===================================================================
--- upstream/trunk/lib/groupio.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/groupio.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -63,6 +63,9 @@
GROUP_FILE, /* filename */
&group_ops, /* ops */
NULL, /* fp */
+#ifdef WITH_SELINUX
+ NULL, /* scontext */
+#endif
NULL, /* head */
NULL, /* tail */
NULL, /* cursor */
Modified: upstream/trunk/lib/nscd.c
===================================================================
--- upstream/trunk/lib/nscd.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/nscd.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -16,7 +16,7 @@
/*
* nscd_flush_cache - flush specified service buffer in nscd cache
*/
-int nscd_flush_cache (const char *service)
+int nscd_flush_cache (char *service)
{
pid_t pid, termpid;
int err, status;
Modified: upstream/trunk/lib/pwio.c
===================================================================
--- upstream/trunk/lib/pwio.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/pwio.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -64,6 +64,9 @@
PASSWD_FILE, /* filename */
&passwd_ops, /* ops */
NULL, /* fp */
+#ifdef WITH_SELINUX
+ NULL, /* scontext */
+#endif
NULL, /* head */
NULL, /* tail */
NULL, /* cursor */
Modified: upstream/trunk/lib/sgroupio.c
===================================================================
--- upstream/trunk/lib/sgroupio.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/sgroupio.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -107,6 +107,9 @@
SGROUP_FILE, /* filename */
&gshadow_ops, /* ops */
NULL, /* fp */
+#ifdef WITH_SELINUX
+ NULL, /* scontext */
+#endif
NULL, /* head */
NULL, /* tail */
NULL, /* cursor */
Modified: upstream/trunk/lib/shadowio.c
===================================================================
--- upstream/trunk/lib/shadowio.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/lib/shadowio.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -61,6 +61,9 @@
SHADOW_FILE, /* filename */
&shadow_ops, /* ops */
NULL, /* fp */
+#ifdef WITH_SELINUX
+ NULL, /* scontext */
+#endif
NULL, /* head */
NULL, /* tail */
NULL, /* cursor */
Modified: upstream/trunk/libmisc/getdate.y
===================================================================
--- upstream/trunk/libmisc/getdate.y 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/libmisc/getdate.y 2007-11-19 20:25:36 UTC (rev 1407)
@@ -464,7 +464,7 @@
{ "thurs", tDAY, 4 },
{ "friday", tDAY, 5 },
{ "saturday", tDAY, 6 },
- { NULL }
+ { NULL, 0, 0 }
};
/* Time units table. */
@@ -479,7 +479,7 @@
{ "min", tMINUTE_UNIT, 1 },
{ "second", tSEC_UNIT, 1 },
{ "sec", tSEC_UNIT, 1 },
- { NULL }
+ { NULL, 0, 0 }
};
/* Assorted relative-time words. */
@@ -504,7 +504,7 @@
{ "eleventh", tUNUMBER, 11 },
{ "twelfth", tUNUMBER, 12 },
{ "ago", tAGO, 1 },
- { NULL }
+ { NULL, 0, 0 }
};
/* The timezone table. */
@@ -559,7 +559,7 @@
{ "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */
{ "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */
{ "idle", tZONE, -HOUR (12) }, /* International Date Line East */
- { NULL }
+ { NULL, 0, 0 }
};
/* Military timezone table. */
@@ -589,7 +589,7 @@
{ "x", tZONE, HOUR (-11) },
{ "y", tZONE, HOUR (-12) },
{ "z", tZONE, HOUR ( 0) },
- { NULL }
+ { NULL, 0, 0 }
};
Modified: upstream/trunk/libmisc/tz.c
===================================================================
--- upstream/trunk/libmisc/tz.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/libmisc/tz.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -45,7 +45,7 @@
{
FILE *fp = 0;
static char tzbuf[BUFSIZ];
- const char *def_tz;
+ const char *def_tz = "TZ=CST6CDT";
if ((fp = fopen (fname, "r")) == NULL ||
fgets (tzbuf, sizeof (tzbuf), fp) == NULL) {
Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/src/groupmems.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -126,7 +126,8 @@
}
while (found && NULL != members[i]) {
- members[i] = members[++i];
+ members[i] = members[i+1];
+ i++;
}
if (!found) {
Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/src/login.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -348,6 +348,7 @@
int retcode;
pid_t child;
char *pam_user;
+ char **ptr_pam_user = &pam_user;
#else
struct spwd *spwd = NULL;
#endif
@@ -620,7 +621,7 @@
/* if we didn't get a user on the command line,
set it to NULL */
pam_get_item (pamh, PAM_USER,
- (const void **) &pam_user);
+ (const void **)ptr_pam_user);
if (pam_user[0] == '\0')
pam_set_item (pamh, PAM_USER, NULL);
@@ -644,7 +645,7 @@
retcode = pam_authenticate (pamh, 0);
pam_get_item (pamh, PAM_USER,
- (const void **) &pam_user);
+ (const void **) ptr_pam_user);
if (pam_user && pam_user[0]) {
pwd = xgetpwnam(pam_user);
@@ -737,7 +738,7 @@
First get the username that we are actually using, though.
*/
retcode =
- pam_get_item (pamh, PAM_USER, (const void **) &pam_user);
+ pam_get_item (pamh, PAM_USER, (const void **)ptr_pam_user);
setpwent ();
pwd = xgetpwnam (pam_user);
if (!pwd) {
Modified: upstream/trunk/src/newusers.c
===================================================================
--- upstream/trunk/src/newusers.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/src/newusers.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -116,11 +116,11 @@
if (gid[0] == '\0') {
i = 100;
for (pw_rewind (); (pwd = pw_next ());) {
- if (pwd->pw_uid >= i)
+ if (pwd->pw_uid >= (unsigned int)i)
i = pwd->pw_uid + 1;
}
for (gr_rewind (); (grp = gr_next ());) {
- if (grp->gr_gid == i) {
+ if (grp->gr_gid == (unsigned int)i) {
i = -1;
break;
}
@@ -133,7 +133,7 @@
*/
i = atoi (gid);
for (gr_rewind (); (grp = gr_next ());)
- if (grp->gr_gid == i)
+ if (grp->gr_gid == (unsigned int)i)
goto add_member;
} else
/*
@@ -149,7 +149,7 @@
*/
if (i == -1) {
for (i = 100, gr_rewind (); (grp = gr_next ());)
- if (grp->gr_gid >= i)
+ if (grp->gr_gid >= (unsigned int)i)
i = grp->gr_gid + 1;
}
Modified: upstream/trunk/src/nologin.c
===================================================================
--- upstream/trunk/src/nologin.c 2007-11-19 01:19:45 UTC (rev 1406)
+++ upstream/trunk/src/nologin.c 2007-11-19 20:25:36 UTC (rev 1407)
@@ -30,7 +30,7 @@
#include <unistd.h>
#include "exitcodes.h"
-int main (int argc, char **argv)
+int main ()
{
const char *user, *tty;
More information about the Pkg-shadow-commits
mailing list