]> err.no Git - linux-2.6/blobdiff - fs/cifs/cifs_spnego.c
iget: stop EXT2 from using iget() and read_inode()
[linux-2.6] / fs / cifs / cifs_spnego.c
index d79eee41e9c5924a10196297409ab14bfcfc1d84..d543accc10dd0be24a870ebaa634bd9c7cb199e7 100644 (file)
@@ -67,18 +67,19 @@ struct key_type cifs_spnego_key_type = {
 };
 
 #define MAX_VER_STR_LEN   9 /* length of longest version string e.g.
-                               strlen(";ver=0xFF) */
+                               strlen(";ver=0xFF") */
 #define MAX_MECH_STR_LEN 13 /* length of longest security mechanism name, eg
                               in future could have strlen(";sec=ntlmsspi") */
 #define MAX_IPV6_ADDR_LEN 42 /* eg FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/60 */
 /* get a key struct with a SPNEGO security blob, suitable for session setup */
 struct key *
-cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname)
+cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
 {
        struct TCP_Server_Info *server = sesInfo->server;
        char *description, *dp;
        size_t desc_len;
        struct key *spnego_key;
+       const char *hostname = server->hostname;
 
        /* BB: come up with better scheme for determining length */
        /* length of fields (with semicolons): ver=0xyz ipv4= ipaddress host=
@@ -121,11 +122,13 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname)
        cFYI(1, ("key description = %s", description));
        spnego_key = request_key(&cifs_spnego_key_type, description, "");
 
+#ifdef CONFIG_CIFS_DEBUG2
        if (cifsFYI && !IS_ERR(spnego_key)) {
                struct cifs_spnego_msg *msg = spnego_key->payload.data;
-               cifs_dump_mem("SPNEGO reply blob:", msg->data,
-                               msg->secblob_len + msg->sesskey_len);
+               cifs_dump_mem("SPNEGO reply blob:", msg->data, min(1024,
+                               msg->secblob_len + msg->sesskey_len));
        }
+#endif /* CONFIG_CIFS_DEBUG2 */
 
 out:
        kfree(description);