Merge branch 'selftest' of git://git.samba.org/jelmer/samba
authorJelmer Vernooij <jelmer@samba.org>
Sun, 19 Oct 2008 08:20:37 +0000 (10:20 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 19 Oct 2008 08:20:37 +0000 (10:20 +0200)
913 files changed:
.gitignore
docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
lib/crypto/hmacmd5test.c
lib/crypto/md4test.c
lib/crypto/md5test.c
lib/replace/replace.h
lib/util/Doxyfile [moved from source4/lib/util/Doxyfile with 100% similarity]
lib/util/README [new file with mode: 0644]
lib/util/asn1.c [moved from source4/lib/util/asn1.c with 99% similarity]
lib/util/asn1.h [moved from source4/lib/util/asn1.h with 97% similarity]
lib/util/attr.h [moved from source4/lib/util/attr.h with 100% similarity]
lib/util/become_daemon.c [moved from source4/lib/util/become_daemon.c with 100% similarity]
lib/util/byteorder.h [moved from source4/lib/util/byteorder.h with 100% similarity]
lib/util/capability.c [moved from source4/lib/util/capability.c with 100% similarity]
lib/util/capability.m4 [moved from source4/lib/util/capability.m4 with 100% similarity]
lib/util/config.mk [moved from source4/lib/util/config.mk with 93% similarity]
lib/util/data_blob.c [moved from source4/lib/util/data_blob.c with 93% similarity]
lib/util/data_blob.h [moved from source4/lib/util/data_blob.h with 92% similarity]
lib/util/debug.c [moved from source4/lib/util/debug.c with 92% similarity]
lib/util/debug.h [moved from source4/lib/util/debug.h with 93% similarity]
lib/util/dlinklist.h [moved from source3/include/dlinklist.h with 100% similarity]
lib/util/dprintf.c [moved from source4/lib/util/dprintf.c with 100% similarity]
lib/util/fault.c [moved from source4/lib/util/fault.c with 100% similarity]
lib/util/fault.m4 [moved from source4/lib/util/fault.m4 with 100% similarity]
lib/util/fsusage.c [moved from source4/lib/util/fsusage.c with 92% similarity]
lib/util/fsusage.m4 [moved from source4/lib/util/fsusage.m4 with 92% similarity]
lib/util/genrand.c [moved from source4/lib/util/genrand.c with 100% similarity]
lib/util/idtree.c [moved from source4/lib/util/idtree.c with 100% similarity]
lib/util/mainpage.dox [moved from source4/lib/util/mainpage.dox with 100% similarity]
lib/util/memory.h [new file with mode: 0644]
lib/util/ms_fnmatch.c [moved from source4/lib/util/ms_fnmatch.c with 100% similarity]
lib/util/mutex.c [moved from source4/lib/util/mutex.c with 100% similarity]
lib/util/mutex.h [moved from source4/lib/util/mutex.h with 100% similarity]
lib/util/params.c [moved from source4/lib/util/params.c with 99% similarity]
lib/util/rbtree.c [moved from source3/lib/rbtree.c with 100% similarity]
lib/util/rbtree.h [moved from source3/include/rbtree.h with 100% similarity]
lib/util/safe_string.h [moved from source4/lib/util/safe_string.h with 100% similarity]
lib/util/signal.c [moved from source4/lib/util/signal.c with 100% similarity]
lib/util/signal.m4 [moved from source4/lib/util/signal.m4 with 100% similarity]
lib/util/substitute.c [new file with mode: 0644]
lib/util/system.c [moved from source4/lib/util/system.c with 100% similarity]
lib/util/tests/data_blob.c [new file with mode: 0644]
lib/util/tests/file.c [moved from source4/lib/util/tests/file.c with 92% similarity]
lib/util/tests/genrand.c [moved from source4/lib/util/tests/genrand.c with 100% similarity]
lib/util/tests/idtree.c [moved from source4/lib/util/tests/idtree.c with 100% similarity]
lib/util/tests/str.c [moved from source4/lib/util/tests/str.c with 100% similarity]
lib/util/tests/strlist.c [moved from source4/lib/util/tests/strlist.c with 94% similarity]
lib/util/tests/time.c [new file with mode: 0644]
lib/util/time.c [moved from source4/lib/util/time.c with 86% similarity]
lib/util/time.h [moved from source4/lib/util/time.h with 97% similarity]
lib/util/time.m4 [moved from source4/lib/util/time.m4 with 100% similarity]
lib/util/unix_privs.c [moved from source4/lib/util/unix_privs.c with 100% similarity]
lib/util/util.c [moved from source4/lib/util/util.c with 81% similarity]
lib/util/util.h [moved from source4/lib/util/util.h with 88% similarity]
lib/util/util.m4 [moved from source4/lib/util/util.m4 with 100% similarity]
lib/util/util_file.c [moved from source4/lib/util/util_file.c with 85% similarity]
lib/util/util_getent.c [moved from source4/lib/util/util_getent.c with 100% similarity]
lib/util/util_ldb.c [moved from source4/lib/util/util_ldb.c with 98% similarity]
lib/util/util_ldb.h [moved from source4/lib/util/util_ldb.h with 100% similarity]
lib/util/util_net.c [new file with mode: 0644]
lib/util/util_pw.c [moved from source4/lib/util/util_pw.c with 100% similarity]
lib/util/util_str.c [moved from source4/lib/util/util_str.c with 80% similarity]
lib/util/util_strlist.c [moved from source4/lib/util/util_strlist.c with 92% similarity]
lib/util/util_tdb.c [moved from source4/lib/util/util_tdb.c with 61% similarity]
lib/util/util_tdb.h [new file with mode: 0644]
lib/util/wrap_xattr.c [moved from source4/lib/util/wrap_xattr.c with 99% similarity]
lib/util/wrap_xattr.h [moved from source4/lib/util/wrap_xattr.h with 100% similarity]
lib/util/xattr.m4 [moved from source4/lib/util/xattr.m4 with 100% similarity]
lib/util/xfile.c [moved from source4/lib/util/xfile.c with 94% similarity]
lib/util/xfile.h [moved from source4/lib/util/xfile.h with 98% similarity]
lib/zlib/ChangeLog [moved from source4/lib/zlib/ChangeLog with 100% similarity]
lib/zlib/FAQ [moved from source4/lib/zlib/FAQ with 100% similarity]
lib/zlib/INDEX [moved from source4/lib/zlib/INDEX with 100% similarity]
lib/zlib/Makefile [moved from source4/lib/zlib/Makefile with 100% similarity]
lib/zlib/Makefile.in [moved from source4/lib/zlib/Makefile.in with 100% similarity]
lib/zlib/README [moved from source4/lib/zlib/README with 100% similarity]
lib/zlib/adler32.c [moved from source4/lib/zlib/adler32.c with 100% similarity]
lib/zlib/algorithm.txt [moved from source4/lib/zlib/algorithm.txt with 100% similarity]
lib/zlib/amiga/Makefile.pup [moved from source4/lib/zlib/amiga/Makefile.pup with 100% similarity]
lib/zlib/amiga/Makefile.sas [moved from source4/lib/zlib/amiga/Makefile.sas with 100% similarity]
lib/zlib/as400/bndsrc [moved from source4/lib/zlib/as400/bndsrc with 100% similarity]
lib/zlib/as400/compile.clp [moved from source4/lib/zlib/as400/compile.clp with 100% similarity]
lib/zlib/as400/readme.txt [moved from source4/lib/zlib/as400/readme.txt with 100% similarity]
lib/zlib/as400/zlib.inc [moved from source4/lib/zlib/as400/zlib.inc with 100% similarity]
lib/zlib/compress.c [moved from source4/lib/zlib/compress.c with 100% similarity]
lib/zlib/contrib/README.contrib [moved from source4/lib/zlib/contrib/README.contrib with 100% similarity]
lib/zlib/contrib/ada/buffer_demo.adb [moved from source4/lib/zlib/contrib/ada/buffer_demo.adb with 100% similarity]
lib/zlib/contrib/ada/mtest.adb [moved from source4/lib/zlib/contrib/ada/mtest.adb with 100% similarity]
lib/zlib/contrib/ada/read.adb [moved from source4/lib/zlib/contrib/ada/read.adb with 100% similarity]
lib/zlib/contrib/ada/readme.txt [moved from source4/lib/zlib/contrib/ada/readme.txt with 100% similarity]
lib/zlib/contrib/ada/test.adb [moved from source4/lib/zlib/contrib/ada/test.adb with 100% similarity]
lib/zlib/contrib/ada/zlib-streams.adb [moved from source4/lib/zlib/contrib/ada/zlib-streams.adb with 100% similarity]
lib/zlib/contrib/ada/zlib-streams.ads [moved from source4/lib/zlib/contrib/ada/zlib-streams.ads with 100% similarity]
lib/zlib/contrib/ada/zlib-thin.adb [moved from source4/lib/zlib/contrib/ada/zlib-thin.adb with 100% similarity]
lib/zlib/contrib/ada/zlib-thin.ads [moved from source4/lib/zlib/contrib/ada/zlib-thin.ads with 100% similarity]
lib/zlib/contrib/ada/zlib.adb [moved from source4/lib/zlib/contrib/ada/zlib.adb with 100% similarity]
lib/zlib/contrib/ada/zlib.ads [moved from source4/lib/zlib/contrib/ada/zlib.ads with 100% similarity]
lib/zlib/contrib/ada/zlib.gpr [moved from source4/lib/zlib/contrib/ada/zlib.gpr with 100% similarity]
lib/zlib/contrib/asm586/README.586 [moved from source4/lib/zlib/contrib/asm586/README.586 with 100% similarity]
lib/zlib/contrib/asm586/match.S [moved from source4/lib/zlib/contrib/asm586/match.S with 100% similarity]
lib/zlib/contrib/asm686/README.686 [moved from source4/lib/zlib/contrib/asm686/README.686 with 100% similarity]
lib/zlib/contrib/asm686/match.S [moved from source4/lib/zlib/contrib/asm686/match.S with 100% similarity]
lib/zlib/contrib/blast/Makefile [moved from source4/lib/zlib/contrib/blast/Makefile with 100% similarity]
lib/zlib/contrib/blast/README [moved from source4/lib/zlib/contrib/blast/README with 100% similarity]
lib/zlib/contrib/blast/blast.c [moved from source4/lib/zlib/contrib/blast/blast.c with 100% similarity]
lib/zlib/contrib/blast/blast.h [moved from source4/lib/zlib/contrib/blast/blast.h with 100% similarity]
lib/zlib/contrib/blast/test.pk [moved from source4/lib/zlib/contrib/blast/test.pk with 100% similarity]
lib/zlib/contrib/blast/test.txt [moved from source4/lib/zlib/contrib/blast/test.txt with 100% similarity]
lib/zlib/contrib/delphi/ZLib.pas [moved from source4/lib/zlib/contrib/delphi/ZLib.pas with 100% similarity]
lib/zlib/contrib/delphi/ZLibConst.pas [moved from source4/lib/zlib/contrib/delphi/ZLibConst.pas with 100% similarity]
lib/zlib/contrib/delphi/readme.txt [moved from source4/lib/zlib/contrib/delphi/readme.txt with 100% similarity]
lib/zlib/contrib/delphi/zlibd32.mak [moved from source4/lib/zlib/contrib/delphi/zlibd32.mak with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib.build [moved from source4/lib/zlib/contrib/dotzlib/DotZLib.build with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib.chm [moved from source4/lib/zlib/contrib/dotzlib/DotZLib.chm with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib.sln [moved from source4/lib/zlib/contrib/dotzlib/DotZLib.sln with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/CodecBase.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/CodecBase.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/Deflater.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/Deflater.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/DotZLib.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/DotZLib.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/GZipStream.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/GZipStream.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/Inflater.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/Inflater.cs with 100% similarity]
lib/zlib/contrib/dotzlib/DotZLib/UnitTests.cs [moved from source4/lib/zlib/contrib/dotzlib/DotZLib/UnitTests.cs with 100% similarity]
lib/zlib/contrib/dotzlib/LICENSE_1_0.txt [moved from source4/lib/zlib/contrib/dotzlib/LICENSE_1_0.txt with 100% similarity]
lib/zlib/contrib/dotzlib/readme.txt [moved from source4/lib/zlib/contrib/dotzlib/readme.txt with 100% similarity]
lib/zlib/contrib/infback9/README [moved from source4/lib/zlib/contrib/infback9/README with 100% similarity]
lib/zlib/contrib/infback9/infback9.c [moved from source4/lib/zlib/contrib/infback9/infback9.c with 100% similarity]
lib/zlib/contrib/infback9/infback9.h [moved from source4/lib/zlib/contrib/infback9/infback9.h with 100% similarity]
lib/zlib/contrib/infback9/inffix9.h [moved from source4/lib/zlib/contrib/infback9/inffix9.h with 100% similarity]
lib/zlib/contrib/infback9/inflate9.h [moved from source4/lib/zlib/contrib/infback9/inflate9.h with 100% similarity]
lib/zlib/contrib/infback9/inftree9.c [moved from source4/lib/zlib/contrib/infback9/inftree9.c with 100% similarity]
lib/zlib/contrib/infback9/inftree9.h [moved from source4/lib/zlib/contrib/infback9/inftree9.h with 100% similarity]
lib/zlib/contrib/inflate86/inffas86.c [moved from source4/lib/zlib/contrib/inflate86/inffas86.c with 100% similarity]
lib/zlib/contrib/inflate86/inffast.S [moved from source4/lib/zlib/contrib/inflate86/inffast.S with 100% similarity]
lib/zlib/contrib/iostream/test.cpp [moved from source4/lib/zlib/contrib/iostream/test.cpp with 100% similarity]
lib/zlib/contrib/iostream/zfstream.cpp [moved from source4/lib/zlib/contrib/iostream/zfstream.cpp with 100% similarity]
lib/zlib/contrib/iostream/zfstream.h [moved from source4/lib/zlib/contrib/iostream/zfstream.h with 100% similarity]
lib/zlib/contrib/iostream2/zstream.h [moved from source4/lib/zlib/contrib/iostream2/zstream.h with 100% similarity]
lib/zlib/contrib/iostream2/zstream_test.cpp [moved from source4/lib/zlib/contrib/iostream2/zstream_test.cpp with 100% similarity]
lib/zlib/contrib/iostream3/README [moved from source4/lib/zlib/contrib/iostream3/README with 100% similarity]
lib/zlib/contrib/iostream3/TODO [moved from source4/lib/zlib/contrib/iostream3/TODO with 100% similarity]
lib/zlib/contrib/iostream3/test.cc [moved from source4/lib/zlib/contrib/iostream3/test.cc with 100% similarity]
lib/zlib/contrib/iostream3/zfstream.cc [moved from source4/lib/zlib/contrib/iostream3/zfstream.cc with 100% similarity]
lib/zlib/contrib/iostream3/zfstream.h [moved from source4/lib/zlib/contrib/iostream3/zfstream.h with 100% similarity]
lib/zlib/contrib/masm686/match.asm [moved from source4/lib/zlib/contrib/masm686/match.asm with 100% similarity]
lib/zlib/contrib/masmx64/bld_ml64.bat [moved from source4/lib/zlib/contrib/masmx64/bld_ml64.bat with 100% similarity]
lib/zlib/contrib/masmx64/gvmat64.asm [moved from source4/lib/zlib/contrib/masmx64/gvmat64.asm with 100% similarity]
lib/zlib/contrib/masmx64/gvmat64.obj [moved from source4/lib/zlib/contrib/masmx64/gvmat64.obj with 100% similarity]
lib/zlib/contrib/masmx64/inffas8664.c [moved from source4/lib/zlib/contrib/masmx64/inffas8664.c with 100% similarity]
lib/zlib/contrib/masmx64/inffasx64.asm [moved from source4/lib/zlib/contrib/masmx64/inffasx64.asm with 100% similarity]
lib/zlib/contrib/masmx64/inffasx64.obj [moved from source4/lib/zlib/contrib/masmx64/inffasx64.obj with 100% similarity]
lib/zlib/contrib/masmx64/readme.txt [moved from source4/lib/zlib/contrib/masmx64/readme.txt with 100% similarity]
lib/zlib/contrib/masmx86/bld_ml32.bat [moved from source4/lib/zlib/contrib/masmx86/bld_ml32.bat with 100% similarity]
lib/zlib/contrib/masmx86/gvmat32.asm [moved from source4/lib/zlib/contrib/masmx86/gvmat32.asm with 100% similarity]
lib/zlib/contrib/masmx86/gvmat32.obj [moved from source4/lib/zlib/contrib/masmx86/gvmat32.obj with 100% similarity]
lib/zlib/contrib/masmx86/gvmat32c.c [moved from source4/lib/zlib/contrib/masmx86/gvmat32c.c with 100% similarity]
lib/zlib/contrib/masmx86/inffas32.asm [moved from source4/lib/zlib/contrib/masmx86/inffas32.asm with 100% similarity]
lib/zlib/contrib/masmx86/inffas32.obj [moved from source4/lib/zlib/contrib/masmx86/inffas32.obj with 100% similarity]
lib/zlib/contrib/masmx86/mkasm.bat [moved from source4/lib/zlib/contrib/masmx86/mkasm.bat with 100% similarity]
lib/zlib/contrib/masmx86/readme.txt [moved from source4/lib/zlib/contrib/masmx86/readme.txt with 100% similarity]
lib/zlib/contrib/minizip/ChangeLogUnzip [moved from source4/lib/zlib/contrib/minizip/ChangeLogUnzip with 100% similarity]
lib/zlib/contrib/minizip/Makefile [moved from source4/lib/zlib/contrib/minizip/Makefile with 100% similarity]
lib/zlib/contrib/minizip/crypt.h [moved from source4/lib/zlib/contrib/minizip/crypt.h with 100% similarity]
lib/zlib/contrib/minizip/ioapi.c [moved from source4/lib/zlib/contrib/minizip/ioapi.c with 100% similarity]
lib/zlib/contrib/minizip/ioapi.h [moved from source4/lib/zlib/contrib/minizip/ioapi.h with 100% similarity]
lib/zlib/contrib/minizip/iowin32.c [moved from source4/lib/zlib/contrib/minizip/iowin32.c with 100% similarity]
lib/zlib/contrib/minizip/iowin32.h [moved from source4/lib/zlib/contrib/minizip/iowin32.h with 100% similarity]
lib/zlib/contrib/minizip/miniunz.c [moved from source4/lib/zlib/contrib/minizip/miniunz.c with 100% similarity]
lib/zlib/contrib/minizip/minizip.c [moved from source4/lib/zlib/contrib/minizip/minizip.c with 100% similarity]
lib/zlib/contrib/minizip/mztools.c [moved from source4/lib/zlib/contrib/minizip/mztools.c with 100% similarity]
lib/zlib/contrib/minizip/mztools.h [moved from source4/lib/zlib/contrib/minizip/mztools.h with 100% similarity]
lib/zlib/contrib/minizip/unzip.c [moved from source4/lib/zlib/contrib/minizip/unzip.c with 100% similarity]
lib/zlib/contrib/minizip/unzip.h [moved from source4/lib/zlib/contrib/minizip/unzip.h with 100% similarity]
lib/zlib/contrib/minizip/zip.c [moved from source4/lib/zlib/contrib/minizip/zip.c with 100% similarity]
lib/zlib/contrib/minizip/zip.h [moved from source4/lib/zlib/contrib/minizip/zip.h with 100% similarity]
lib/zlib/contrib/pascal/example.pas [moved from source4/lib/zlib/contrib/pascal/example.pas with 100% similarity]
lib/zlib/contrib/pascal/readme.txt [moved from source4/lib/zlib/contrib/pascal/readme.txt with 100% similarity]
lib/zlib/contrib/pascal/zlibd32.mak [moved from source4/lib/zlib/contrib/pascal/zlibd32.mak with 100% similarity]
lib/zlib/contrib/pascal/zlibpas.pas [moved from source4/lib/zlib/contrib/pascal/zlibpas.pas with 100% similarity]
lib/zlib/contrib/puff/Makefile [moved from source4/lib/zlib/contrib/puff/Makefile with 100% similarity]
lib/zlib/contrib/puff/README [moved from source4/lib/zlib/contrib/puff/README with 100% similarity]
lib/zlib/contrib/puff/puff.c [moved from source4/lib/zlib/contrib/puff/puff.c with 100% similarity]
lib/zlib/contrib/puff/puff.h [moved from source4/lib/zlib/contrib/puff/puff.h with 100% similarity]
lib/zlib/contrib/puff/zeros.raw [moved from source4/lib/zlib/contrib/puff/zeros.raw with 100% similarity]
lib/zlib/contrib/testzlib/testzlib.c [moved from source4/lib/zlib/contrib/testzlib/testzlib.c with 100% similarity]
lib/zlib/contrib/testzlib/testzlib.txt [moved from source4/lib/zlib/contrib/testzlib/testzlib.txt with 100% similarity]
lib/zlib/contrib/untgz/Makefile [moved from source4/lib/zlib/contrib/untgz/Makefile with 100% similarity]
lib/zlib/contrib/untgz/Makefile.msc [moved from source4/lib/zlib/contrib/untgz/Makefile.msc with 100% similarity]
lib/zlib/contrib/untgz/untgz.c [moved from source4/lib/zlib/contrib/untgz/untgz.c with 100% similarity]
lib/zlib/contrib/vstudio/readme.txt [moved from source4/lib/zlib/contrib/vstudio/readme.txt with 100% similarity]
lib/zlib/contrib/vstudio/vc7/miniunz.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc7/miniunz.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc7/minizip.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc7/minizip.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc7/testzlib.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc7/testzlib.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc7/zlib.rc [moved from source4/lib/zlib/contrib/vstudio/vc7/zlib.rc with 100% similarity]
lib/zlib/contrib/vstudio/vc7/zlibstat.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc7/zlibstat.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc7/zlibvc.def [moved from source4/lib/zlib/contrib/vstudio/vc7/zlibvc.def with 100% similarity]
lib/zlib/contrib/vstudio/vc7/zlibvc.sln [moved from source4/lib/zlib/contrib/vstudio/vc7/zlibvc.sln with 100% similarity]
lib/zlib/contrib/vstudio/vc7/zlibvc.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc7/zlibvc.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/miniunz.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/miniunz.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/minizip.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/minizip.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/testzlib.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/testzlib.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/testzlibdll.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/testzlibdll.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/zlib.rc [moved from source4/lib/zlib/contrib/vstudio/vc8/zlib.rc with 100% similarity]
lib/zlib/contrib/vstudio/vc8/zlibstat.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/zlibstat.vcproj with 100% similarity]
lib/zlib/contrib/vstudio/vc8/zlibvc.def [moved from source4/lib/zlib/contrib/vstudio/vc8/zlibvc.def with 100% similarity]
lib/zlib/contrib/vstudio/vc8/zlibvc.sln [moved from source4/lib/zlib/contrib/vstudio/vc8/zlibvc.sln with 100% similarity]
lib/zlib/contrib/vstudio/vc8/zlibvc.vcproj [moved from source4/lib/zlib/contrib/vstudio/vc8/zlibvc.vcproj with 100% similarity]
lib/zlib/crc32.c [moved from source4/lib/zlib/crc32.c with 100% similarity]
lib/zlib/crc32.h [moved from source4/lib/zlib/crc32.h with 100% similarity]
lib/zlib/deflate.c [moved from source4/lib/zlib/deflate.c with 100% similarity]
lib/zlib/deflate.h [moved from source4/lib/zlib/deflate.h with 100% similarity]
lib/zlib/example.c [moved from source4/lib/zlib/example.c with 100% similarity]
lib/zlib/examples/README.examples [moved from source4/lib/zlib/examples/README.examples with 100% similarity]
lib/zlib/examples/fitblk.c [moved from source4/lib/zlib/examples/fitblk.c with 100% similarity]
lib/zlib/examples/gun.c [moved from source4/lib/zlib/examples/gun.c with 100% similarity]
lib/zlib/examples/gzappend.c [moved from source4/lib/zlib/examples/gzappend.c with 100% similarity]
lib/zlib/examples/gzjoin.c [moved from source4/lib/zlib/examples/gzjoin.c with 100% similarity]
lib/zlib/examples/gzlog.c [moved from source4/lib/zlib/examples/gzlog.c with 100% similarity]
lib/zlib/examples/gzlog.h [moved from source4/lib/zlib/examples/gzlog.h with 100% similarity]
lib/zlib/examples/zlib_how.html [moved from source4/lib/zlib/examples/zlib_how.html with 100% similarity]
lib/zlib/examples/zpipe.c [moved from source4/lib/zlib/examples/zpipe.c with 100% similarity]
lib/zlib/examples/zran.c [moved from source4/lib/zlib/examples/zran.c with 100% similarity]
lib/zlib/gzio.c [moved from source4/lib/zlib/gzio.c with 100% similarity]
lib/zlib/infback.c [moved from source4/lib/zlib/infback.c with 100% similarity]
lib/zlib/inffast.c [moved from source4/lib/zlib/inffast.c with 100% similarity]
lib/zlib/inffast.h [moved from source4/lib/zlib/inffast.h with 100% similarity]
lib/zlib/inffixed.h [moved from source4/lib/zlib/inffixed.h with 100% similarity]
lib/zlib/inflate.c [moved from source4/lib/zlib/inflate.c with 100% similarity]
lib/zlib/inflate.h [moved from source4/lib/zlib/inflate.h with 100% similarity]
lib/zlib/inftrees.c [moved from source4/lib/zlib/inftrees.c with 100% similarity]
lib/zlib/inftrees.h [moved from source4/lib/zlib/inftrees.h with 100% similarity]
lib/zlib/make_vms.com [moved from source4/lib/zlib/make_vms.com with 100% similarity]
lib/zlib/minigzip.c [moved from source4/lib/zlib/minigzip.c with 100% similarity]
lib/zlib/msdos/Makefile.bor [moved from source4/lib/zlib/msdos/Makefile.bor with 100% similarity]
lib/zlib/msdos/Makefile.dj2 [moved from source4/lib/zlib/msdos/Makefile.dj2 with 100% similarity]
lib/zlib/msdos/Makefile.emx [moved from source4/lib/zlib/msdos/Makefile.emx with 100% similarity]
lib/zlib/msdos/Makefile.msc [moved from source4/lib/zlib/msdos/Makefile.msc with 100% similarity]
lib/zlib/msdos/Makefile.tc [moved from source4/lib/zlib/msdos/Makefile.tc with 100% similarity]
lib/zlib/old/Makefile.riscos [moved from source4/lib/zlib/old/Makefile.riscos with 100% similarity]
lib/zlib/old/README [moved from source4/lib/zlib/old/README with 100% similarity]
lib/zlib/old/descrip.mms [moved from source4/lib/zlib/old/descrip.mms with 100% similarity]
lib/zlib/old/os2/Makefile.os2 [moved from source4/lib/zlib/old/os2/Makefile.os2 with 100% similarity]
lib/zlib/old/os2/zlib.def [moved from source4/lib/zlib/old/os2/zlib.def with 100% similarity]
lib/zlib/old/visual-basic.txt [moved from source4/lib/zlib/old/visual-basic.txt with 100% similarity]
lib/zlib/old/zlib.html [moved from source4/lib/zlib/old/zlib.html with 100% similarity]
lib/zlib/projects/README.projects [moved from source4/lib/zlib/projects/README.projects with 100% similarity]
lib/zlib/projects/visualc6/README.txt [moved from source4/lib/zlib/projects/visualc6/README.txt with 100% similarity]
lib/zlib/projects/visualc6/example.dsp [moved from source4/lib/zlib/projects/visualc6/example.dsp with 100% similarity]
lib/zlib/projects/visualc6/minigzip.dsp [moved from source4/lib/zlib/projects/visualc6/minigzip.dsp with 100% similarity]
lib/zlib/projects/visualc6/zlib.dsp [moved from source4/lib/zlib/projects/visualc6/zlib.dsp with 100% similarity]
lib/zlib/projects/visualc6/zlib.dsw [moved from source4/lib/zlib/projects/visualc6/zlib.dsw with 100% similarity]
lib/zlib/qnx/package.qpg [moved from source4/lib/zlib/qnx/package.qpg with 100% similarity]
lib/zlib/trees.c [moved from source4/lib/zlib/trees.c with 100% similarity]
lib/zlib/trees.h [moved from source4/lib/zlib/trees.h with 100% similarity]
lib/zlib/uncompr.c [moved from source4/lib/zlib/uncompr.c with 100% similarity]
lib/zlib/win32/DLL_FAQ.txt [moved from source4/lib/zlib/win32/DLL_FAQ.txt with 100% similarity]
lib/zlib/win32/Makefile.bor [moved from source4/lib/zlib/win32/Makefile.bor with 100% similarity]
lib/zlib/win32/Makefile.emx [moved from source4/lib/zlib/win32/Makefile.emx with 100% similarity]
lib/zlib/win32/Makefile.gcc [moved from source4/lib/zlib/win32/Makefile.gcc with 100% similarity]
lib/zlib/win32/Makefile.msc [moved from source4/lib/zlib/win32/Makefile.msc with 100% similarity]
lib/zlib/win32/VisualC.txt [moved from source4/lib/zlib/win32/VisualC.txt with 100% similarity]
lib/zlib/win32/zlib.def [moved from source4/lib/zlib/win32/zlib.def with 100% similarity]
lib/zlib/win32/zlib1.rc [moved from source4/lib/zlib/win32/zlib1.rc with 100% similarity]
lib/zlib/zconf.h [moved from source4/lib/zlib/zconf.h with 100% similarity]
lib/zlib/zconf.in.h [moved from source4/lib/zlib/zconf.in.h with 100% similarity]
lib/zlib/zlib.h [moved from source4/lib/zlib/zlib.h with 100% similarity]
lib/zlib/zlib.m4 [moved from source4/lib/zlib.m4 with 87% similarity]
lib/zlib/zutil.c [moved from source4/lib/zlib/zutil.c with 100% similarity]
lib/zlib/zutil.h [moved from source4/lib/zlib/zutil.h with 100% similarity]
libcli/nbt/man/nmblookup.1.xml [moved from source4/libcli/nbt/man/nmblookup.1.xml with 100% similarity]
libcli/nbt/namerefresh.c
libcli/nbt/nameregister.c
libcli/nbt/nbtsocket.c
libcli/nbt/tools/nmblookup.c [moved from source4/libcli/nbt/tools/nmblookup.c with 100% similarity]
librpc/idl/atsvc.idl [moved from source4/librpc/idl/atsvc.idl with 100% similarity]
librpc/idl/audiosrv.idl [moved from source4/librpc/idl/audiosrv.idl with 100% similarity]
librpc/idl/browser.idl [moved from source4/librpc/idl/browser.idl with 100% similarity]
librpc/idl/dbgidl.idl [moved from source4/librpc/idl/dbgidl.idl with 100% similarity]
librpc/idl/dcom.idl [moved from source4/librpc/idl/dcom.idl with 100% similarity]
librpc/idl/dfs.idl [moved from source3/librpc/idl/dfs.idl with 100% similarity]
librpc/idl/dnsserver.idl [moved from source4/librpc/idl/dnsserver.idl with 100% similarity]
librpc/idl/drsblobs.idl [moved from source4/librpc/idl/drsblobs.idl with 99% similarity]
librpc/idl/drsuapi.idl [moved from source3/librpc/idl/drsuapi.idl with 98% similarity]
librpc/idl/dsbackup.idl [moved from source4/librpc/idl/dsbackup.idl with 100% similarity]
librpc/idl/dssetup.idl [moved from source3/librpc/idl/dssetup.idl with 100% similarity]
librpc/idl/echo.idl [moved from source3/librpc/idl/echo.idl with 100% similarity]
librpc/idl/efs.idl [moved from source4/librpc/idl/efs.idl with 100% similarity]
librpc/idl/epmapper.idl [moved from source4/librpc/idl/epmapper.idl with 100% similarity]
librpc/idl/eventlog.idl [moved from source3/librpc/idl/eventlog.idl with 100% similarity]
librpc/idl/frsapi.idl [moved from source4/librpc/idl/frsapi.idl with 100% similarity]
librpc/idl/frsrpc.idl [moved from source4/librpc/idl/frsrpc.idl with 100% similarity]
librpc/idl/idl_types.h [moved from source4/librpc/idl/idl_types.h with 100% similarity]
librpc/idl/initshutdown.idl [moved from source4/librpc/idl/initshutdown.idl with 94% similarity]
librpc/idl/keysvc.idl [moved from source4/librpc/idl/keysvc.idl with 100% similarity]
librpc/idl/mgmt.idl [moved from source4/librpc/idl/mgmt.idl with 100% similarity]
librpc/idl/misc.idl [moved from source4/librpc/idl/misc.idl with 88% similarity]
librpc/idl/msgsvc.idl [moved from source4/librpc/idl/msgsvc.idl with 100% similarity]
librpc/idl/nbt.idl [moved from source3/librpc/idl/nbt.idl with 100% similarity]
librpc/idl/notify.idl [moved from source3/librpc/idl/notify.idl with 98% similarity]
librpc/idl/ntsvcs.idl [moved from source3/librpc/idl/ntsvcs.idl with 63% similarity]
librpc/idl/orpc.idl [moved from source4/librpc/idl/orpc.idl with 100% similarity]
librpc/idl/oxidresolver.idl [moved from source4/librpc/idl/oxidresolver.idl with 100% similarity]
librpc/idl/policyagent.idl [moved from source4/librpc/idl/policyagent.idl with 100% similarity]
librpc/idl/protected_storage.idl [moved from source4/librpc/idl/protected_storage.idl with 100% similarity]
librpc/idl/remact.idl [moved from source4/librpc/idl/remact.idl with 100% similarity]
librpc/idl/rot.idl [moved from source4/librpc/idl/rot.idl with 100% similarity]
librpc/idl/security.idl [moved from source3/librpc/idl/security.idl with 95% similarity]
librpc/idl/spoolss.idl [moved from source3/librpc/idl/spoolss.idl with 100% similarity]
librpc/idl/svcctl.idl [moved from source3/librpc/idl/svcctl.idl with 96% similarity]
librpc/idl/trkwks.idl [moved from source4/librpc/idl/trkwks.idl with 100% similarity]
librpc/idl/unixinfo.idl [moved from source4/librpc/idl/unixinfo.idl with 100% similarity]
librpc/idl/w32time.idl [moved from source4/librpc/idl/w32time.idl with 100% similarity]
librpc/idl/wkssvc.idl [moved from source3/librpc/idl/wkssvc.idl with 100% similarity]
librpc/idl/wmi.idl [moved from source4/librpc/idl/wmi.idl with 100% similarity]
librpc/idl/wzcsvc.idl [moved from source4/librpc/idl/wzcsvc.idl with 100% similarity]
librpc/idl/xattr.idl [moved from source4/librpc/idl/xattr.idl with 95% similarity]
librpc/ndr.pc.in [moved from source4/librpc/ndr.pc.in with 100% similarity]
librpc/ndr/libndr.h [moved from source4/librpc/ndr/libndr.h with 96% similarity]
librpc/ndr/ndr.c [moved from source4/librpc/ndr/ndr.c with 98% similarity]
librpc/ndr/ndr_basic.c [moved from source4/librpc/ndr/ndr_basic.c with 100% similarity]
librpc/ndr/ndr_compression.c [moved from source4/librpc/ndr/ndr_compression.c with 99% similarity]
librpc/ndr/ndr_compression.h [moved from source3/librpc/ndr/ndr_compression.h with 78% similarity]
librpc/ndr/ndr_drsblobs.c [moved from source4/librpc/ndr/ndr_drsblobs.c with 100% similarity]
librpc/ndr/ndr_drsuapi.c [moved from source4/librpc/ndr/ndr_drsuapi.c with 97% similarity]
librpc/ndr/ndr_drsuapi.h [moved from source4/librpc/ndr/ndr_drsuapi.h with 97% similarity]
librpc/ndr/ndr_krb5pac.c [moved from source4/librpc/ndr/ndr_krb5pac.c with 100% similarity]
librpc/ndr/ndr_misc.c [moved from source4/librpc/ndr/ndr_misc.c with 100% similarity]
librpc/ndr/uuid.c [moved from source4/librpc/ndr/uuid.c with 100% similarity]
librpc/rpc/binding.c [moved from source4/librpc/rpc/binding.c with 99% similarity]
librpc/tools/ndrdump.1.xml [moved from source4/librpc/tools/ndrdump.1.xml with 100% similarity]
librpc/tools/ndrdump.c [moved from source4/librpc/tools/ndrdump.c with 97% similarity]
pidl/lib/Parse/Pidl/ODL.pm
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source3/Makefile.in
source3/auth/auth.c
source3/auth/auth_sam.c
source3/auth/token_util.c
source3/client/client.c
source3/client/clitar.c
source3/client/smbspool.c
source3/configure.in
source3/groupdb/mapping_ldb.c
source3/include/byteorder.h [deleted file]
source3/include/client.h
source3/include/dcerpc.h [deleted file]
source3/include/debug.h
source3/include/fake_file.h
source3/include/includes.h
source3/include/messages.h
source3/include/module.h
source3/include/nameserv.h
source3/include/ndr.h [deleted file]
source3/include/ntdomain.h
source3/include/ntlmssp.h
source3/include/ntquotas.h
source3/include/packet.h
source3/include/proto.h
source3/include/rpc_lsa.h
source3/include/rpc_svcctl.h
source3/include/smb.h
source3/include/smbprofile.h
source3/include/sysquotas.h
source3/include/util_tdb.h
source3/include/vfs.h
source3/include/xfile.h [deleted file]
source3/intl/lang_tdb.c
source3/lib/access.c
source3/lib/arc4.c [deleted file]
source3/lib/charcnv.c
source3/lib/ctdbd_conn.c
source3/lib/data_blob.c [deleted file]
source3/lib/dbwrap_ctdb.c
source3/lib/dbwrap_file.c
source3/lib/dbwrap_rbt.c
source3/lib/dbwrap_tdb.c
source3/lib/debug.c
source3/lib/display_sec.c
source3/lib/dprintf.c
source3/lib/events.c
source3/lib/fsusage.c [deleted file]
source3/lib/genrand.c
source3/lib/ldb/libldb.m4
source3/lib/memcache.c
source3/lib/netapi/group.c
source3/lib/netapi/localgroup.c
source3/lib/packet.c
source3/lib/select.c
source3/lib/signal.c [deleted file]
source3/lib/smbconf/smbconf_txt.c
source3/lib/smbldap.c
source3/lib/sysquotas.c
source3/lib/sysquotas_4A.c
source3/lib/sysquotas_linux.c
source3/lib/sysquotas_xfs.c
source3/lib/time.c
source3/lib/util.c
source3/lib/util_file.c
source3/lib/util_pw.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/lib/util_tdb.c
source3/lib/util_uuid.c
source3/lib/xfile.c [deleted file]
source3/libads/authdata.c
source3/libads/disp_sec.c
source3/libads/krb5_setpw.c
source3/libads/ldap.c
source3/libads/util.c
source3/libgpo/gpext/registry.c
source3/libgpo/gpext/security.c
source3/libgpo/gpo_ini.c
source3/libnet/libnet_dssync.c
source3/libnet/libnet_join.c
source3/librpc/gen_ndr/cli_initshutdown.c
source3/librpc/gen_ndr/cli_initshutdown.h
source3/librpc/gen_ndr/cli_lsa.c
source3/librpc/gen_ndr/cli_lsa.h
source3/librpc/gen_ndr/cli_netlogon.c
source3/librpc/gen_ndr/cli_netlogon.h
source3/librpc/gen_ndr/cli_ntsvcs.c
source3/librpc/gen_ndr/cli_ntsvcs.h
source3/librpc/gen_ndr/cli_svcctl.c
source3/librpc/gen_ndr/cli_svcctl.h
source3/librpc/gen_ndr/cli_winreg.c
source3/librpc/gen_ndr/cli_winreg.h
source3/librpc/gen_ndr/drsblobs.h
source3/librpc/gen_ndr/drsuapi.h
source3/librpc/gen_ndr/epmapper.h
source3/librpc/gen_ndr/initshutdown.h
source3/librpc/gen_ndr/lsa.h
source3/librpc/gen_ndr/misc.h
source3/librpc/gen_ndr/ndr_drsblobs.c
source3/librpc/gen_ndr/ndr_drsblobs.h
source3/librpc/gen_ndr/ndr_drsuapi.c
source3/librpc/gen_ndr/ndr_drsuapi.h
source3/librpc/gen_ndr/ndr_epmapper.c
source3/librpc/gen_ndr/ndr_initshutdown.c
source3/librpc/gen_ndr/ndr_initshutdown.h
source3/librpc/gen_ndr/ndr_lsa.c
source3/librpc/gen_ndr/ndr_lsa.h
source3/librpc/gen_ndr/ndr_misc.c
source3/librpc/gen_ndr/ndr_netlogon.c
source3/librpc/gen_ndr/ndr_netlogon.h
source3/librpc/gen_ndr/ndr_notify.c
source3/librpc/gen_ndr/ndr_ntsvcs.c
source3/librpc/gen_ndr/ndr_samr.c
source3/librpc/gen_ndr/ndr_samr.h
source3/librpc/gen_ndr/ndr_security.c
source3/librpc/gen_ndr/ndr_security.h
source3/librpc/gen_ndr/ndr_svcctl.c
source3/librpc/gen_ndr/ndr_svcctl.h
source3/librpc/gen_ndr/ndr_winreg.c
source3/librpc/gen_ndr/ndr_winreg.h
source3/librpc/gen_ndr/ndr_xattr.c
source3/librpc/gen_ndr/ndr_xattr.h
source3/librpc/gen_ndr/netlogon.h
source3/librpc/gen_ndr/notify.h
source3/librpc/gen_ndr/ntsvcs.h
source3/librpc/gen_ndr/samr.h
source3/librpc/gen_ndr/security.h
source3/librpc/gen_ndr/srv_dfs.c
source3/librpc/gen_ndr/srv_dssetup.c
source3/librpc/gen_ndr/srv_echo.c
source3/librpc/gen_ndr/srv_epmapper.c
source3/librpc/gen_ndr/srv_eventlog.c
source3/librpc/gen_ndr/srv_initshutdown.c
source3/librpc/gen_ndr/srv_lsa.c
source3/librpc/gen_ndr/srv_netlogon.c
source3/librpc/gen_ndr/srv_ntsvcs.c
source3/librpc/gen_ndr/srv_samr.c
source3/librpc/gen_ndr/srv_srvsvc.c
source3/librpc/gen_ndr/srv_svcctl.c
source3/librpc/gen_ndr/srv_winreg.c
source3/librpc/gen_ndr/srv_wkssvc.c
source3/librpc/gen_ndr/svcctl.h
source3/librpc/gen_ndr/winreg.h
source3/librpc/gen_ndr/xattr.h
source3/librpc/idl/drsblobs.idl [deleted file]
source3/librpc/idl/epmapper.idl [deleted file]
source3/librpc/idl/idl_types.h [deleted file]
source3/librpc/idl/initshutdown.idl [deleted file]
source3/librpc/idl/lsa.idl
source3/librpc/idl/misc.idl [deleted file]
source3/librpc/idl/netlogon.idl
source3/librpc/idl/samr.idl
source3/librpc/idl/winreg.idl
source3/librpc/idl/xattr.idl [deleted file]
source3/librpc/ndr/libndr.h [deleted file]
source3/librpc/ndr/ndr.c [deleted file]
source3/librpc/ndr/ndr_basic.c [deleted file]
source3/librpc/ndr/ndr_compression.c [deleted file]
source3/librpc/ndr/ndr_drsuapi.c [deleted file]
source3/librpc/ndr/ndr_drsuapi.h [deleted file]
source3/librpc/ndr/ndr_krb5pac.c [deleted file]
source3/librpc/ndr/ndr_misc.c [deleted file]
source3/librpc/ndr/ndr_string.c
source3/librpc/ndr/util.c [new file with mode: 0644]
source3/librpc/ndr/uuid.c [deleted file]
source3/librpc/rpc/binding.c [deleted file]
source3/librpc/rpc/dcerpc.c
source3/librpc/rpc/dcerpc.h
source3/librpc/rpc/dcerpc_util.c [deleted file]
source3/librpc/tools/ndrdump.c
source3/libsmb/async_smb.c
source3/libsmb/clidgram.c
source3/libsmb/clifile.c
source3/libsmb/clikrb5.c
source3/libsmb/cliquota.c
source3/libsmb/clireadwrite.c
source3/libsmb/ntlmssp_sign.c
source3/libsmb/smbdes.c
source3/libsmb/smbencrypt.c
source3/libsmb/trusts_util.c
source3/locking/locking.c
source3/locking/posix.c
source3/modules/vfs_cap.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_smb_traffic_analyzer.c
source3/modules/vfs_xattr_tdb.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_processlogon.c
source3/nmbd/nmbd_winsserver.c
source3/nsswitch/winbind_nss_irix.c
source3/nsswitch/wins.c
source3/param/loadparm.c
source3/param/params.c [deleted file]
source3/param/test_lp_load.c
source3/passdb/machine_sid.c
source3/passdb/secrets.c
source3/printing/nt_printing.c
source3/printing/pcap.c
source3/printing/print_generic.c
source3/printing/print_svid.c
source3/printing/printfsp.c
source3/printing/printing.c
source3/registry/reg_perfcount.c
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_pipe.c
source3/rpc_client/cli_svcctl.c
source3/rpc_client/init_samr.c
source3/rpc_client/ndr.c
source3/rpc_parse/parse_svcctl.c
source3/rpc_server/srv_eventlog_lib.c
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpc_server/srv_svcctl.c
source3/rpc_server/srv_svcctl_nt.c
source3/rpc_server/srv_winreg_nt.c
source3/rpcclient/cmd_drsuapi.c
source3/rpcclient/cmd_lsarpc.c
source3/rpcclient/cmd_netlogon.c
source3/rpcclient/cmd_samr.c
source3/rpcclient/cmd_spoolss.c
source3/samba4.m4
source3/samba4.mk
source3/script/build_idl.sh
source3/smbd/blocking.c
source3/smbd/chgpasswd.c
source3/smbd/close.c
source3/smbd/connection.c
source3/smbd/dfree.c
source3/smbd/dosmode.c
source3/smbd/fake_file.c
source3/smbd/files.c
source3/smbd/ipc.c
source3/smbd/lanman.c
source3/smbd/map_username.c
source3/smbd/noquotas.c
source3/smbd/ntquotas.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/password.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/quotas.c
source3/smbd/reply.c
source3/smbd/seal.c
source3/smbd/server.c
source3/smbd/service.c
source3/smbd/session.c
source3/smbd/statvfs.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c
source3/torture/locktest.c
source3/torture/torture.c
source3/torture/vfstest.c
source3/utils/net_ads.c
source3/utils/net_registry_util.c
source3/utils/net_rpc.c
source3/utils/net_rpc_join.c
source3/utils/net_rpc_service.c
source3/utils/net_usershare.c
source3/utils/ntlm_auth.c
source3/utils/pdbedit.c
source3/utils/smbcacls.c
source3/utils/smbcquotas.c
source3/utils/status_profile.c
source3/utils/testparm.c
source3/web/cgi.c
source3/web/swat.c
source3/winbindd/idmap_tdb.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_rpc.c
source4/Makefile
source4/auth/credentials/credentials.h
source4/auth/credentials/credentials_files.c
source4/auth/gensec/cyrus_sasl.c
source4/auth/gensec/schannel_state.c
source4/auth/gensec/spnego_parse.c
source4/auth/kerberos/gssapi_parse.c
source4/auth/ntlm/auth.c
source4/auth/ntlm/auth_sam.c
source4/auth/ntlm/auth_server.c
source4/auth/sam.c
source4/build/m4/ac_pkg_swig.m4 [moved from source4/scripting/python/ac_pkg_swig.m4 with 100% similarity]
source4/build/m4/check_make.m4
source4/build/m4/check_path.m4
source4/build/m4/check_perl.m4
source4/build/m4/check_python.m4 [new file with mode: 0644]
source4/build/m4/env.m4
source4/cldap_server/netlogon.c
source4/client/client.c
source4/cluster/cluster.c
source4/cluster/ctdb/client/ctdb_client.c
source4/cluster/ctdb/common/ctdb_io.c
source4/cluster/ctdb/common/ctdb_ltdb.c
source4/cluster/ctdb/common/ctdb_message.c
source4/cluster/ctdb/ctdb_cluster.c
source4/cluster/local.c
source4/configure.ac
source4/dsdb/common/sidmap.c
source4/dsdb/common/util.c
source4/dsdb/repl/drepl_out_helpers.c
source4/dsdb/repl/drepl_out_pull.c
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/repl/drepl_periodic.c
source4/dsdb/repl/drepl_service.c
source4/dsdb/repl/replicated_objects.c
source4/dsdb/samdb/cracknames.c
source4/dsdb/samdb/ldb_modules/extended_dn.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/naming_fsmo.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/objectguid.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_fsmo.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/samdb.c
source4/dsdb/samdb/samdb_privilege.c
source4/dsdb/schema/schema_init.c
source4/dsdb/schema/schema_set.c
source4/headermap.txt
source4/include/includes.h
source4/kdc/hdb-samba4.c
source4/kdc/kdc.c
source4/kdc/kpasswdd.c
source4/ldap_server/ldap_backend.c
source4/ldap_server/ldap_extended.c
source4/ldap_server/ldap_server.c
source4/lib/charset/iconv.c
source4/lib/com/dcom/main.c
source4/lib/com/dcom/tables.c
source4/lib/com/main.c
source4/lib/com/tables.c
source4/lib/gencache/gencache.c [deleted file]
source4/lib/gencache/gencache.h [deleted file]
source4/lib/json/AUTHORS [deleted file]
source4/lib/json/COPYING [deleted file]
source4/lib/json/ChangeLog [deleted file]
source4/lib/json/Doxyfile [deleted file]
source4/lib/json/INSTALL [deleted file]
source4/lib/json/Makefile.am [deleted file]
source4/lib/json/Makefile.in [deleted file]
source4/lib/json/NEWS [deleted file]
source4/lib/json/README [deleted file]
source4/lib/json/README-WIN32.html [deleted file]
source4/lib/json/README.html [deleted file]
source4/lib/json/aclocal.m4 [deleted file]
source4/lib/json/arraylist.c [deleted file]
source4/lib/json/arraylist.h [deleted file]
source4/lib/json/autogen.sh [deleted file]
source4/lib/json/bits.h [deleted file]
source4/lib/json/config.guess [deleted file]
source4/lib/json/config.h.in [deleted file]
source4/lib/json/config.h.win32 [deleted file]
source4/lib/json/config.sub [deleted file]
source4/lib/json/configure [deleted file]
source4/lib/json/configure.in [deleted file]
source4/lib/json/debug.c [deleted file]
source4/lib/json/debug.h [deleted file]
source4/lib/json/depcomp [deleted file]
source4/lib/json/install-sh [deleted file]
source4/lib/json/json-c.vcproj [deleted file]
source4/lib/json/json.h [deleted file]
source4/lib/json/json.pc.in [deleted file]
source4/lib/json/json_object.c [deleted file]
source4/lib/json/json_object.h [deleted file]
source4/lib/json/json_object_private.h [deleted file]
source4/lib/json/json_tokener.c [deleted file]
source4/lib/json/json_tokener.h [deleted file]
source4/lib/json/json_util.c [deleted file]
source4/lib/json/json_util.h [deleted file]
source4/lib/json/linkhash.c [deleted file]
source4/lib/json/linkhash.h [deleted file]
source4/lib/json/ltmain.sh [deleted file]
source4/lib/json/missing [deleted file]
source4/lib/json/mkinstalldirs [deleted file]
source4/lib/json/printbuf.c [deleted file]
source4/lib/json/printbuf.h [deleted file]
source4/lib/json/stamp-h.in [deleted file]
source4/lib/json/test1.c [deleted file]
source4/lib/json/test2.c [deleted file]
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/include/ldb.h
source4/lib/ldb/ldb.i
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h
source4/lib/ldb/ldb_wrap.c
source4/lib/ldb/modules/asq.c
source4/lib/ldb/tests/python/ldap.py
source4/lib/messaging/messaging.c
source4/lib/registry/dir.c
source4/lib/registry/interface.c
source4/lib/registry/local.c
source4/lib/registry/regf.c
source4/lib/registry/registry.h
source4/lib/registry/rpc.c
source4/lib/registry/util.c
source4/lib/samba3/config.mk
source4/lib/samba3/samba3.h
source4/lib/smbreadline/smbreadline.c
source4/lib/socket/interface.c
source4/lib/socket/socket.c
source4/lib/stream/packet.c
source4/lib/tdb_wrap.c
source4/lib/tls/tls.c
source4/lib/torture/torture.c
source4/lib/torture/torture.h
source4/lib/util/dlinklist.h [deleted file]
source4/libcli/auth/smbencrypt.c
source4/libcli/cldap/cldap.c
source4/libcli/cldap/cldap.h
source4/libcli/dgram/dgramsocket.c
source4/libcli/dgram/mailslot.c
source4/libcli/ldap/ldap.c
source4/libcli/ldap/ldap_client.c
source4/libcli/ldap/ldap_controls.c
source4/libcli/raw/clitransport.c
source4/libcli/raw/rawnotify.c
source4/libcli/raw/rawrequest.c
source4/libcli/raw/rawtrans.c
source4/libcli/resolve/resolve.c
source4/libcli/resolve/wins.c
source4/libcli/smb2/request.c
source4/libcli/smb2/transport.c
source4/libcli/util/clilsa.c
source4/libcli/wrepl/winsrepl.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_join.c
source4/libnet/libnet_lookup.c
source4/libnet/libnet_samdump.c
source4/libnet/libnet_samsync_ldb.c
source4/libnet/libnet_unbecome_dc.c
source4/libnet/libnet_vampire.c
source4/librpc/config.mk
source4/librpc/idl-deps.pl
source4/librpc/idl/dfs.idl [deleted file]
source4/librpc/idl/drsuapi.idl [deleted file]
source4/librpc/idl/dssetup.idl [deleted file]
source4/librpc/idl/echo.idl [deleted file]
source4/librpc/idl/eventlog.idl [deleted file]
source4/librpc/idl/lsa.idl
source4/librpc/idl/nbt.idl [deleted file]
source4/librpc/idl/netlogon.idl
source4/librpc/idl/notify.idl [deleted file]
source4/librpc/idl/ntsvcs.idl [deleted file]
source4/librpc/idl/opendb.idl
source4/librpc/idl/samr.idl
source4/librpc/idl/security.idl
source4/librpc/idl/spoolss.idl [deleted file]
source4/librpc/idl/svcctl.idl [deleted file]
source4/librpc/idl/winreg.idl
source4/librpc/idl/wkssvc.idl [deleted file]
source4/librpc/ndr/ndr_string.c
source4/librpc/ndr/ndr_table.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc.h
source4/librpc/scripts/build_idl.sh
source4/main.mk
source4/nbt_server/defense.c
source4/nbt_server/dgram/netlogon.c
source4/nbt_server/interfaces.c
source4/nbt_server/nodestatus.c
source4/nbt_server/query.c
source4/nbt_server/register.c
source4/nbt_server/wins/winsclient.c
source4/nsswitch/winbind_nss_netbsd.h [new file with mode: 0644]
source4/ntptr/simple_ldb/ntptr_simple_ldb.c
source4/ntvfs/cifs/vfs_cifs.c
source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
source4/ntvfs/common/notify.c
source4/ntvfs/ipc/vfs_ipc.c
source4/ntvfs/ntvfs.h
source4/ntvfs/ntvfs_base.c
source4/ntvfs/ntvfs_util.c
source4/ntvfs/posix/pvfs_acl_nfs4.c
source4/ntvfs/posix/pvfs_acl_xattr.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_notify.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/pvfs_search.c
source4/ntvfs/posix/pvfs_wait.c
source4/ntvfs/posix/pvfs_xattr.c
source4/ntvfs/posix/vfs_posix.c
source4/ntvfs/posix/xattr_system.c
source4/ntvfs/simple/vfs_simple.c
source4/ntvfs/smb2/vfs_smb2.c
source4/ntvfs/sysdep/inotify.c
source4/ntvfs/sysdep/sys_lease.c
source4/ntvfs/sysdep/sys_lease_linux.c
source4/ntvfs/sysdep/sys_notify.c
source4/param/generic.c
source4/param/loadparm.c
source4/param/secrets.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/drsuapi/dcesrv_drsuapi.c
source4/rpc_server/handles.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/lsa/lsa.h
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/remote/dcesrv_remote.c
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/samr/samr_password.c
source4/rpc_server/service_rpc.c
source4/rpc_server/winreg/rpc_winreg.c
source4/scripting/python/config.m4 [deleted file]
source4/scripting/python/samba/provision.py
source4/selftest/config.mk
source4/setup/schema_samba4.ldif
source4/smb_server/blob.c
source4/smb_server/handle.c
source4/smb_server/session.c
source4/smb_server/smb/trans2.c
source4/smb_server/smb_samba3.c
source4/smb_server/smb_server.h
source4/smb_server/tcon.c
source4/smbd/pidfile.c
source4/smbd/service.c
source4/smbd/service_stream.h
source4/smbd/service_task.h
source4/torture/auth/ntlmssp.c
source4/torture/auth/pac.c
source4/torture/basic/aliases.c
source4/torture/basic/mangle_test.c
source4/torture/basic/misc.c
source4/torture/gentest.c
source4/torture/ldap/cldap.c
source4/torture/ldap/schema.c
source4/torture/ldap/uptodatevector.c
source4/torture/libnet/libnet_BecomeDC.c
source4/torture/local/config.mk
source4/torture/local/local.c
source4/torture/locktest.c
source4/torture/nbench/nbio.c
source4/torture/nbt/wins.c
source4/torture/ndr/ndr.c
source4/torture/ndr/winreg.c
source4/torture/raw/oplock.c
source4/torture/rpc/drsuapi.c
source4/torture/rpc/drsuapi_cracknames.c
source4/torture/rpc/dssync.c
source4/torture/rpc/eventlog.c
source4/torture/rpc/initshutdown.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/rpc.c
source4/torture/rpc/samr.c
source4/torture/rpc/samr_accessmask.c
source4/torture/rpc/samsync.c
source4/torture/rpc/spoolss_notify.c
source4/torture/rpc/winreg.c
source4/torture/rpc/wkssvc.c
source4/torture/smb2/smb2.c
source4/torture/smbtorture.c
source4/torture/torture.c
source4/torture/util_smb.c
source4/utils/getntacl.c
source4/utils/ntlm_auth.c
source4/web_server/web_server.c
source4/web_server/wsgi.c
source4/winbind/wb_samba3_cmd.c
source4/winbind/wb_server.c
source4/winbind/wb_sid2domain.c
source4/wrepl_server/wrepl_server.c
testprogs/win32/midltests/Makefile [new file with mode: 0644]

index e585504ce5e3c575a804d4a0725f5864226342c6..e617400cc5c088791628f9fd70e5928d4c8575f2 100644 (file)
@@ -181,7 +181,7 @@ source4/libcli/composite/proto.h
 source4/libcli/finddcs.h
 source4/libcli/ldap/ldap_proto.h
 source4/libcli/libcli_proto.h
-source4/libcli/nbt/nbtname.h
+libcli/nbt/nbtname.h
 source4/libcli/nbt/nbt_proto.h
 source4/libcli/ndr_netlogon_proto.h
 source4/libcli/netlogon_proto.h
@@ -196,7 +196,7 @@ source4/libcli/util/proto.h
 source4/libcli/wrepl/winsrepl_proto.h
 source4/lib/cmdline/credentials.h
 source4/lib/cmdline/popt_credentials.h
-source4/lib/crypto/test_proto.h
+lib/crypto/test_proto.h
 source4/lib/db_wrap_proto.h
 source4/lib/ldb/bin
 source4/lib/ldb/examples/ldbreader
@@ -230,12 +230,11 @@ source4/lib/tdb/bin/tdbdump
 source4/lib/tdb/bin/tdbtool
 source4/lib/tdb/bin/tdbtorture
 source4/lib/tdr/tdr_proto.h
-source4/lib/util/apidocs
-source4/lib/util/asn1_proto.h
-source4/lib/util/pidfile.h
-source4/lib/util/unix_privs.h
-source4/lib/util/util_proto.h
-source4/lib/util/util_tdb.h
+lib/util/apidocs
+lib/util/asn1_proto.h
+lib/util/pidfile.h
+lib/util/unix_privs.h
+lib/util/util_proto.h
 source4/mkconfig.mk
 source4/nbt_server/dgram/proto.h
 source4/nbt_server/nbt_server_proto.h
@@ -308,3 +307,7 @@ tags
 packaging/RHEL-CTDB/samba.spec
 packaging/RHEL/samba.spec
 packaging/RHEL/makerpms.sh
+source3/librpc/gen_ndr/cli_drsblobs.c
+source3/librpc/gen_ndr/cli_drsblobs.h
+source3/librpc/gen_ndr/srv_drsblobs.c
+source3/librpc/gen_ndr/srv_drsblobs.h
index 28c8413231f4b45561155de2dada09e3b2ac6c2f..556fa3e86ea084a212f329121d532f92bebb1b82 100644 (file)
                <term>smb_traffic_analyzer:port = STRING</term>
                <listitem>
                <para>The module will send the data using the TCP port given
-               in STRING
+               in STRING.
+               </para>
+               </listitem>
+               </varlistentry>
+               <varlistentry>
+               <term>smb_traffic_analyzer:anonymize_prefix = STRING</term>
+               <listitem>
+               <para>The module will replace the user names with a prefix
+               given by STRING and a simple hash number.
                </para>
 
                </listitem>
        <smbconfoption name="smb_traffic_analyzer:mode">unix_domain_socket</smbconfoption>
        </programlisting>
 
-       <para>The module running on share "example_share", using an internet domain socket,
+       <para>The module running on share "example_share", using an internet socket,
        connecting to host "examplehost" on port 3491.</para>
        <programlisting>
        <smbconfsection name="[example_share]"/>
        <smbconfoption name="path">/data/example</smbconfoption>
        <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
        <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
-       <smbconfoption name="smb_traffic_analyzer:port">3490</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:port">3491</smbconfoption>
        </programlisting>
 
+       <para>The module running on share "example_share", using an internet socket,
+       connecting to host "examplehost" on port 3491, anonymizing user names with
+       the prefix "User".</para>
+       <programlisting>
+       <smbconfsection name="[example_share]"/>
+       <smbconfoption name="path">/data/example</smbconfoption>
+       <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:port">3491</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:anonymize_prefix">User</smbconfoption>
+       </programlisting>
 </refsect1>
 
 <refsect1>
index 0a98404eda3a53b144e0d2ed12038717e787221b..77f305a5d39459a0b81853e213a303e854dcc5c5 100644 (file)
@@ -41,34 +41,37 @@ bool torture_local_crypto_hmacmd5(struct torture_context *torture)
                DATA_BLOB md5;
        } testarray[8];
 
+       TALLOC_CTX *tctx = talloc_new(torture);
+       if (!tctx) { return false; };
+
        testarray[0].key        = data_blob_repeat_byte(0x0b, 16);
        testarray[0].data       = data_blob_string_const("Hi There");
-       testarray[0].md5        = strhex_to_data_blob("9294727a3638bb1c13f48ef8158bfc9d");
+       testarray[0].md5        = strhex_to_data_blob(tctx, "9294727a3638bb1c13f48ef8158bfc9d");
 
        testarray[1].key        = data_blob_string_const("Jefe");
        testarray[1].data       = data_blob_string_const("what do ya want for nothing?");
-       testarray[1].md5        = strhex_to_data_blob("750c783e6ab0b503eaa86e310a5db738");
+       testarray[1].md5        = strhex_to_data_blob(tctx, "750c783e6ab0b503eaa86e310a5db738");
 
        testarray[2].key        = data_blob_repeat_byte(0xaa, 16);
        testarray[2].data       = data_blob_repeat_byte(0xdd, 50);
-       testarray[2].md5        = strhex_to_data_blob("56be34521d144c88dbb8c733f0e8b3f6");
+       testarray[2].md5        = strhex_to_data_blob(tctx, "56be34521d144c88dbb8c733f0e8b3f6");
 
-       testarray[3].key        = strhex_to_data_blob("0102030405060708090a0b0c0d0e0f10111213141516171819");
+       testarray[3].key        = strhex_to_data_blob(tctx, "0102030405060708090a0b0c0d0e0f10111213141516171819");
        testarray[3].data       = data_blob_repeat_byte(0xcd, 50);
-       testarray[3].md5        = strhex_to_data_blob("697eaf0aca3a3aea3a75164746ffaa79");
+       testarray[3].md5        = strhex_to_data_blob(tctx, "697eaf0aca3a3aea3a75164746ffaa79");
 
        testarray[4].key        = data_blob_repeat_byte(0x0c, 16);
        testarray[4].data       = data_blob_string_const("Test With Truncation");
-       testarray[4].md5        = strhex_to_data_blob("56461ef2342edc00f9bab995690efd4c");
+       testarray[4].md5        = strhex_to_data_blob(tctx, "56461ef2342edc00f9bab995690efd4c");
 
        testarray[5].key        = data_blob_repeat_byte(0xaa, 80);
        testarray[5].data       = data_blob_string_const("Test Using Larger Than Block-Size Key - Hash Key First");
-       testarray[5].md5        = strhex_to_data_blob("6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd");
+       testarray[5].md5        = strhex_to_data_blob(tctx, "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd");
 
        testarray[6].key        = data_blob_repeat_byte(0xaa, 80);
        testarray[6].data       = data_blob_string_const("Test Using Larger Than Block-Size Key "
                                                         "and Larger Than One Block-Size Data");
-       testarray[6].md5        = strhex_to_data_blob("6f630fad67cda0ee1fb1f562db3aa53e");
+       testarray[6].md5        = strhex_to_data_blob(tctx, "6f630fad67cda0ee1fb1f562db3aa53e");
 
        testarray[7].key        = data_blob(NULL, 0);
 
@@ -93,6 +96,6 @@ bool torture_local_crypto_hmacmd5(struct torture_context *torture)
                        ret = false;
                }
        }
