nspawn: Fix calculation of capabilities for configuration file (#7087)
authormyrkr <torsten.hilbrich@gmx.net>
Tue, 24 Oct 2017 07:56:40 +0000 (09:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 24 Oct 2017 07:56:40 +0000 (09:56 +0200)
The current code shifting an integer 1 failed for capabilities like
CAP_MAC_ADMIN (numerical value 33). This caused issues when specifying
them in the nspawn configuration file. Using an uint64_t 1 instead.

The similar code for processing the --capability command line option
was already correctly working.

src/nspawn/nspawn-settings.c

index c02c1ea..285e228 100644 (file)
@@ -202,7 +202,7 @@ int config_parse_capability(
                         continue;
                 }
 
-                u |= 1 << ((uint64_t) cap);
+                u |= UINT64_C(1) << cap;
         }
 
         if (u == 0)