diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-07-09 20:02:48 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-07-09 21:14:58 +0000 |
commit | c4c1bff64dfff4e6dd0936a0340f56b9284512c8 (patch) | |
tree | dca98a2682b172e9c74c0929021e142d2fe281ad /fs/cifs | |
parent | 5ddf1e0ff00fd808c048d0b920784828276cc516 (diff) | |
download | linux-3.10-c4c1bff64dfff4e6dd0936a0340f56b9284512c8.tar.gz linux-3.10-c4c1bff64dfff4e6dd0936a0340f56b9284512c8.tar.bz2 linux-3.10-c4c1bff64dfff4e6dd0936a0340f56b9284512c8.zip |
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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifs_spnego.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c index 4a4581cb2b5..051caecf7d6 100644 --- a/fs/cifs/cifs_spnego.c +++ b/fs/cifs/cifs_spnego.c @@ -86,6 +86,9 @@ struct key_type cifs_spnego_key_type = { /* strlen of ";user=" */ #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 */ struct key * cifs_get_spnego_key(struct cifsSesInfo *sesInfo) @@ -103,7 +106,8 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) IP_KEY_LEN + INET6_ADDRSTRLEN + MAX_MECH_STR_LEN + 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); description = kzalloc(desc_len, GFP_KERNEL); @@ -141,6 +145,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) dp = description + strlen(description); sprintf(dp, ";user=%s", sesInfo->userName); + dp = description + strlen(description); + sprintf(dp, ";pid=0x%x", current->pid); + cFYI(1, ("key description = %s", description)); spnego_key = request_key(&cifs_spnego_key_type, description, ""); |