OSDN Git Service

Add keyctl_revoke
authorPaul Crowley <paulcrowley@google.com>
Mon, 6 Jul 2015 15:54:28 +0000 (16:54 +0100)
committerPaul Crowley <paulcrowley@google.com>
Thu, 9 Jul 2015 17:09:17 +0000 (18:09 +0100)
Change-Id: If63f439d831aa384acd45fde98312923f9c2e561

ext4_utils/key_control.cpp
ext4_utils/key_control.h

index 3d775b7..39bd140 100644 (file)
@@ -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);
index 8e6e32b..bbf0ace 100644 (file)
@@ -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,