]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Declare variable for string literal const
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 3 Jan 2022 11:19:00 +0000 (12:19 +0100)
committerChristian Göttsche <cgzones@googlemail.com>
Mon, 3 Jan 2022 14:09:17 +0000 (15:09 +0100)
newgidmap.c:87:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   87 |         policy = "deny\n";
      |                ^

src/newgidmap.c

index 05996eaa9b97b13165ccbbfc814120b5ae7d251d..5b42431b5d2fb2814df37d4bd276c4240164cbb3 100644 (file)
@@ -76,7 +76,8 @@ static void usage(void)
 static void write_setgroups(int proc_dir_fd, bool allow_setgroups)
 {
        int setgroups_fd;
-       char *policy, policy_buffer[4096];
+       const char *policy;
+       char policy_buffer[4096];
 
        /*
         * Default is "deny", and any "allow" will out-rank a "deny". We don't