Commit c4c1bff6 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

cifs: add pid of initiating process to spnego upcall info

cifs: add pid of initiating process to spnego upcall info

This will allow the upcall to poke in /proc/<pid>/environ and get
the value of the $KRB5CCNAME env var for the process.
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 5ddf1e0f
...@@ -86,6 +86,9 @@ struct key_type cifs_spnego_key_type = { ...@@ -86,6 +86,9 @@ struct key_type cifs_spnego_key_type = {
/* strlen of ";user=" */ /* strlen of ";user=" */
#define USER_KEY_LEN 6 #define USER_KEY_LEN 6
/* strlen of ";pid=0x" */
#define PID_KEY_LEN 7
/* get a key struct with a SPNEGO security blob, suitable for session setup */ /* get a key struct with a SPNEGO security blob, suitable for session setup */
struct key * struct key *
cifs_get_spnego_key(struct cifsSesInfo *sesInfo) cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
...@@ -103,7 +106,8 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) ...@@ -103,7 +106,8 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
IP_KEY_LEN + INET6_ADDRSTRLEN + IP_KEY_LEN + INET6_ADDRSTRLEN +
MAX_MECH_STR_LEN + MAX_MECH_STR_LEN +
UID_KEY_LEN + (sizeof(uid_t) * 2) + UID_KEY_LEN + (sizeof(uid_t) * 2) +
USER_KEY_LEN + strlen(sesInfo->userName) + 1; USER_KEY_LEN + strlen(sesInfo->userName) +
PID_KEY_LEN + (sizeof(pid_t) * 2) + 1;
spnego_key = ERR_PTR(-ENOMEM); spnego_key = ERR_PTR(-ENOMEM);
description = kzalloc(desc_len, GFP_KERNEL); description = kzalloc(desc_len, GFP_KERNEL);
...@@ -141,6 +145,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) ...@@ -141,6 +145,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
dp = description + strlen(description); dp = description + strlen(description);
sprintf(dp, ";user=%s", sesInfo->userName); sprintf(dp, ";user=%s", sesInfo->userName);
dp = description + strlen(description);
sprintf(dp, ";pid=0x%x", current->pid);
cFYI(1, ("key description = %s", description)); cFYI(1, ("key description = %s", description));
spnego_key = request_key(&cifs_spnego_key_type, description, ""); spnego_key = request_key(&cifs_spnego_key_type, description, "");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment