]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/capability-util.h
util: introduce memcmp_safe()
[thirdparty/systemd.git] / src / basic / capability-util.h
index f90efe2550daa21aece3abbff9004bac32c5bf25..4a4a86093a4b94756fb4ec94dc900bbecf0f4d04 100644 (file)
@@ -1,12 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
-
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/capability.h>
@@ -41,7 +35,7 @@ static inline void cap_free_charpp(char **p) {
 static inline bool cap_test_all(uint64_t caps) {
         uint64_t m;
         m = (UINT64_C(1) << (cap_last_cap() + 1)) - 1;
-        return (caps & m) == m;
+        return FLAGS_SET(caps, m);
 }
 
 bool ambient_capabilities_supported(void);