Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155151
b: refs/heads/master
c: c4c1bff
h: refs/heads/master
i:
  155149: f1598b1
  155147: 2ec418f
  155143: 0a6101f
  155135: 6dd8406
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Jul 9, 2009
1 parent 17ea7ae commit 0464d43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ddf1e0ff00fd808c048d0b920784828276cc516
refs/heads/master: c4c1bff64dfff4e6dd0936a0340f56b9284512c8
9 changes: 8 additions & 1 deletion trunk/fs/cifs/cifs_spnego.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down Expand Up @@ -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, "");

Expand Down

0 comments on commit 0464d43

Please sign in to comment.