-
+       talloc_free(tctx);
        return ret;
 }
index dddf9e61a011707bbb3d9102fffffbcae8d429ed..a6080cff823390fa0eb2d3c10fdab95b7320ad61 100644 (file)
@@ -64,7 +64,7 @@ bool torture_local_crypto_md4(struct torture_context *torture)
                DATA_BLOB md4blob;
 
                data = data_blob_string_const(testarray[i].data);
-               md4blob  = strhex_to_data_blob(testarray[i].md4);
+               md4blob  = strhex_to_data_blob(NULL, testarray[i].md4);
 
                mdfour(md4, data.data, data.length);
 
index 1244dca75377e3a79155d447cf67068227a80c48..7223af211433dc4a25ed22d27863e4ad3540b493 100644 (file)
@@ -70,7 +70,7 @@ bool torture_local_crypto_md5(struct torture_context *torture)
                DATA_BLOB md5blob;
 
                data = data_blob_string_const(testarray[i].data);
-               md5blob  = strhex_to_data_blob(testarray[i].md5);
+               md5blob  = strhex_to_data_blob(NULL, testarray[i].md5);
 
                MD5Init(&ctx);
                MD5Update(&ctx, data.data, data.length);
index c69ea6cdac4d8ae873db163b4ceb6c1cbf73f792..4ac77e72702542024f19b7ab088b94ec673845ee 100644 (file)
    which causes a warning storm on irix */
 #undef HAVE_INTTYPES_H
 #elif HAVE_INTTYPES_H
+#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 #endif
 
+#ifndef __PRI64_PREFIX
+# if __WORDSIZE == 64
+#  define __PRI64_PREFIX       "l"
+# else
+#  define __PRI64_PREFIX       "ll"
+# endif
+#endif
+
+/* Decimal notation.  */
+#ifndef PRId8
+# define PRId8         "d"
+#endif
+#ifndef PRId16
+# define PRId16                "d"
+#endif
+#ifndef PRId32
+# define PRId32                "d"
+#endif
+#ifndef PRId64
+# define PRId64                __PRI64_PREFIX "d"
+#endif
+
+#ifndef PRIi8
+# define PRIi8         "i"
+#endif
+#ifndef PRIi8
+# define PRIi16                "i"
+#endif
+#ifndef PRIi8
+# define PRIi32                "i"
+#endif
+#ifndef PRIi8
+# define PRIi64                __PRI64_PREFIX "i"
+#endif
+
+#ifndef PRIu8
+# define PRIu8         "u"
+#endif
+#ifndef PRIu16
+# define PRIu16                "u"
+#endif
+#ifndef PRIu32
+# define PRIu32                "u"
+#endif
+#ifndef PRIu64
+# define PRIu64                __PRI64_PREFIX "u"
+#endif
+
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
similarity index 100%
rename from source4/lib/util/Doxyfile
rename to lib/util/Doxyfile
diff --git a/lib/util/README b/lib/util/README
new file mode 100644 (file)
index 0000000..fffd44d
--- /dev/null
@@ -0,0 +1,6 @@
+This directory contains libutil (until we can think of a better name)
+
+The idea is that this library contains simple but useful data structures 
+and support functions that are generally useful; not just for Samba but for 
+other projects as well. Functions here should not depend on any external 
+libraries, just on libc (perhaps partially provided by libreplace).
similarity index 99%
rename from source4/lib/util/asn1.c
rename to lib/util/asn1.c
index 4756c0640df391e3a196c1d48ff47d4db451a6c9..ef346542a64a030fa1effbcbd8ed5f71917c9b3e 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/util/asn1.h"
+#include "../lib/util/asn1.h"
 
 /* allocate an asn1 structure */
 struct asn1_data *asn1_init(TALLOC_CTX *mem_ctx)
similarity index 97%
rename from source4/lib/util/asn1.h
rename to lib/util/asn1.h
index 34aa1e2cb9caee6a597feecfd3dbc3101122a95d..c8e83b92668b42028a6d8dfba1884f1db727bd6b 100644 (file)
@@ -49,6 +49,6 @@ struct asn1_data {
 
 #define ASN1_MAX_OIDS 20
 
-#include "lib/util/asn1_proto.h"
+#include "../lib/util/asn1_proto.h"
 
 #endif /* _ASN_1_H */
similarity index 100%
rename from source4/lib/util/attr.h
rename to lib/util/attr.h
similarity index 93%
rename from source4/lib/util/config.mk
rename to lib/util/config.mk
index 925713a53c1d55f889b199d3512a6769459460b1..5488534f262ad760b5e6b6a1d5fc2156d5fd02dd 100644 (file)
@@ -14,15 +14,18 @@ LIBSAMBA-UTIL_OBJ_FILES = $(addprefix $(libutilsrcdir)/, \
                genrand.o \
                dprintf.o \
                util_str.o \
+               substitute.o \
                util_strlist.o \
                util_file.o \
                data_blob.o \
                util.o \
+               util_net.o \
                fsusage.o \
                ms_fnmatch.o \
                mutex.o \
                idtree.o \
                become_daemon.o \
+               rbtree.o \
                params.o)
 
 PUBLIC_HEADERS += $(addprefix $(libutilsrcdir)/, util.h \
@@ -63,8 +66,6 @@ PUBLIC_DEPENDENCIES = LIBTDB
 
 UTIL_TDB_OBJ_FILES = $(libutilsrcdir)/util_tdb.o
 
-$(eval $(call proto_header_template,$(libutilsrcdir)/util_tdb.h,$(UTIL_TDB_OBJ_FILES:.o=.c)))
-
 [SUBSYSTEM::UTIL_LDB]
 PUBLIC_DEPENDENCIES = LIBLDB
 
similarity index 93%
rename from source4/lib/util/data_blob.c
rename to lib/util/data_blob.c
index 57b34b7ae73d8aa698dc9df4fc164dc22a8b4512..c7d01bacc7ad1b33f05bccc24ad0adb81ab53f51 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+const DATA_BLOB data_blob_null = { NULL, 0 };
+
 /**
  * @file
  * @brief Manipulation of arbitrary data blobs
@@ -180,6 +182,18 @@ _PUBLIC_ DATA_BLOB data_blob_string_const(const char *str)
        return blob;
 }
 
+/**
+  useful for constructing data blobs in test suites, while
+  avoiding const warnings
+**/
+_PUBLIC_ DATA_BLOB data_blob_string_const_null(const char *str)
+{
+       DATA_BLOB blob;
+       blob.data = discard_const_p(uint8_t, str);
+       blob.length = str ? strlen(str)+1 : 0;
+       return blob;
+}
+
 /**
  * Create a new data blob from const data 
  */
similarity index 92%
rename from source4/lib/util/data_blob.h
rename to lib/util/data_blob.h
index e9dca67772043b10ed4a665b33b6719a948f51c4..ffde51cf33600abfb9461b3ceb3cfd79752ed48d 100644 (file)
@@ -104,6 +104,14 @@ _PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob);
 **/
 _PUBLIC_ DATA_BLOB data_blob_string_const(const char *str);
 
+/**
+  useful for constructing data blobs in test suites, while
+  avoiding const warnings
+
+  includes the terminating null character (as opposed to data_blo_string_const)
+**/
+_PUBLIC_ DATA_BLOB data_blob_string_const_null(const char *str);
+
 /**
  * Create a new data blob from const data 
  */
@@ -120,4 +128,6 @@ _PUBLIC_ bool data_blob_realloc(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, size_t len
 _PUBLIC_ bool data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
                                   const void *p, size_t length);
 
+extern const DATA_BLOB data_blob_null;
+
 #endif /* _SAMBA_DATABLOB_H_ */
similarity index 92%
rename from source4/lib/util/debug.c
rename to lib/util/debug.c
index 00dcbfc8bdbeba71fa312245aa21f85e31e01a79..b6edb908c7309edb9cf2890fd05bd9e7f9a33ba1 100644 (file)
@@ -31,7 +31,9 @@
 /** 
  * this global variable determines what messages are printed 
  */
-_PUBLIC_ int DEBUGLEVEL;
+int _debug_level = 0;
+_PUBLIC_ int *debug_level = &_debug_level;
+int *DEBUGLEVEL_CLASS = NULL; /* For samba 3 */
 
 /* the registered mutex handlers */
 static struct {
@@ -89,12 +91,19 @@ static void log_timestring(int level, const char *location, const char *func)
   the backend for debug messages. Note that the DEBUG() macro has already
   ensured that the log level has been met before this is called
 */
-_PUBLIC_ void do_debug_header(int level, const char *location, const char *func)
+_PUBLIC_ void dbghdr(int level, const char *location, const char *func)
 {
        log_timestring(level, location, func);
        log_task_id();
 }
 
+
+_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func)
+{
+       /* Simple wrapper, Samba 4 doesn't do debug classes */
+       dbghdr(level, location, func);
+}
+
 /**
   the backend for debug messages. Note that the DEBUG() macro has already
   ensured that the log level has been met before this is called
@@ -102,7 +111,7 @@ _PUBLIC_ void do_debug_header(int level, const char *location, const char *func)
   @note You should never have to call this function directly. Call the DEBUG()
   macro instead.
 */
-_PUBLIC_ void do_debug(const char *format, ...)
+_PUBLIC_ void dbgtext(const char *format, ...)
 {
        va_list ap;
        char *s = NULL;
similarity index 93%
rename from source4/lib/util/debug.h
rename to lib/util/debug.h
index 605628174a949589b433303cff2356ad722f410d..8f4fa2a8fcf8eaa0bd053ac6e67fa0dc678f3e57 100644 (file)
@@ -39,6 +39,7 @@ struct debug_ops {
        void (*log_task_id)(int fd);
 };
 
+#define DEBUGLEVEL *debug_level
 extern int DEBUGLEVEL;
 
 #define debug_ctx() (_debug_ctx?_debug_ctx:(_debug_ctx=talloc_new(NULL)))
@@ -48,9 +49,9 @@ extern int DEBUGLEVEL;
        if (DEBUGLVL(level)) { \
                void* _debug_ctx=NULL; \
                if (header) { \
-                       do_debug_header(level, __location__, __FUNCTION__); \
+                       dbghdr(level, __location__, __FUNCTION__); \
                } \
-               do_debug body; \
+               dbgtext body; \
                talloc_free(_debug_ctx); \
        } \
 } while (0)
@@ -77,7 +78,7 @@ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2};
   the backend for debug messages. Note that the DEBUG() macro has already
   ensured that the log level has been met before this is called
 */
-_PUBLIC_ void do_debug_header(int level, const char *location, const char *func);
+_PUBLIC_ void dbghdr(int level, const char *location, const char *func);
 
 /**
   reopen the log file (usually called because the log file name might have changed)
@@ -125,4 +126,4 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops);
   @note You should never have to call this function directly. Call the DEBUG()
   macro instead.
 */
-_PUBLIC_ void do_debug(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
+_PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
similarity index 100%
rename from source4/lib/util/fault.c
rename to lib/util/fault.c
similarity index 100%
rename from source4/lib/util/fault.m4
rename to lib/util/fault.m4
similarity index 92%
rename from source4/lib/util/fsusage.c
rename to lib/util/fsusage.c
index 43c87872164d8ef08cb3650267d6aa834b4a86c2..e5f2678a9f14f00726d137fee886d95b5cfeffa5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-
 /**
  * @file
  * @brief Utility functions for getting the amount of free disk space
 */
 static uint64_t adjust_blocks(uint64_t blocks, uint64_t fromsize, uint64_t tosize)
 {
-       if (fromsize == tosize) /* e.g., from 512 to 512 */
+       if (fromsize == tosize) /* e.g., from 512 to 512 */
                return blocks;
-       else if (fromsize > tosize)     /* e.g., from 2048 to 512 */
+       } else if (fromsize > tosize) { /* e.g., from 2048 to 512 */
                return blocks * (fromsize / tosize);
-       else                            /* e.g., from 256 to 512 */
+       } else { /* e.g., from 256 to 512 */
+               /* Protect against broken filesystems... */
+               if (fromsize == 0) {
+                       fromsize = tosize;
+               }
                return (blocks + 1) / (tosize / fromsize);
+       }
 }
 
 /**
@@ -124,8 +129,13 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
 #endif /* STAT_STATFS4 */
 
 #if defined(STAT_STATVFS) || defined(STAT_STATVFS64)           /* SVR4 */
