void usage()
{
- cout << " usage: [--create-keyring] [--gen-key] [--name=<name>] [--caps=<filename>] [--list] [--print-key] <filename>" << std::endl;
+ cout << " usage: [--create-keyring] [--gen-key --set-uid=x] [--name=<name>] [--caps=<filename>] [--list] [--print-key] <filename>" << std::endl;
exit(1);
}
const char *name = "";
const char *caps_fn = NULL;
const char *import_keyring = NULL;
+ __u64 auth_uid = 0;
FOR_EACH_ARG(args) {
if (CONF_ARG_EQ("gen-key", 'g')) {
CONF_SAFE_SET_ARG_VAL(&create_keyring, OPT_BOOL);
} else if (CONF_ARG_EQ("import-keyring", '\0')) {
CONF_SAFE_SET_ARG_VAL(&import_keyring, OPT_STR);
+ } else if (CONF_ARG_EQ("set-uid", 'u')) {
+ CONF_SAFE_SET_ARG_VAL(&auth_uid, OPT_LONGLONG);
} else if (!fn) {
fn = args[i];
} else
if (gen_key) {
EntityAuth eauth;
eauth.key.create(CEPH_CRYPTO_AES);
+ if (auth_uid)
+ eauth.auth_uid = (__u64)auth_uid;
keyring.add(ename, eauth);
modified = true;
}