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.
This commit is contained in:
@@ -53,7 +53,7 @@ int lrename (const char *old, const char *new)
|
||||
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()");
|
||||
|
@@ -63,6 +63,9 @@ static struct commonio_db group_db = {
|
||||
GROUP_FILE, /* filename */
|
||||
&group_ops, /* ops */
|
||||
NULL, /* fp */
|
||||
#ifdef WITH_SELINUX
|
||||
NULL, /* scontext */
|
||||
#endif
|
||||
NULL, /* head */
|
||||
NULL, /* tail */
|
||||
NULL, /* cursor */
|
||||
|
@@ -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;
|
||||
|
@@ -64,6 +64,9 @@ static struct commonio_db passwd_db = {
|
||||
PASSWD_FILE, /* filename */
|
||||
&passwd_ops, /* ops */
|
||||
NULL, /* fp */
|
||||
#ifdef WITH_SELINUX
|
||||
NULL, /* scontext */
|
||||
#endif
|
||||
NULL, /* head */
|
||||
NULL, /* tail */
|
||||
NULL, /* cursor */
|
||||
|
@@ -107,6 +107,9 @@ static struct commonio_db gshadow_db = {
|
||||
SGROUP_FILE, /* filename */
|
||||
&gshadow_ops, /* ops */
|
||||
NULL, /* fp */
|
||||
#ifdef WITH_SELINUX
|
||||
NULL, /* scontext */
|
||||
#endif
|
||||
NULL, /* head */
|
||||
NULL, /* tail */
|
||||
NULL, /* cursor */
|
||||
|
@@ -61,6 +61,9 @@ static struct commonio_db shadow_db = {
|
||||
SHADOW_FILE, /* filename */
|
||||
&shadow_ops, /* ops */
|
||||
NULL, /* fp */
|
||||
#ifdef WITH_SELINUX
|
||||
NULL, /* scontext */
|
||||
#endif
|
||||
NULL, /* head */
|
||||
NULL, /* tail */
|
||||
NULL, /* cursor */
|
||||
|
Reference in New Issue
Block a user