@@ -331,6 +331,50 @@ cifs_destroy_inode(struct inode *inode)
}
/*
+ * Map auth info
+ */
+static const char *map_auth_info(enum securityEnum type, char mode)
+{
+ unsigned int flag = 0;
+ static const struct {
+ unsigned int sec;
+ const char *flavor;
+ } sec_flags[] = {
+ { CIFSSEC_MAY_KRB5 | CIFSSEC_MUST_SIGN, "krb5i"},
+ { CIFSSEC_MAY_KRB5, "krb5"},
+ { CIFSSEC_MAY_NTLMV2 | CIFSSEC_MUST_SIGN, "ntlmv2i"},
+ { CIFSSEC_MAY_NTLMV2, "ntlmv2"},
+ { CIFSSEC_MAY_NTLM | CIFSSEC_MUST_SIGN, "ntlmi"},
+ { CIFSSEC_MAY_NTLM, "ntlm"},
+ { CIFSSEC_MAY_LANMAN, "lanman"}
+ };
+ int i;
+
+ cFYI(1, ("secType=%d secMode=0x%x\n", type, mode));
+ if (type == NTLMv2)
+ flag |= CIFSSEC_MAY_NTLMV2;
+ else if (type == NTLM)
+ flag |= CIFSSEC_MAY_NTLM;
+ else if (type == Kerberos || type == MSKerberos)
+ flag |= CIFSSEC_MAY_KRB5;
+ else if (type == LANMAN)
+ flag |= CIFSSEC_MAY_LANMAN;
+
+ if (mode & SECMODE_SIGN_REQUIRED)
+ flag |= CIFSSEC_MUST_SIGN;
+ else if (mode & SECMODE_SIGN_ENABLED)
+ flag |= CIFSSEC_MAY_SIGN;
+
+
+ for (i = 0; i < ARRAY_SIZE(sec_flags); i++) {
+ if (sec_flags[i].sec == flag)
+ break;
+ }
+
+ return sec_flags[i].flavor;
+}
+
+/*
* cifs_show_options() is for displaying mount options in /proc/mounts.
* Not all settable options are displayed but most of the important
* ones are.
@@ -369,6 +413,9 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
&server->addr.sockAddr.sin_addr.s_addr);
break;
}
+ seq_printf(s, ",sec=%s",
+ map_auth_info(server->secType,
+ server->secMode));
}
}
if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) ||