Skip to contentSkip to conversation

nfsidmap: Keys need to be invalidated instead of revoked

PATCH New Steve Dickson 1 participant 1 message Mar 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsidmap: Keys need to be invalidated instead of revoked

With some recent kernel changes to the key ring for a key to be removed they need to be invalidated instead of revoked.

---
 utils/nfsidmap/nfsidmap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
utils/nfsidmap/nfsidmap.c +6 -6
index 2518ed6..3f51b4d 100644
@@ -166,7 +166,7 @@ static int keyring_clear(char *keyring)
 /*
  * Revoke a key 
  */
-static int key_revoke(char *keystr, int keymask)
+static int key_invalidate(char *keystr, int keymask)
 {
 	FILE *fp;
 	char buf[BUFSIZ], *ptr;
@@ -200,7 +200,7 @@ static int key_revoke(char *keystr, int keymask)
 
 		if (verbose) {
 			*(strchr(buf, '\n')) = '\0';
-			xlog_warn("revoking '%s'", buf);
+			xlog_warn("invalidating '%s'", buf);
 		}
 		/*
 		 * The key is the first arugment in the string
@@ -208,8 +208,8 @@ static int key_revoke(char *keystr, int keymask)
 		*(strchr(buf, ' ')) = '\0';
 		sscanf(buf, "%x", &key);
 
-		if (keyctl_revoke(key) < 0) {
-			xlog_err("keyctl_revoke(0x%x) failed: %m", key);
+		if (keyctl_invalidate(key) < 0) {
+			xlog_err("keyctl_invalidate(0x%x) failed: %m", key);
 			fclose(fp);
 			return 1;
 		}
@@ -273,7 +273,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (rc = nfs4_init_name_mapping(PATH_IDMAPDCONF))  {
+	if ((rc = nfs4_init_name_mapping(PATH_IDMAPDCONF)))  {
 		xlog_errno(rc, "Unable to create name to user id mappings.");
 		return 1;
 	}
@@ -281,7 +281,7 @@ int main(int argc, char **argv)
 		verbose = conf_get_num("General", "Verbosity", 0);
 
 	if (keystr) {
-		rc = key_revoke(keystr, keymask);
+		rc = key_invalidate(keystr, keymask);
 		return rc;		
 	}
 	if (clearing) {
Signature · 1 line
1.8.5.3