X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fgss%2Fsk_utils.c;h=fb377581a7e2702f3db022178098cc24f3af363c;hp=2e356a12757353ff9a566b93b2f900f5ecbc4e0c;hb=f265033840996dcdffb2f05a64b51b51391a273c;hpb=075bea805efe8a7ef1a3aabd8dd2c166bb52115b diff --git a/lustre/utils/gss/sk_utils.c b/lustre/utils/gss/sk_utils.c index 2e356a1..fb37758 100755 --- a/lustre/utils/gss/sk_utils.c +++ b/lustre/utils/gss/sk_utils.c @@ -174,11 +174,18 @@ static key_serial_t sk_load_key(const struct sk_keyfile_config *skc, key = add_key("user", description, &payload, sizeof(payload), KEY_SPEC_USER_KEYRING); - if (key != -1) + if (key != -1) { + key_perm_t perm = KEY_POS_ALL | KEY_USR_ALL | + KEY_GRP_ALL | KEY_OTH_ALL; + + if (keyctl_setperm(key, perm) < 0) + printerr(2, "Failed to set perm 0x%x on key %d\n", + perm, key); printerr(2, "Added key %d with description %s\n", key, description); - else + } else { printerr(0, "Failed to add key with %s\n", description); + } return key; }