|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
From b4c63693634d3a56a1afe22dd59c63a7e8fe99f8 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
From: myrkr <torsten.hilbrich@gmx.net>
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Date: Tue, 24 Oct 2017 09:56:40 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
Subject: [PATCH] nspawn: Fix calculation of capabilities for configuration
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
file (#7087)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
The current code shifting an integer 1 failed for capabilities like
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
CAP_MAC_ADMIN (numerical value 33). This caused issues when specifying
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
them in the nspawn configuration file. Using an uint64_t 1 instead.
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
The similar code for processing the --capability command line option
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
was already correctly working.
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
(cherry picked from commit 1898e5f9a37d1a50f8c0bd1147abe11c3d38a16b)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
src/nspawn/nspawn-settings.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
index c02c1ea697..285e22820f 100644
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
--- a/src/nspawn/nspawn-settings.c
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+++ b/src/nspawn/nspawn-settings.c
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
@@ -202,7 +202,7 @@ int config_parse_capability(
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
continue;
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
- u |= 1 << ((uint64_t) cap);
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
+ u |= UINT64_C(1) << cap;
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
|
|
Zbigniew Jędrzejewski-Szmek |
35bb94 |
if (u == 0)
|