]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Address minor compiler warnings
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 5 Aug 2022 15:57:29 +0000 (17:57 +0200)
committerSerge Hallyn <serge@hallyn.com>
Wed, 17 Aug 2022 17:34:01 +0000 (12:34 -0500)
    copydir.c:666:44: warning: unsigned conversion from 'int' to '__mode_t' {aka 'unsigned int'} changes value from '-4096' to '4294963200' [-Wsign-conversion]
      666 |         if (   (mknod (dst, statp->st_mode & ~07777, statp->st_rdev) != 0)
          |                                            ^

    copydir.c:116:1: warning: missing initializer for field 'quote' of 'struct error_context' [-Wmissing-field-initializers]
      116 | };
          | ^
    In file included from copydir.c:27:
    /usr/include/attr/error_context.h:30:23: note: 'quote' declared here
       30 |         const char *(*quote) (struct error_context *, const char *);
          |                       ^~~~~

libmisc/copydir.c

index 95042187b7cda9b66d2f203cf2fa706d190a5e95..e753d7cf01ad365b5c3c5a641d4170a18b136952 100644 (file)
@@ -112,7 +112,7 @@ static void error_acl (unused struct error_context *ctx, const char *fmt, ...)
 }
 
 static struct error_context ctx = {
-       error_acl
+       error_acl, NULL, NULL
 };
 #endif                         /* WITH_ACL || WITH_ATTR */
 
@@ -663,7 +663,7 @@ static int copy_special (const char *src, const char *dst,
        }
 #endif                         /* WITH_SELINUX */
 
-       if (   (mknod (dst, statp->st_mode & ~07777, statp->st_rdev) != 0)
+       if (   (mknod (dst, statp->st_mode & ~07777U, statp->st_rdev) != 0)
            || (chown_if_needed (dst, statp,
                                 old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL