summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-03-09 01:21:57 +0000
committerLuke Leighton <lkcl@samba.org>1999-03-09 01:21:57 +0000
commita3c6e96a22bfaaa5a2993e85327555266476013d (patch)
treed18c6f1a16ab14ab17d1e4157198a941e667931b /source3/lib/util.c
parentaecbc5b5d37690f145c42ed834a58565c12db6d3 (diff)
downloadsamba-a3c6e96a22bfaaa5a2993e85327555266476013d.tar.gz
samba-a3c6e96a22bfaaa5a2993e85327555266476013d.tar.xz
samba-a3c6e96a22bfaaa5a2993e85327555266476013d.zip
mods to allow inter-domain trust accounts to be added to SAM database
using smbpasswd command. (This used to be commit 62d499f83256c6e8b3308dc4bd8e9f5df873b14b)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c66
1 files changed, 36 insertions, 30 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 127f69dc7d6..2bab2f0386e 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2975,40 +2975,46 @@ void print_asc(int level, unsigned char *buf,int len)
{
int i;
for (i=0;i<len;i++)
- DEBUG(level,("%c", isprint(buf[i])?buf[i]:'.'));
+ {
+ DEBUGADD(level,("%c", isprint(buf[i])?buf[i]:'.'));
+ }
}
-void dump_data(int level,char *buf1,int len)
+void dump_data(int level,char *buf1, int len)
{
- unsigned char *buf = (unsigned char *)buf1;
- int i=0;
- if (len<=0) return;
+ unsigned char *buf = (unsigned char *)buf1;
+ int i=0;
+ if (len<=0) return;
- DEBUG(level,("[%03X] ",i));
- for (i=0;i<len;) {
- DEBUG(level,("%02X ",(int)buf[i]));
- i++;
- if (i%8 == 0) DEBUG(level,(" "));
- if (i%16 == 0) {
- print_asc(level,&buf[i-16],8); DEBUG(level,(" "));
- print_asc(level,&buf[i-8],8); DEBUG(level,("\n"));
- if (i<len) DEBUG(level,("[%03X] ",i));
- }
- }
- if (i%16) {
- int n;
-
- n = 16 - (i%16);
- DEBUG(level,(" "));
- if (n>8) DEBUG(level,(" "));
- while (n--) DEBUG(level,(" "));
-
- n = MIN(8,i%16);
- print_asc(level,&buf[i-(i%16)],n); DEBUG(level,(" "));
- n = (i%16) - n;
- if (n>0) print_asc(level,&buf[i-n],n);
- DEBUG(level,("\n"));
- }
+ DEBUG(level,("[%03X] ",i));
+ for (i=0;i<len;)
+ {
+ DEBUGADD(level,("%02X ",(int)buf[i]));
+ i++;
+ if (i%8 == 0) DEBUGADD(level,(" "));
+ if (i%16 == 0)
+ {
+ print_asc(level,&buf[i-16],8); DEBUGADD(level,(" "));
+ print_asc(level,&buf[i-8],8); DEBUGADD(level,("\n"));
+ if (i<len) DEBUGADD(level,("[%03X] ",i));
+ }
+ }
+
+ if (i%16 != 0) /* finish off a non-16-char-length row */
+ {
+ int n;
+
+ n = 16 - (i%16);
+ DEBUGADD(level,(" "));
+ if (n>8) DEBUGADD(level,(" "));
+ while (n--) DEBUGADD(level,(" "));
+
+ n = MIN(8,i%16);
+ print_asc(level,&buf[i-(i%16)],n); DEBUGADD(level,(" "));
+ n = (i%16) - n;
+ if (n>0) print_asc(level,&buf[i-n],n);
+ DEBUGADD(level,("\n"));
+ }
}
char *tab_depth(int depth)