summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-09-30 17:13:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:48 -0500
commit54abd2aa66069e6baf7769c496f46d9dba18db39 (patch)
tree9cf8e88168011797319ba9e9866749201b1eac1e /source3/tdb
parent4a2cc231d22a82ed21771a72508f15d21ed63227 (diff)
downloadsamba-54abd2aa66069e6baf7769c496f46d9dba18db39.tar.gz
samba-54abd2aa66069e6baf7769c496f46d9dba18db39.tar.bz2
samba-54abd2aa66069e6baf7769c496f46d9dba18db39.zip
r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdbdump.c4
-rw-r--r--source3/tdb/tdbtool.c12
-rw-r--r--source3/tdb/tdbutil.c7
3 files changed, 14 insertions, 9 deletions
diff --git a/source3/tdb/tdbdump.c b/source3/tdb/tdbdump.c
index 17ae536bc4..3efb29e44c 100644
--- a/source3/tdb/tdbdump.c
+++ b/source3/tdb/tdbdump.c
@@ -49,10 +49,10 @@ static void print_data(TDB_DATA d)
static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
printf("{\n");
- printf("key(%d) = \"",key.dsize);
+ printf("key(%d) = \"", (int)key.dsize);
print_data(key);
printf("\"\n");
- printf("data(%d) = \"",dbuf.dsize);
+ printf("data(%d) = \"", (int)dbuf.dsize);
print_data(dbuf);
printf("\"\n");
printf("}\n");
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index d9e7b9315a..8aa57af7ab 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/tdb/tdbtool.c
@@ -331,7 +331,7 @@ static void move_rec(char *keyname, size_t keylen, char* tdbname)
static int print_conn_key(TDB_DATA key)
{
- printf( "\nkey %d bytes\n", key.dsize);
+ printf( "\nkey %d bytes\n", (int)key.dsize);
printf( "pid =%5d ", ((connections_key*)key.dptr)->pid);
printf( "cnum =%10d ", ((connections_key*)key.dptr)->cnum);
printf( "name =[%s]\n", ((connections_key*)key.dptr)->name);
@@ -340,7 +340,7 @@ static int print_conn_key(TDB_DATA key)
static int print_conn_data(TDB_DATA dbuf)
{
- printf( "\ndata %d bytes\n", dbuf.dsize);
+ printf( "\ndata %d bytes\n", (int)dbuf.dsize);
printf( "pid =%5d ", ((connections_data*)dbuf.dptr)->pid);
printf( "cnum =%10d ", ((connections_data*)dbuf.dptr)->cnum);
printf( "name =[%s]\n", ((connections_data*)dbuf.dptr)->name);
@@ -373,16 +373,16 @@ static int print_crec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *s
static int print_arec(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
- printf("\nkey %d bytes\n", key.dsize);
+ printf("\nkey %d bytes\n", (int)key.dsize);
print_asc(key.dptr, key.dsize);
- printf("\ndata %d bytes\n", dbuf.dsize);
+ printf("\ndata %d bytes\n", (int)dbuf.dsize);
print_data(dbuf.dptr, dbuf.dsize);
return 0;
}
static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
- printf("key %d bytes: ", key.dsize);
+ printf("key %d bytes: ", (int)key.dsize);
print_asc(key.dptr, key.dsize);
printf("\n");
return 0;
@@ -390,7 +390,7 @@ static int print_key(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *st
static int print_hexkey(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
{
- printf("key %d bytes\n", key.dsize);
+ printf("key %d bytes\n", (int)key.dsize);
print_data(key.dptr, key.dsize);
printf("\n");
return 0;
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 47f1bb2dc2..e27880e5ea 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -566,7 +566,12 @@ int tdb_unpack(char *buf, int bufsize, const char *fmt, ...)
p = va_arg(ap, void **);
if (bufsize < len)
goto no_space;
- *p = (void *)IVAL(buf, 0);
+ /*
+ * This isn't a real pointer - only a token (1 or 0)
+ * to mark the fact a pointer is present.
+ */
+
+ *p = (void *)(IVAL(buf, 0) ? (void *)1 : NULL);
break;
case 'P':
s = va_arg(ap,char *);