> On Jul 31, 2015, at 3:33 PM, David Howells <dhowells@xxxxxxxxxx> wrote: > > Chuck Lever <chuck.lever@xxxxxxxxxx> wrote: > >> + if ((fp = fopen(PROCKEYS, "r")) == NULL) { >> + xlog_err("fopen(%s) failed: %m", PROCKEYS); >> + return 1; >> + } >> + >> + rc = 1; >> + while(fgets(buf, BUFSIZ, fp) != NULL) { >> + unsigned int id; >> + >> + if (strstr(buf, "keyring") == NULL) >> + continue; >> + if (strstr(buf, keyring) == NULL) >> + continue; >> + if (sscanf(buf, "%x %*s", &id) != 1) >> + continue; >> + >> + list_keys(keyring, (key_serial_t)id); >> + rc = 0; >> + break; >> + } >> + > > Did you want find_key_by_type_and_desc() in libkeyutils? Yes, but find_key_by_type_and_desc() does not appear in older versions of /usr/include/keyutils.h. Well, I think this logic can be factored out (it is also used in keyring_clear) and used if find_key_by_type_and_desc() does not exist. -- Chuck Lever chucklever@xxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html