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

Jeff Layton jlayton at redhat.com
Tue Apr 21 12:28:31 GMT 2009


Signed-off-by: Jeff Layton <jlayton at redhat.com>
---
 source3/client/mount.cifs.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

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) {
-- 
1.6.2.2



More information about the linux-cifs-client mailing list