summaryrefslogtreecommitdiff
path: root/source/tdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-07-31 20:41:51 +0000
committerJeremy Allison <jra@samba.org>2000-07-31 20:41:51 +0000
commit902ada63799cf27924c72e24e7593a8c9fb5eba9 (patch)
tree87e85c0029cd8dae2f517284132f11187bfc57a7 /source/tdb
parent38b07395566a2c114ccda173fb0fe88cf7683588 (diff)
downloadsamba-902ada63799cf27924c72e24e7593a8c9fb5eba9.tar.gz
Added John Reilly's enumports/addprinter/delprinter scripting code plus the
fix for the Win9x printer drivers. Changed command names to add "command" string on the end for some consistancy with the other scripting commands. Added '%P' option to tdbpack/unpack to store long comment string. Made port name be "Samba Printer Port" if no enum port script given. Fixed prs_uint32_pre code to cope with null args. Jeremy.
Diffstat (limited to 'source/tdb')
-rw-r--r--source/tdb/tdbutil.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/tdb/tdbutil.c b/source/tdb/tdbutil.c
index 3e973337b9c..e426aa51cd9 100644
--- a/source/tdb/tdbutil.c
+++ b/source/tdb/tdbutil.c
@@ -136,6 +136,14 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...)
SIVAL(buf, 0, d);
}
break;
+ case 'P':
+ s = va_arg(ap,char *);
+ w = strlen(s);
+ len = w + 1;
+ if (bufsize >= len) {
+ memcpy(buf, s, len);
+ }
+ break;
case 'f':
s = va_arg(ap,char *);
w = strlen(s);
@@ -211,6 +219,12 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...)
if (bufsize < len) goto no_space;
*p = (void *)IVAL(buf, 0);
break;
+ case 'P':
+ s = va_arg(ap,char *);
+ len = strlen(buf) + 1;
+ if (bufsize < len || len > sizeof(pstring)) goto no_space;
+ memcpy(s, buf, len);
+ break;
case 'f':
s = va_arg(ap,char *);
len = strlen(buf) + 1;