diff mbox

[linux-cifs-client,2/2] mount.cifs: stuff pass= option with $KRB5CCNAME when sec=krb5 is specified

Message ID 1240316911-15822-3-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton April 21, 2009, 12:28 p.m. UTC
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 source3/client/mount.cifs.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 0c551cc..d2bcd10 100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -369,6 +369,7 @@  static int parse_options(char ** optionsp, int * filesys_flags)
 	char * value = NULL;
 	char * next_keyword = NULL;
 	char * out = NULL;
+	char * ccname;
 	int out_len = 0;
 	int word_len;
 	int rc = 0;
@@ -484,9 +485,13 @@  static int parse_options(char ** optionsp, int * filesys_flags)
 			}
 		} else if (strncmp(data, "sec", 3) == 0) {
 			if (value) {
-				if (!strncmp(value, "none", 4) ||
-				    !strncmp(value, "krb5", 4))
+				if (!strncmp(value, "none", 4)) {
 					got_password = 1;
+				} else if (!strncmp(value, "krb5", 4)) {
+					got_password = 1;
+					if (ccname = getenv("KRB5CCNAME"))
+						mountpassword = strdup(ccname);
+				}
 			}
 		} else if (strncmp(data, "ip", 2) == 0) {
 			if (!value || !*value) {