[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Wed Jan 25 03:58:03 MST 2012


The branch, master has been updated
       via  e9d6699 Introduce dump_data_file
      from  8dd63b9 auth/gensec_gssapi: sync gensec_gssapi_state with gse_context

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e9d66999c6003009aac5a4e115963b1ef581c9dc
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jan 25 09:10:04 2012 +0100

    Introduce dump_data_file
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Wed Jan 25 11:57:18 CET 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 lib/util/samba_util.h   |    6 ++++++
 lib/util/util.c         |   11 +++++++++++
 librpc/tools/ndrdump.c  |    7 +------
 source3/client/client.c |    9 ++-------
 4 files changed, 20 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 95bf7fd..9df3ddf 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -702,6 +702,12 @@ void dump_data_cb(const uint8_t *buf, int len,
 		  void *private_data);
 
 /**
+ * Write dump of binary data to a FILE
+ */
+void dump_data_file(const uint8_t *buf, int len, bool omit_zero_bytes,
+		    FILE *f);
+
+/**
  * Write dump of binary data to the log file.
  *
  * The data is only written if the log level is at least level.
diff --git a/lib/util/util.c b/lib/util/util.c
index c7c37bc..c4fbd0b 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -462,6 +462,17 @@ _PUBLIC_ void dump_data_skip_zeros(int level, const uint8_t *buf, int len)
 	dump_data_cb(buf, len, true, debugadd_cb, &level);
 }
 
+static void fprintf_cb(const char *buf, void *private_data)
+{
+	FILE *f = (FILE *)private_data;
+	fprintf(f, "%s", buf);
+}
+
+void dump_data_file(const uint8_t *buf, int len, bool omit_zero_bytes,
+		    FILE *f)
+{
+	dump_data_cb(buf, len, omit_zero_bytes, fprintf_cb, f);
+}
 
 /**
  malloc that aborts with smb_panic on fail or zero size.
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index e33115d..91bf06f 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -125,14 +125,9 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug
 	return p;
 }
 
-static void printf_cb(const char *buf, void *private_data)
-{
-	printf("%s", buf);
-}
-
 static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
 {
-	dump_data_cb(d, l, !force, printf_cb, NULL);
+	dump_data_file(d, l, !force, stdout);
 }
 
 static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
diff --git a/source3/client/client.c b/source3/client/client.c
index 47d4470..4b7df92 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3463,11 +3463,6 @@ static int cmd_getfacl(void)
 	return 0;
 }
 
-static void printf_cb(const char *buf, void *private_data)
-{
-	printf("%s", buf);
-}
-
 /****************************************************************************
  Get the EA list of a file
 ****************************************************************************/
@@ -3511,8 +3506,8 @@ static int cmd_geteas(void)
 
 	for (i=0; i<num_eas; i++) {
 		d_printf("%s (%d) =\n", eas[i].name, (int)eas[i].flags);
-		dump_data_cb(eas[i].value.data, eas[i].value.length, false,
-			     printf_cb, NULL);
+		dump_data_file(eas[i].value.data, eas[i].value.length, false,
+			       stdout);
 		d_printf("\n");
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list