[linux-cifs-client] Re: [PATCH] [CIFS] Remove mem dump of key payload from cifs_get_spnego_key

Jeff Layton jlayton at redhat.com
Sun Dec 16 12:00:16 GMT 2007


On Sat, 15 Dec 2007 16:12:05 -0600
"Steve French" <smfrench at gmail.com> wrote:

> What if we dumped only the first part of the blob when
> CONFIG_CIFS_DEBUG2?
> 

We could certainly do that. Patch below that dumps the first 1k when
CONFIG_CIFS_DEBUG2 is enabled.

Signed-off-by: Jeff Layton <jlayton at redhat.com>

diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index 1529d2b..d543acc 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -122,11 +122,13 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
 	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);


More information about the linux-cifs-client mailing list