summaryrefslogtreecommitdiff
path: root/fs/smb/client/cifs_spnego.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/smb/client/cifs_spnego.c')
-rw-r--r--fs/smb/client/cifs_spnego.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/smb/client/cifs_spnego.c b/fs/smb/client/cifs_spnego.c
index bc1c1e9b288a..6a8d085ec991 100644
--- a/fs/smb/client/cifs_spnego.c
+++ b/fs/smb/client/cifs_spnego.c
@@ -160,7 +160,23 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo,
if (sesInfo->user_name) {
dp = description + strlen(description);
- sprintf(dp, ";user=%s", sesInfo->user_name);
+ if (server->sec_iakerb) {
+ /*
+ * TODO: add option to set ccache name or specify realm desired
+ */
+ if (!sesInfo->password) {
+ cifs_dbg(VFS, "IAKerb requested, but no password provided\n");
+ spnego_key = ERR_PTR(-EINVAL);
+ goto out;
+ }
+ sprintf(dp, ";user=%s;pw=%s", sesInfo->user_name, sesInfo->password);
+ } else {
+ sprintf(dp, ";user=%s", sesInfo->user_name);
+ }
+ } else if (server->sec_iakerb) {
+ cifs_dbg(VFS, "IAKerb requested, but no username provided\n");
+ spnego_key = ERR_PTR(-EINVAL);
+ goto out;
}
dp = description + strlen(description);