|
@@ -113,9 +113,11 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
|
|
MAX_MECH_STR_LEN +
|
|
MAX_MECH_STR_LEN +
|
|
UID_KEY_LEN + (sizeof(uid_t) * 2) +
|
|
UID_KEY_LEN + (sizeof(uid_t) * 2) +
|
|
CREDUID_KEY_LEN + (sizeof(uid_t) * 2) +
|
|
CREDUID_KEY_LEN + (sizeof(uid_t) * 2) +
|
|
- USER_KEY_LEN + strlen(sesInfo->user_name) +
|
|
|
|
PID_KEY_LEN + (sizeof(pid_t) * 2) + 1;
|
|
PID_KEY_LEN + (sizeof(pid_t) * 2) + 1;
|
|
|
|
|
|
|
|
+ if (sesInfo->user_name)
|
|
|
|
+ desc_len += USER_KEY_LEN + strlen(sesInfo->user_name);
|
|
|
|
+
|
|
spnego_key = ERR_PTR(-ENOMEM);
|
|
spnego_key = ERR_PTR(-ENOMEM);
|
|
description = kzalloc(desc_len, GFP_KERNEL);
|
|
description = kzalloc(desc_len, GFP_KERNEL);
|
|
if (description == NULL)
|
|
if (description == NULL)
|
|
@@ -152,8 +154,10 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
|
|
dp = description + strlen(description);
|
|
dp = description + strlen(description);
|
|
sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid);
|
|
sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid);
|
|
|
|
|
|
- dp = description + strlen(description);
|
|
|
|
- sprintf(dp, ";user=%s", sesInfo->user_name);
|
|
|
|
|
|
+ if (sesInfo->user_name) {
|
|
|
|
+ dp = description + strlen(description);
|
|
|
|
+ sprintf(dp, ";user=%s", sesInfo->user_name);
|
|
|
|
+ }
|
|
|
|
|
|
dp = description + strlen(description);
|
|
dp = description + strlen(description);
|
|
sprintf(dp, ";pid=0x%x", current->pid);
|
|
sprintf(dp, ";pid=0x%x", current->pid);
|