summaryrefslogtreecommitdiff
path: root/ext4_utils
diff options
context:
space:
mode:
Diffstat (limited to 'ext4_utils')
-rw-r--r--ext4_utils/key_control.cpp7
-rw-r--r--ext4_utils/key_control.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/ext4_utils/key_control.cpp b/ext4_utils/key_control.cpp
index 3d775b7f..39bd1401 100644
--- a/ext4_utils/key_control.cpp
+++ b/ext4_utils/key_control.cpp
@@ -5,8 +5,8 @@
#include <sys/syscall.h>
/* keyring keyctl commands */
+#define KEYCTL_REVOKE 3 /* revoke a key */
#define KEYCTL_SETPERM 5 /* set permissions for a key in a keyring */
-#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
#define KEYCTL_SEARCH 10 /* search for a key in a keyring */
static long keyctl(int cmd, ...)
@@ -32,6 +32,11 @@ key_serial_t add_key(const char *type,
return syscall(__NR_add_key, type, description, payload, plen, ringid);
}
+long keyctl_revoke(key_serial_t id)
+{
+ return keyctl(KEYCTL_REVOKE, id);
+}
+
long keyctl_setperm(key_serial_t id, int permissions)
{
return keyctl(KEYCTL_SETPERM, id, permissions);
diff --git a/ext4_utils/key_control.h b/ext4_utils/key_control.h
index 8e6e32ba..bbf0acec 100644
--- a/ext4_utils/key_control.h
+++ b/ext4_utils/key_control.h
@@ -21,6 +21,8 @@ key_serial_t add_key(const char *type,
size_t plen,
key_serial_t ringid);
+long keyctl_revoke(key_serial_t id);
+
long keyctl_setperm(key_serial_t id, int permissions);
long keyctl_search(key_serial_t ringid, const char *type,