+#ifdef HAVE_FRSIZE
 # define CONVERT_BLOCKS(B) \
        adjust_blocks ((uint64_t)(B), fsd.f_frsize ? (uint64_t)fsd.f_frsize : (uint64_t)fsd.f_bsize, (uint64_t)512)
+#else
+# define CONVERT_BLOCKS(B) \
+       adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
+#endif
 
 #ifdef STAT_STATVFS64
        struct statvfs64 fsd;
similarity index 92%
rename from source4/lib/util/fsusage.m4
rename to lib/util/fsusage.m4
index 6d5d13fe253876641e9da329d4a59a9babe2d880..843965041f86bff21859bdb23599e1e478eb278a 100644 (file)
@@ -54,6 +54,16 @@ if test $space = no; then
   fi
 fi
 
+# fsusage.c assumes that statvfs has an f_frsize entry. Some weird
+# systems use f_bsize.
+AC_CACHE_CHECK([that statvfs.f_frsize works],samba_cv_frsize, [
+    AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/statvfs.h>],[struct statvfs buf; buf.f_frsize = 0],
+       samba_cv_frsize=yes,samba_cv_frsize=no)])
+if test x"$samba_cv_frsize" = x"yes"; then
+    AC_DEFINE(HAVE_FRSIZE, 1, [Whether statvfs.f_frsize exists])
+fi
+
 if test $space = no; then
   # DEC Alpha running OSF/1
   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
similarity index 100%
rename from source4/lib/util/idtree.c
rename to lib/util/idtree.c
diff --git a/lib/util/memory.h b/lib/util/memory.h
new file mode 100644 (file)
index 0000000..de01492
--- /dev/null
@@ -0,0 +1,93 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1992-1999
+   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _SAMBA_MEMORY_H_
+#define _SAMBA_MEMORY_H_
+
+#ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */
+/**
+ * Free memory if the pointer and zero the pointer.
+ *
+ * @note You are explicitly allowed to pass NULL pointers -- they will
+ * always be ignored.
+ **/
+#define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
+#endif
+
+/** 
+ * Type-safe version of malloc. Allocated one copy of the 
+ * specified data type.
+ */
+#define malloc_p(type) (type *)malloc(sizeof(type))
+
+/**
+ * Allocate an array of elements of one data type. Does type-checking.
+ */
+#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count, false)
+
+/** 
+ * Resize an array of elements of one data type. Does type-checking.
+ */
+#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count, false)
+
+/** 
+ * zero a structure 
+ */
+#ifndef ZERO_STRUCT
+#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+#endif
+
+/** 
+ * zero a structure given a pointer to the structure 
+ */
+#ifndef ZERO_STRUCTP
+#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
+#endif
+
+/** 
+ * zero a structure given a pointer to the structure - no zero check 
+ */
+#ifndef ZERO_STRUCTPN
+#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
+#endif
+
+/* zero an array - note that sizeof(array) must work - ie. it must not be a
+   pointer */
+#ifndef ZERO_ARRAY
+#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x))
+#endif
+
+/**
+ * work out how many elements there are in a static array 
+ */
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
+#endif
+
+/** 
+ * pointer difference macro 
+ */
+#ifndef PTR_DIFF
+#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
+#endif
+
+
+
+#endif /* _SAMBA_MEMORY_H_ */
similarity index 100%
rename from source4/lib/util/mutex.c
rename to lib/util/mutex.c
similarity index 100%
rename from source4/lib/util/mutex.h
rename to lib/util/mutex.h
similarity index 99%
rename from source4/lib/util/params.c
rename to lib/util/params.c
index 3a9e2b95051123fd7315072999b9e234a5cfeb5c..c03edec272cdfbc4aefb673358be754e82b38ffd 100644 (file)
@@ -510,7 +510,7 @@ static myFILE *OpenConfFile( const char *FileName )
   ret = talloc(talloc_autofree_context(), myFILE);
   if (!ret) return NULL;
 
-  ret->buf = file_load(FileName, &ret->size, ret);
+  ret->buf = file_load(FileName, &ret->size, 0, ret);
   if( NULL == ret->buf )
     {
     DEBUG( 1,
similarity index 100%
rename from source3/lib/rbtree.c
rename to lib/util/rbtree.c
similarity index 100%
rename from source3/include/rbtree.h
rename to lib/util/rbtree.h
similarity index 100%
rename from source4/lib/util/signal.c
rename to lib/util/signal.c
diff --git a/lib/util/substitute.c b/lib/util/substitute.c
new file mode 100644 (file)
index 0000000..84514ac
--- /dev/null
@@ -0,0 +1,165 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   
+   Copyright (C) Andrew Tridgell 1992-2001
+   Copyright (C) Simo Sorce      2001-2002
+   Copyright (C) Martin Pool     2003
+   Copyright (C) James Peach    2005
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+
+/**
+ * @file
+ * @brief Substitute utilities.
+ **/
+
+/**
+ Substitute a string for a pattern in another string. Make sure there is 
+ enough room!
+
+ This routine looks for pattern in s and replaces it with 
+ insert. It may do multiple replacements.
+
+ Any of " ; ' $ or ` in the insert string are replaced with _
+ if len==0 then the string cannot be extended. This is different from the old
+ use of len==0 which was for no length checks to be done.
+**/
+
+_PUBLIC_ void string_sub(char *s, const char *pattern, const char *insert, size_t len)
+{
+       char *p;
+       ssize_t ls, lp, li, i;
+
+       if (!insert || !pattern || !*pattern || !s)
+               return;
+
+       ls = (ssize_t)strlen(s);
+       lp = (ssize_t)strlen(pattern);
+       li = (ssize_t)strlen(insert);
+
+       if (len == 0)
+               len = ls + 1; /* len is number of *bytes* */
+
+       while (lp <= ls && (p = strstr(s, pattern))) {
+               if (ls + (li-lp) >= len) {
+                       DEBUG(0,("ERROR: string overflow by %d in string_sub(%.50s, %d)\n", 
+                                (int)(ls + (li-lp) - len),
+                                pattern, (int)len));
+                       break;
+               }
+               if (li != lp) {
+                       memmove(p+li,p+lp,strlen(p+lp)+1);
+               }
+               for (i=0;i<li;i++) {
+                       switch (insert[i]) {
+                       case '`':
+                       case '"':
+                       case '\'':
+                       case ';':
+                       case '$':
+                       case '%':
+                       case '\r':
+                       case '\n':
+                               p[i] = '_';
+                               break;
+                       default:
+                               p[i] = insert[i];
+                       }
+               }
+               s = p + li;
+               ls += (li-lp);
+       }
+}
+
+/**
+ * Talloc'ed version of string_sub
+ */
+_PUBLIC_ char *string_sub_talloc(TALLOC_CTX *mem_ctx, const char *s, 
+                               const char *pattern, const char *insert)
+{
+       const char *p;
+       char *ret;
+       size_t len, alloc_len;
+
+       if (insert == NULL || pattern == NULL || !*pattern || s == NULL)
+               return NULL;
+
+       /* determine length needed */
+       len = strlen(s);
+       
+       for (p = strstr(s, pattern); p != NULL; 
+            p = strstr(p+strlen(pattern), pattern)) {
+               len += strlen(insert) - strlen(pattern);
+       }
+
+       alloc_len = MAX(len, strlen(s))+1;
+       ret = talloc_array(mem_ctx, char, alloc_len);
+       if (ret == NULL)
+               return NULL;
+       strncpy(ret, s, alloc_len);
+       string_sub(ret, pattern, insert, alloc_len);
+
+       ret = talloc_realloc(mem_ctx, ret, char, len+1);
+       if (ret == NULL)
+               return NULL;
+
+       SMB_ASSERT(ret[len] == '\0');
+
+       return ret;
+}
+
+/**
+ Similar to string_sub() but allows for any character to be substituted. 
+ Use with caution!
+ if len==0 then the string cannot be extended. This is different from the old
+ use of len==0 which was for no length checks to be done.
+**/
+
+_PUBLIC_ void all_string_sub(char *s,const char *pattern,const char *insert, size_t len)
+{
+       char *p;
+       ssize_t ls,lp,li;
+
+       if (!insert || !pattern || !s)
+               return;
+
+       ls = (ssize_t)strlen(s);
+       lp = (ssize_t)strlen(pattern);
+       li = (ssize_t)strlen(insert);
+
+       if (!*pattern)
+               return;
+       
+       if (len == 0)
+               len = ls + 1; /* len is number of *bytes* */
+       
+       while (lp <= ls && (p = strstr(s,pattern))) {
+               if (ls + (li-lp) >= len) {
+                       DEBUG(0,("ERROR: string overflow by %d in all_string_sub(%.50s, %d)\n", 
+                                (int)(ls + (li-lp) - len),
+                                pattern, (int)len));
+                       break;
+               }
+               if (li != lp) {
+                       memmove(p+li,p+lp,strlen(p+lp)+1);
+               }
+               memcpy(p, insert, li);
+               s = p + li;
+               ls += (li-lp);
+       }
+}
similarity index 100%
rename from source4/lib/util/system.c
rename to lib/util/system.c
diff --git a/lib/util/tests/data_blob.c b/lib/util/tests/data_blob.c
new file mode 100644 (file)
index 0000000..875e5fd
--- /dev/null
@@ -0,0 +1,97 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   data blob testing
+
+   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+
+static bool test_string(struct torture_context *tctx)
+{
+       DATA_BLOB blob = data_blob_string_const("bla"); 
+
+       torture_assert_int_equal(tctx, blob.length, 3, "blob length");
+       torture_assert_str_equal(tctx, (char *)blob.data, "bla", "blob data");
+
+       return true;
+}
+
+static bool test_string_null(struct torture_context *tctx)
+{
+       DATA_BLOB blob = data_blob_string_const_null("bla");    
+
+       torture_assert_int_equal(tctx, blob.length, 4, "blob length");
+       torture_assert_str_equal(tctx, (char *)blob.data, "bla", "blob data");
+
+       return true;
+}
+
+static bool test_zero(struct torture_context *tctx)
+{
+       int i;
+       DATA_BLOB z = data_blob_talloc_zero(tctx, 4);
+       torture_assert_int_equal(tctx, z.length, 4, "length");
+       for (i = 0; i < z.length; i++)
+               torture_assert_int_equal(tctx, z.data[i], 0, "contents");
+       data_blob_free(&z);
+       return true;
+}
+
+
+static bool test_clear(struct torture_context *tctx)
+{
+       int i;
+       DATA_BLOB z = data_blob("lalala", 6);
+       torture_assert_int_equal(tctx, z.length, 6, "length");
+       data_blob_clear(&z);
+       for (i = 0; i < z.length; i++)
+               torture_assert_int_equal(tctx, z.data[i], 0, "contents");
+       data_blob_free(&z);
+       return true;
+}
+
+static bool test_cmp(struct torture_context *tctx)
+{
+       DATA_BLOB a = data_blob_string_const("bla");
+       DATA_BLOB b = data_blob_string_const("blae");
+       torture_assert(tctx, data_blob_cmp(&a, &b) != 0, "cmp different");
+       torture_assert(tctx, data_blob_cmp(&a, &a) == 0, "cmp self");
+       return true;
+}
+
+static bool test_hex_string(struct torture_context *tctx)
+{
+       DATA_BLOB a = data_blob_string_const("\xC\xA\xF\xE");
+       torture_assert_str_equal(tctx, data_blob_hex_string(tctx, &a), "0C0A0F0E", "hex string");
+       return true;
+}
+
+struct torture_suite *torture_local_util_data_blob(TALLOC_CTX *mem_ctx)
+{
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "DATABLOB");
+
+       torture_suite_add_simple_test(suite, "string", test_string);
+       torture_suite_add_simple_test(suite, "string_null", test_string_null);
+       torture_suite_add_simple_test(suite, "zero", test_zero);;
+       torture_suite_add_simple_test(suite, "clear", test_clear);
+       torture_suite_add_simple_test(suite, "cmp", test_cmp);
+       torture_suite_add_simple_test(suite, "hex string", test_hex_string);
+
+       return suite;
+}
similarity index 92%
rename from source4/lib/util/tests/file.c
rename to lib/util/tests/file.c
index 3377e833dc3e038fcb135c385967dc4946705a7a..4aff0e9afdee5338c2a7892af4fa1187ea6fd5ca 100644 (file)
@@ -42,13 +42,19 @@ static bool test_file_load_save(struct torture_context *tctx)
        torture_assert_file_contains_text(tctx, TEST_FILENAME, TEST_DATA, 
                                                                      "file contents");
 
-       data = file_load(TEST_FILENAME, &len, mem_ctx);
+       data = file_load(TEST_FILENAME, &len, 0, mem_ctx);
        torture_assert(tctx, data, "loading file");
 
        torture_assert_int_equal(tctx, len, strlen(TEST_DATA), "Length");
        
        torture_assert_mem_equal(tctx, data, TEST_DATA, len, "Contents");
 
+       data = file_load(TEST_FILENAME, &len, 5, mem_ctx);
+
+       torture_assert_int_equal(tctx, len, 5, "Length");
+
+       torture_assert_mem_equal(tctx, data, TEST_DATA, len, "Contents");
+
        unlink(TEST_FILENAME);
        return true;
 }
similarity index 94%
rename from source4/lib/util/tests/strlist.c
rename to lib/util/tests/strlist.c
index 9af26f9e71efebff9f9b3b87d8599dbe99459263..86051029548e18eb498fd2c9b54723545d59a9a7 100644 (file)
@@ -71,17 +71,17 @@ static bool test_list_copy(struct torture_context *tctx)
        const char *empty_list[] = { NULL };
        const char **null_list = NULL;
 
-       result = str_list_copy(tctx, list);
+       result = (const char **)str_list_copy(tctx, list);
        torture_assert_int_equal(tctx, str_list_length(result), 2, "list length");
        torture_assert_str_equal(tctx, result[0], "foo", "element 0");
        torture_assert_str_equal(tctx, result[1], "bar", "element 1");
        torture_assert_str_equal(tctx, result[2], NULL, "element 2");
 
-       result = str_list_copy(tctx, empty_list);
+       result = (const char **)str_list_copy(tctx, empty_list);
        torture_assert_int_equal(tctx, str_list_length(result), 0, "list length");
        torture_assert_str_equal(tctx, result[0], NULL, "element 0");
 
-       result = str_list_copy(tctx, null_list);
+       result = (const char **)str_list_copy(tctx, null_list);
        torture_assert(tctx, result == NULL, "result NULL");
        
        return true;
diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c
new file mode 100644 (file)
index 0000000..4a31566
--- /dev/null
@@ -0,0 +1,75 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   util time testing
+
+   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+
+static bool test_null_time(struct torture_context *tctx)
+{
+       torture_assert(tctx, null_time(0), "0");
+       torture_assert(tctx, null_time(0xFFFFFFFF), "0xFFFFFFFF");
+       torture_assert(tctx, null_time(-1), "-1");
+       torture_assert(tctx, !null_time(42), "42");
+       return true;
+}
+
+static bool test_null_nttime(struct torture_context *tctx)
+{
+       torture_assert(tctx, null_nttime(-1), "-1");
+       torture_assert(tctx, null_nttime(-1), "-1");
+       torture_assert(tctx, !null_nttime(42), "42");
+       return true;
+}
+
+
+static bool test_http_timestring(struct torture_context *tctx)
+{
+       const char *start = "Thu, 01 Jan 1970";
+       torture_assert(tctx, !strncmp(start, http_timestring(tctx, 42), 
+                                                                                strlen(start)), "42");
+       torture_assert_str_equal(tctx, "never", 
+                                                        http_timestring(tctx, get_time_t_max()), "42");
+       return true;
+}
+
+static bool test_timestring(struct torture_context *tctx)
+{
+       const char *start = "Thu Jan  1";
+       torture_assert(tctx, !strncmp(start, timestring(tctx, 42), strlen(start)),
+                                  "42");
+       return true;
+}
+
+
+
+struct torture_suite *torture_local_util_time(TALLOC_CTX *mem_ctx)
+{
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "TIME");
+
+       torture_suite_add_simple_test(suite, "null_time", test_null_time);
+       torture_suite_add_simple_test(suite, "null_nttime", test_null_nttime);
+       torture_suite_add_simple_test(suite, "http_timestring", 
+                                                                 test_http_timestring);
+       torture_suite_add_simple_test(suite, "timestring", 
+                                                                 test_timestring);
+
+       return suite;
+}
similarity index 86%
rename from source4/lib/util/time.c
rename to lib/util/time.c
index 978d73cc0a1731319ef61a96b239dcfcf678cc93..a001e5f66e0682c8caa93b2c95c65085b2222db7 100644 (file)
 #define TIME_T_MIN 0
 #endif
 
+#if (SIZEOF_LONG == 8)
+#define TIME_FIXUP_CONSTANT_INT 11644473600L
+#elif (SIZEOF_LONG_LONG == 8)
+#define TIME_FIXUP_CONSTANT_INT 11644473600LL
+#endif
+
+
+
 /*
  * we use the INT32_MAX here as on 64 bit systems,
  * gmtime() fails with INT64_MAX
@@ -64,27 +72,40 @@ _PUBLIC_ void GetTimeOfDay(struct timeval *tval)
 
 #define TIME_FIXUP_CONSTANT 11644473600LL
 
-/**
-interpret an 8 byte "filetime" structure to a time_t
-It's originally in "100ns units since jan 1st 1601"
-**/
-_PUBLIC_ time_t nt_time_to_unix(NTTIME nt)
+time_t convert_timespec_to_time_t(struct timespec ts)
 {
-       if (nt == 0) {
-               return 0;
-       }
-       if (nt == -1LL) {
-               return (time_t)-1;
+       /* 1 ns == 1,000,000,000 - one thousand millionths of a second.
+          increment if it's greater than 500 millionth of a second. */
+       if (ts.tv_nsec > 500000000) {
+               return ts.tv_sec + 1;
        }
-       nt += 1000*1000*10/2;
-       nt /= 1000*1000*10;
-       nt -= TIME_FIXUP_CONSTANT;
+       return ts.tv_sec;
+}
 
-       if (TIME_T_MIN > nt || nt > TIME_T_MAX) {
-               return 0;
-       }
+struct timespec convert_time_t_to_timespec(time_t t)
+{
+       struct timespec ts;
+       ts.tv_sec = t;
+       ts.tv_nsec = 0;
+       return ts;
+}
 
-       return (time_t)nt;
+
+
+/**
+ Interpret an 8 byte "filetime" structure to a time_t
+ It's originally in "100ns units since jan 1st 1601"
+
+ An 8 byte value of 0xffffffffffffffff will be returned as a timespec of
+
+       tv_sec = 0
+       tv_nsec = 0;
+
+ Returns GMT.
+**/
+time_t nt_time_to_unix(NTTIME nt)
+{
+       return convert_timespec_to_time_t(nt_time_to_unix_timespec(&nt));
 }
 
 
@@ -99,14 +120,20 @@ _PUBLIC_ void unix_to_nt_time(NTTIME *nt, time_t t)
        if (t == (time_t)-1) {
                *nt = (NTTIME)-1LL;
                return;
-       }               
+       }       
+
+       if (t == TIME_T_MAX) {
+               *nt = 0x7fffffffffffffffLL;
+               return;
+       }
+
        if (t == 0) {
                *nt = 0;
                return;
        }               
 
        t2 = t;
-       t2 += TIME_FIXUP_CONSTANT;
+       t2 += TIME_FIXUP_CONSTANT_INT;
        t2 *= 1000*1000*10;
 
        *nt = t2;
@@ -218,7 +245,7 @@ _PUBLIC_ void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_o
 /*******************************************************************
   interpret a 32 bit dos packed date/time to some parameters
 ********************************************************************/
-static void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second)
+void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second)
 {
        uint32_t p0,p1,p2,p3;
 
@@ -295,6 +322,10 @@ _PUBLIC_ char *http_timestring(TALLOC_CTX *mem_ctx, time_t t)
        char tempTime[60];
        struct tm *tm = localtime(&t);
 
+       if (t == TIME_T_MAX) {
+               return talloc_strdup(mem_ctx, "never");
+       }
+
        if (!tm) {
                return talloc_asprintf(mem_ctx,"%ld seconds since the Epoch",(long)t);
        }
@@ -613,6 +644,50 @@ _PUBLIC_ int get_time_zone(time_t t)
        return tm_diff(&tm_utc,tm);
 }
 
+struct timespec nt_time_to_unix_timespec(NTTIME *nt)
+{
+       int64_t d;
+       struct timespec ret;
+
+       if (*nt == 0 || *nt == (int64_t)-1) {
+               ret.tv_sec = 0;
+               ret.tv_nsec = 0;
+               return ret;
+       }
+
+       d = (int64_t)*nt;
+       /* d is now in 100ns units, since jan 1st 1601".
+          Save off the ns fraction. */
+
+       /*
+        * Take the last seven decimal digits and multiply by 100.
+        * to convert from 100ns units to 1ns units.
+        */
+        ret.tv_nsec = (long) ((d % (1000 * 1000 * 10)) * 100);
+
+       /* Convert to seconds */
+       d /= 1000*1000*10;
+
+       /* Now adjust by 369 years to make the secs since 1970 */
+       d -= TIME_FIXUP_CONSTANT_INT;
+
+       if (d <= (int64_t)TIME_T_MIN) {
+               ret.tv_sec = TIME_T_MIN;
+               ret.tv_nsec = 0;
+               return ret;
+       }
+
+       if (d >= (int64_t)TIME_T_MAX) {
+               ret.tv_sec = TIME_T_MAX;
+               ret.tv_nsec = 0;
+               return ret;
+       }
+
+       ret.tv_sec = (time_t)d;
+       return ret;
+}
+
+
 /**
   check if 2 NTTIMEs are equal.
 */
@@ -620,3 +695,16 @@ bool nt_time_equal(NTTIME *t1, NTTIME *t2)
 {
        return *t1 == *t2;
 }
+
+/**
+ Check if it's a null timespec.
+**/
+
+bool null_timespec(struct timespec ts)
+{
+       return ts.tv_sec == 0 || 
+               ts.tv_sec == (time_t)0xFFFFFFFF || 
+               ts.tv_sec == (time_t)-1;
+}
+
+
similarity index 97%
rename from source4/lib/util/time.h
rename to lib/util/time.h
index e4008c57824e0b94936adba4d76340e35b617de2..1a1fcc999c0fb816f696fbd696c31525aee25729 100644 (file)
@@ -229,4 +229,9 @@ _PUBLIC_ int get_time_zone(time_t t);
 */
 bool nt_time_equal(NTTIME *t1, NTTIME *t2);
 
+void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second);
+
+
+struct timespec nt_time_to_unix_timespec(NTTIME *nt);
+
 #endif /* _SAMBA_TIME_H_ */
similarity index 100%
rename from source4/lib/util/time.m4
rename to lib/util/time.m4
similarity index 81%
rename from source4/lib/util/util.c
rename to lib/util/util.c
index b5bb75358e107e18e22383eddcaff0217c86a16f..fc55629c4c1f1bfc4fd0d4908b36a52c06e8ade5 100644 (file)
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/locale.h"
+#undef malloc
+#undef strcasecmp
+#undef strdup
+#undef realloc
 
 /**
  * @file
@@ -216,113 +220,11 @@ _PUBLIC_ char *get_myname(void)
        return hostname;
 }
 
-/**
- Return true if a string could be a pure IP address.
-**/
-
-_PUBLIC_ bool is_ipaddress(const char *str)
-{
-       bool pure_address = true;
-       int i;
-
-       if (str == NULL) return false;
-
-       for (i=0; pure_address && str[i]; i++)
-               if (!(isdigit((int)str[i]) || str[i] == '.'))
-                       pure_address = false;
-
-       /* Check that a pure number is not misinterpreted as an IP */
-       pure_address = pure_address && (strchr(str, '.') != NULL);
-
-       return pure_address;
-}
-
-/**
- Interpret an internet address or name into an IP address in 4 byte form.
-**/
-_PUBLIC_ uint32_t interpret_addr(const char *str)
-{
-       struct hostent *hp;
-       uint32_t res;
-
-       if (str == NULL || *str == 0 ||
-           strcmp(str,"0.0.0.0") == 0) {
-               return 0;
-       }
-       if (strcmp(str,"255.255.255.255") == 0) {
-               return 0xFFFFFFFF;
-       }
-       /* recognise 'localhost' as a special name. This fixes problems with
-          some hosts that don't have localhost in /etc/hosts */
-       if (strcasecmp(str,"localhost") == 0) {
-               str = "127.0.0.1";
-       }
-
-       /* if it's in the form of an IP address then get the lib to interpret it */
-       if (is_ipaddress(str)) {
-               res = inet_addr(str);
-       } else {
-               /* otherwise assume it's a network name of some sort and use 
-                       sys_gethostbyname */
-               if ((hp = sys_gethostbyname(str)) == 0) {
-                       DEBUG(3,("sys_gethostbyname: Unknown host. %s\n",str));
-                       return 0;
-               }
-
-               if(hp->h_addr == NULL) {
-                       DEBUG(3,("sys_gethostbyname: host address is invalid for host %s\n",str));
-                       return 0;
-               }
-               memcpy((char *)&res,(char *)hp->h_addr, 4);
-       }
-
-       if (res == (uint32_t)-1)
-               return(0);
-
-       return(res);
-}
-
-/**
- A convenient addition to interpret_addr().
-**/
-_PUBLIC_ struct in_addr interpret_addr2(const char *str)
-{
-       struct in_addr ret;
-       uint32_t a = interpret_addr(str);
-       ret.s_addr = a;
-       return ret;
-}
-
-/**
- Check if an IP is the 0.0.0.0.
-**/
-
-_PUBLIC_ bool is_zero_ip(struct in_addr ip)
-{
-       return ip.s_addr == 0;
-}
-
-/**
- Are two IPs on the same subnet?
-**/
-
-_PUBLIC_ bool same_net(struct in_addr ip1, struct in_addr ip2, struct in_addr mask)
-{
-       uint32_t net1,net2,nmask;
-
-       nmask = ntohl(mask.s_addr);
-       net1  = ntohl(ip1.s_addr);
-       net2  = ntohl(ip2.s_addr);
-            
-       return((net1 & nmask) == (net2 & nmask));
-}
-
-
 /**
  Check if a process exists. Does this work on all unixes?
 **/
 
-_PUBLIC_ bool process_exists(pid_t pid)
+_PUBLIC_ bool process_exists_by_pid(pid_t pid)
 {
        /* Doing kill with a non-positive pid causes messages to be
         * sent to places we don't want. */
@@ -381,7 +283,7 @@ _PUBLIC_ bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type)
 }
 
 
-static void print_asc(int level, const uint8_t *buf,int len)
+void print_asc(int level, const uint8_t *buf,int len)
 {
        int i;
        for (i=0;i<len;i++)
@@ -509,14 +411,63 @@ _PUBLIC_ void *smb_xmemdup(const void *p, size_t size)
  strdup that aborts on malloc fail.
 **/
 
-_PUBLIC_ char *smb_xstrdup(const char *s)
+char *smb_xstrdup(const char *s)
 {
+#if defined(PARANOID_MALLOC_CHECKER)
+#ifdef strdup
+#undef strdup
+#endif
+#endif
+
+#ifndef HAVE_STRDUP
+#define strdup rep_strdup
+#endif
+
        char *s1 = strdup(s);
-       if (!s1)
-               smb_panic("smb_xstrdup: malloc fail\n");
+#if defined(PARANOID_MALLOC_CHECKER)
+#ifdef strdup
+#undef strdup
+#endif
+#define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY
+#endif
+       if (!s1) {
+               smb_panic("smb_xstrdup: malloc failed");
+       }
        return s1;
+
 }
 
+/**
+ strndup that aborts on malloc fail.
+**/
+
+char *smb_xstrndup(const char *s, size_t n)
+{
+#if defined(PARANOID_MALLOC_CHECKER)
+#ifdef strndup
+#undef strndup
+#endif
+#endif
+
+#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
+#undef HAVE_STRNDUP
+#define strndup rep_strndup
+#endif
+
+       char *s1 = strndup(s, n);
+#if defined(PARANOID_MALLOC_CHECKER)
+#ifdef strndup
+#undef strndup
+#endif
+#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
+#endif
+       if (!s1) {
+               smb_panic("smb_xstrndup: malloc failed");
+       }
+       return s1;
+}
+
+
 
 /**
  Like strdup but for memory.
@@ -569,11 +520,13 @@ _PUBLIC_ bool all_zero(const uint8_t *ptr, size_t size)
 /**
   realloc an array, checking for integer overflow in the array size
 */
-_PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count)
+_PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count, bool free_on_fail)
 {
 #define MAX_MALLOC_SIZE 0x7fffffff
        if (count == 0 ||
            count >= MAX_MALLOC_SIZE/el_size) {
+               if (free_on_fail)
+                       SAFE_FREE(ptr);
                return NULL;
        }
        if (!ptr) {
@@ -582,6 +535,15 @@ _PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count)
        return realloc(ptr, el_size * count);
 }
 
+/****************************************************************************
+ Type-safe malloc.
+****************************************************************************/
+
+void *malloc_array(size_t el_size, unsigned int count)
+{
+       return realloc_array(NULL, el_size, count, false);
+}
+
 _PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name)
 {
         void *result;
similarity index 88%
rename from source4/lib/util/util.h
rename to lib/util/util.h
index ffe83c14b297d9573fc669e9b03fcaa4321b82cf..4c9a2230937a0b0270c13e6d94d1e31eed57e867 100644 (file)
 #ifndef _SAMBA_UTIL_H_
 #define _SAMBA_UTIL_H_
 
-#include "util/attr.h"
-
-#include "charset/charset.h"
+#if _SAMBA_BUILD_ == 4
+#include "lib/charset/charset.h"
+#endif
+#include "../lib/util/attr.h"
 
 /* for TALLOC_CTX */
 #include <talloc.h>
@@ -38,12 +39,11 @@ struct smbsrv_tcon;
 extern const char *logfile;
 extern const char *panic_action;
 
-#include "util/time.h"
-#include "util/data_blob.h"
-#include "util/xfile.h"
-#include "util/debug.h"
-#include "util/mutex.h"
-#include "util/byteorder.h"
+#include "../lib/util/time.h"
+#include "../lib/util/data_blob.h"
+#include "../lib/util/xfile.h"
+#include "../lib/util/mutex.h"
+#include "../lib/util/byteorder.h"
 
 /**
   this is a warning hack. The idea is to use this everywhere that we
@@ -79,79 +79,11 @@ extern const char *panic_action;
        DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__)); \
        smb_panic("assert failed"); }} while (0)
 
-#ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */
-/**
- * Free memory if the pointer and zero the pointer.
- *
- * @note You are explicitly allowed to pass NULL pointers -- they will
- * always be ignored.
- **/
-#define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
-#endif
-
-/** 
- * Type-safe version of malloc. Allocated one copy of the 
- * specified data type.
- */
-#define malloc_p(type) (type *)malloc(sizeof(type))
-
-/**
- * Allocate an array of elements of one data type. Does type-checking.
- */
-#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
-
-/** 
- * Resize an array of elements of one data type. Does type-checking.
- */
-#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
-
 #if defined(VALGRIND)
 #define strlen(x) valgrind_strlen(x)
 #endif
 
-/** 
- * zero a structure 
- */
-#ifndef ZERO_STRUCT
-#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
-#endif
-
-/** 
- * zero a structure given a pointer to the structure 
- */
-#ifndef ZERO_STRUCTP
-#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
-#endif
-
-/** 
- * zero a structure given a pointer to the structure - no zero check 
- */
-#ifndef ZERO_STRUCTPN
-#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
-#endif
-
-/* zero an array - note that sizeof(array) must work - ie. it must not be a
-   pointer */
-#ifndef ZERO_ARRAY
-#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x))
-#endif
-
-/**
- * work out how many elements there are in a static array 
- */
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
-#endif
-
-/** 
- * pointer difference macro 
- */
-#ifndef PTR_DIFF
-#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
-#endif
-
-/* The following definitions come from lib/util/fault.c  */
-
+#include "../lib/util/memory.h"
 
 /**
  * Write backtrace to debug log
@@ -304,12 +236,12 @@ _PUBLIC_ char *safe_strcat(char *dest, const char *src, size_t maxlength);
 
 
 **/
-_PUBLIC_ size_t strhex_to_str(char *p, size_t len, const char *strhex);
+_PUBLIC_ size_t strhex_to_str(char *p, size_t p_len, const char *strhex, size_t strhex_len);
 
 /** 
  * Parse a hex string and return a data blob. 
  */
-_PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(const char *strhex) ;
+_PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex) ;
 
 /**
  * Routine to print a buffer as HEX digits, into an allocated string.
@@ -453,7 +385,7 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2);
   separator list. The separator list must contain characters less than
   or equal to 0x2f for this to work correctly on multi-byte strings
 */
-_PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
+_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
 
 /**
  * build a null terminated list of strings from an argv-like input string 
@@ -474,12 +406,12 @@ _PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char
 /**
   return the number of elements in a string list
 */
-_PUBLIC_ size_t str_list_length(const char **list);
+_PUBLIC_ size_t str_list_length(const char * const *list);
 
 /**
   copy a string list
 */
-_PUBLIC_ const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
+_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
 
 /**
    Return true if all the elements of the list match exactly.
@@ -524,12 +456,12 @@ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint);
 /**
 load a file into memory from a fd.
 **/
-_PUBLIC_ char *fd_load(int fd, size_t *size, TALLOC_CTX *mem_ctx);
+_PUBLIC_ char *fd_load(int fd, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx);
 
 /**
 load a file into memory
 **/
-_PUBLIC_ char *file_load(const char *fname, size_t *size, TALLOC_CTX *mem_ctx);
+_PUBLIC_ char *file_load(const char *fname, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx);
 
 /**
 mmap (if possible) or read a file
@@ -540,14 +472,14 @@ _PUBLIC_ void *map_file(const char *fname, size_t size);
 load a file into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). 
 **/
-_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
+_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
 
 /**
 load a fd into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). If convert is true calls unix_to_dos on
 the list.
 **/
-_PUBLIC_ char **fd_lines_load(int fd, int *numlines, TALLOC_CTX *mem_ctx);
+_PUBLIC_ char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
 
 /**
 take a list of lines and modify them to produce a list where \ continues
@@ -642,7 +574,7 @@ _PUBLIC_ bool same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask
 /**
  Check if a process exists. Does this work on all unixes?
 **/
-_PUBLIC_ bool process_exists(pid_t pid);
+_PUBLIC_ bool process_exists_by_pid(pid_t pid);
 
 /**
  Simple routine to do POSIX file locking. Cruft in NFS and 64->32 bit mapping
@@ -702,7 +634,7 @@ _PUBLIC_ bool all_zero(const uint8_t *ptr, size_t size);
 /**
   realloc an array, checking for integer overflow in the array size
 */
-_PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count);
+_PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count, bool free_on_fail);
 
 /* The following definitions come from lib/util/fsusage.c  */
 
similarity index 100%
rename from source4/lib/util/util.m4
rename to lib/util/util.m4
similarity index 85%
rename from source4/lib/util/util_file.c
rename to lib/util/util_file.c
index c3e22196c0cb69cc95fb6a1b86936e4042dc1d99..0275e78c54fc89f3a69d2539c82874ea1ce10878 100644 (file)
 #include "includes.h"
 #include "system/shmem.h"
 #include "system/filesys.h"
+#if _SAMBA_BUILD_ == 3
+#undef malloc
+#undef realloc
+#endif
 
 /**
  * @file
@@ -160,23 +164,30 @@ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint)
 /**
 load a file into memory from a fd.
 **/
-_PUBLIC_ char *fd_load(int fd, size_t *size, TALLOC_CTX *mem_ctx)
+_PUBLIC_ char *fd_load(int fd, size_t *psize, size_t maxsize, TALLOC_CTX *mem_ctx)
 {
        struct stat sbuf;
        char *p;
+       size_t size;
 
        if (fstat(fd, &sbuf) != 0) return NULL;
 
-       p = (char *)talloc_size(mem_ctx, sbuf.st_size+1);
+       size = sbuf.st_size;
+
+       if (maxsize) {
+               size = MIN(size, maxsize);
+       }
+
+       p = (char *)talloc_size(mem_ctx, size+1);
        if (!p) return NULL;
 
-       if (read(fd, p, sbuf.st_size) != sbuf.st_size) {
+       if (read(fd, p, size) != size) {
                talloc_free(p);
                return NULL;
        }
-       p[sbuf.st_size] = 0;
+       p[size] = 0;
 
-       if (size) *size = sbuf.st_size;
+       if (psize) *psize = size;
 
        return p;
 }
@@ -184,7 +195,7 @@ _PUBLIC_ char *fd_load(int fd, size_t *size, TALLOC_CTX *mem_ctx)
 /**
 load a file into memory
 **/
-_PUBLIC_ char *file_load(const char *fname, size_t *size, TALLOC_CTX *mem_ctx)
+_PUBLIC_ char *file_load(const char *fname, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx)
 {
        int fd;
        char *p;
@@ -194,7 +205,7 @@ _PUBLIC_ char *file_load(const char *fname, size_t *size, TALLOC_CTX *mem_ctx)
        fd = open(fname,O_RDONLY);
        if (fd == -1) return NULL;
 
-       p = fd_load(fd, size, mem_ctx);
+       p = fd_load(fd, size, maxsize, mem_ctx);
 
        close(fd);
 
@@ -224,7 +235,7 @@ _PUBLIC_ void *map_file(const char *fname, size_t size)
        }
 #endif
        if (!p) {
-               p = file_load(fname, &s2, talloc_autofree_context());
+               p = file_load(fname, &s2, 0, talloc_autofree_context());
                if (!p) return NULL;
                if (s2 != size) {
                        DEBUG(1,("incorrect size for %s - got %d expected %d\n",
@@ -237,12 +248,31 @@ _PUBLIC_ void *map_file(const char *fname, size_t size)
        return p;
 }
 
+/**
+ unmap or free memory
+**/
+
+bool unmap_file(void *start, size_t size)
+{
+#ifdef HAVE_MMAP
+       if (munmap( start, size ) != 0) {
+               DEBUG( 1, ("map_file: Failed to unmap address %p "
+                       "of size %u - %s\n", 
+                       start, (unsigned int)size, strerror(errno) ));
+               return false;
+       }
+       return true;
+#else
+       talloc_free(start);
+       return true;
+#endif
+}
 
 /**
 parse a buffer into lines
 'p' will be freed on error, and otherwise will be made a child of the returned array
 **/
-static char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *mem_ctx)
+char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *mem_ctx)
 {
        int i;
        char *s, **ret;
@@ -288,12 +318,12 @@ static char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *
 load a file into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). 
 **/
-_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx)
+_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx)
 {
        char *p;
        size_t size;
 
-       p = file_load(fname, &size, mem_ctx);
+       p = file_load(fname, &size, maxsize, mem_ctx);
        if (!p) return NULL;
 
        return file_lines_parse(p, size, numlines, mem_ctx);
@@ -304,12 +334,12 @@ load a fd into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). If convert is true calls unix_to_dos on
 the list.
 **/
-_PUBLIC_ char **fd_lines_load(int fd, int *numlines, TALLOC_CTX *mem_ctx)
+_PUBLIC_ char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx)
 {
        char *p;
        size_t size;
 
-       p = fd_load(fd, &size, mem_ctx);
+       p = fd_load(fd, &size, maxsize, mem_ctx);
        if (!p) return NULL;
 
        return file_lines_parse(p, size, numlines, mem_ctx);
@@ -402,3 +432,5 @@ _PUBLIC_ bool large_file_support(const char *path)
        close(fd);
        return ret == 0;
 }
+
+
similarity index 98%
rename from source4/lib/util/util_ldb.c
rename to lib/util/util_ldb.c
index 0465022edd6e7c6b4e4747227bf56a356b7835a4..70b18478c65db84f5ddc9d13359c855816189f54 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/events/events.h"
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
-#include "lib/util/util_ldb.h"
+#include "../lib/util/util_ldb.h"
 /*
   search the sam for the specified attributes - va_list variant
 */