summaryrefslogtreecommitdiff
path: root/source3/registry/reg_db.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-29 16:35:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:07 -0500
commit270b90e25f2ec5fcb1283588a9e605b7228e0e41 (patch)
treef84f6736eab9650035426c30acb781a11a7a2046 /source3/registry/reg_db.c
parent2e7f22e833fbb549f698460f9ed4d81af68b86e9 (diff)
downloadsamba-270b90e25f2ec5fcb1283588a9e605b7228e0e41.tar.gz
samba-270b90e25f2ec5fcb1283588a9e605b7228e0e41.tar.bz2
samba-270b90e25f2ec5fcb1283588a9e605b7228e0e41.zip
r7995: * privileges are local except when they're *not*
printmig.exe assumes that the LUID of the SeBackupPrivlege on the target server matches the LUID of the privilege on the local client. Even though an LUID is never guaranteed to be the same across reboots. How *awful*! My cat could write better code! (more on my cat later....) * Set the privelege LUID in the global PRIVS[] array * Rename RegCreateKey() to RegCreateKeyEx() to better match MSDN * Rename the unknown field in RegCreateKeyEx() to disposition (guess according to MSDN) * Add the capability to define REG_TDB_ONLY for using the reg_db.c functions and stress the RegXXX() rpc functions. (This used to be commit 0d6352da4800aabc04dfd7c65a6afe6af7cd2d4b)
Diffstat (limited to 'source3/registry/reg_db.c')
-rw-r--r--source3/registry/reg_db.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/registry/reg_db.c b/source3/registry/reg_db.c
index 884949375b..741bc4127b 100644
--- a/source3/registry/reg_db.c
+++ b/source3/registry/reg_db.c
@@ -399,7 +399,7 @@ static int regdb_unpack_values(REGVAL_CTR *values, char *buf, int buflen)
int len = 0;
uint32 type;
pstring valuename;
- int size;
+ uint32 size;
uint8 *data_p;
uint32 num_values = 0;
int i;
@@ -413,17 +413,21 @@ static int regdb_unpack_values(REGVAL_CTR *values, char *buf, int buflen)
for ( i=0; i<num_values; i++ ) {
/* unpack the next regval */
+ type = REG_NONE;
+ size = 0;
+ data_p = NULL;
len += tdb_unpack(buf+len, buflen-len, "fdB",
valuename,
&type,
&size,
&data_p);
- /* add the new value */
-
- regval_ctr_addvalue( values, valuename, type, (const char *)data_p, size );
+ /* add the new value. Paranoid protective code -- make sure data_p is valid */
- SAFE_FREE(data_p); /* 'B' option to tdbpack does a malloc() */
+ if ( size && data_p ) {
+ regval_ctr_addvalue( values, valuename, type, (const char *)data_p, size );
+ SAFE_FREE(data_p); /* 'B' option to tdb_unpack does a malloc() */
+ }
DEBUG(8,("specific: [%s], len: %d\n", valuename, size));
}