[SCM] Samba Shared Repository - branch master updated - f01500e18da2df4a4414e97da8e2cdc3ee8a6e1e

Jelmer Vernooij jelmer at samba.org
Sat Oct 11 19:43:14 GMT 2008


The branch, master has been updated
       via  f01500e18da2df4a4414e97da8e2cdc3ee8a6e1e (commit)
       via  2911b792ca979dd9c9715e55f92097791b4ce837 (commit)
       via  5c44ed69548c4a4d753b54f72dc41212e2c7b612 (commit)
       via  a19719ccea2d63d42a35d30f91fe112d2a3db8c7 (commit)
       via  956599975573044f5f930ef23ce54c11db156ebe (commit)
       via  caa4e428604780bb098060f7286c69d30c8b4007 (commit)
       via  4604ca430294d8d9a522dd29705e7a7a1c969304 (commit)
      from  621cf3c9bf161e686935f57393ab184d298d72de (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f01500e18da2df4a4414e97da8e2cdc3ee8a6e1e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 21:42:45 2008 +0200

    Fix merged build locations.

commit 2911b792ca979dd9c9715e55f92097791b4ce837
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 21:33:55 2008 +0200

    Fix include, clean up .o files in ../lib and ../libcli
    
    Conflicts:
    
    	source4/Makefile

commit 5c44ed69548c4a4d753b54f72dc41212e2c7b612
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Sep 24 14:49:12 2008 +0200

    Clean up properly.

commit a19719ccea2d63d42a35d30f91fe112d2a3db8c7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 16:31:39 2008 +0200

    Fix libutil path.

commit 956599975573044f5f930ef23ce54c11db156ebe
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 21:31:42 2008 +0200

    Fix include paths to new location of libutil.

commit caa4e428604780bb098060f7286c69d30c8b4007
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 21:05:38 2008 +0200

    Move lib/util from source4 to top-level libutil.
    
    Conflicts:
    
    	source4/Makefile

commit 4604ca430294d8d9a522dd29705e7a7a1c969304
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Oct 11 19:44:10 2008 +0200

    Provide malloc_array() in Samba 4.

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                    |   10 +-
 lib/util/Doxyfile                             |   24 +
 lib/util/asn1.c                               |  770 +++++++++++++++++++++++
 lib/util/asn1.h                               |   54 ++
 lib/util/attr.h                               |   90 +++
 lib/util/become_daemon.c                      |   93 +++
 lib/util/byteorder.h                          |  231 +++++++
 lib/util/capability.c                         |  103 ++++
 lib/util/capability.m4                        |   17 +
 lib/util/config.mk                            |   71 +++
 lib/util/data_blob.c                          |  232 +++++++
 lib/util/data_blob.h                          |  123 ++++
 lib/util/debug.c                              |  248 ++++++++
 lib/util/debug.h                              |  129 ++++
 lib/util/dlinklist.h                          |  113 ++++
 lib/util/dprintf.c                            |  111 ++++
 lib/util/fault.c                              |  226 +++++++
 lib/util/fault.m4                             |    5 +
 lib/util/fsusage.c                            |  154 +++++
 lib/util/fsusage.m4                           |  190 ++++++
 lib/util/genrand.c                            |  361 +++++++++++
 lib/util/idtree.c                             |  403 ++++++++++++
 lib/util/mainpage.dox                         |   11 +
 lib/util/ms_fnmatch.c                         |  223 +++++++
 lib/util/mutex.c                              |   56 ++
 lib/util/mutex.h                              |   75 +++
 lib/util/params.c                             |  587 ++++++++++++++++++
 lib/util/safe_string.h                        |   44 ++
 lib/util/signal.c                             |  144 +++++
 lib/util/signal.m4                            |    1 +
 lib/util/system.c                             |   90 +++
 lib/util/tests/file.c                         |   97 +++
 lib/util/tests/genrand.c                      |   65 ++
 lib/util/tests/idtree.c                       |  121 ++++
 lib/util/tests/str.c                          |  121 ++++
 lib/util/tests/strlist.c                      |  103 ++++
 lib/util/time.c                               |  622 +++++++++++++++++++
 lib/util/time.h                               |  232 +++++++
 lib/util/time.m4                              |    9 +
 lib/util/unix_privs.c                         |   77 +++
 lib/util/util.c                               |  608 ++++++++++++++++++
 lib/util/util.h                               |  812 ++++++++++++++++++++++++
 lib/util/util.m4                              |    1 +
 lib/util/util_file.c                          |  404 ++++++++++++
 lib/util/util_getent.c                        |  283 +++++++++
 lib/util/util_ldb.c                           |  134 ++++
 lib/util/util_ldb.h                           |   27 +
 lib/util/util_pw.c                            |   77 +++
 lib/util/util_str.c                           |  790 ++++++++++++++++++++++++
 lib/util/util_strlist.c                       |  308 ++++++++++
 lib/util/util_tdb.c                           |  546 +++++++++++++++++
 lib/util/wrap_xattr.c                         |  120 ++++
 lib/util/wrap_xattr.h                         |   12 +
 lib/util/xattr.m4                             |   32 +
 lib/util/xfile.c                              |  389 ++++++++++++
 lib/util/xfile.h                              |   99 +++
 libcli/nbt/nbtsocket.c                        |    2 +-
 source3/Makefile.in                           |    4 +-
 source3/samba4.m4                             |   14 +-
 source3/samba4.mk                             |    2 +-
 source4/Makefile                              |    6 +-
 source4/auth/credentials/credentials.h        |    2 +-
 source4/auth/credentials/credentials_files.c  |    2 +-
 source4/auth/gensec/schannel_state.c          |    2 +-
 source4/auth/gensec/spnego_parse.c            |    2 +-
 source4/auth/kerberos/gssapi_parse.c          |    2 +-
 source4/auth/ntlm/auth.c                      |    2 +-
 source4/auth/ntlm/auth_sam.c                  |    2 +-
 source4/auth/sam.c                            |    2 +-
 source4/client/client.c                       |    2 +-
 source4/cluster/ctdb/client/ctdb_client.c     |    4 +-
 source4/cluster/ctdb/common/ctdb_io.c         |    2 +-
 source4/cluster/ctdb/common/ctdb_ltdb.c       |    2 +-
 source4/cluster/ctdb/common/ctdb_message.c    |    2 +-
 source4/cluster/ctdb/ctdb_cluster.c           |    2 +-
 source4/configure.ac                          |   14 +-
 source4/dsdb/common/sidmap.c                  |    2 +-
 source4/dsdb/common/util.c                    |    2 +-
 source4/dsdb/repl/drepl_out_helpers.c         |    2 +-
 source4/dsdb/repl/drepl_out_pull.c            |    2 +-
 source4/dsdb/repl/drepl_partitions.c          |    2 +-
 source4/dsdb/repl/drepl_periodic.c            |    2 +-
 source4/dsdb/repl/drepl_service.c             |    2 +-
 source4/dsdb/repl/replicated_objects.c        |    2 +-
 source4/dsdb/samdb/cracknames.c               |    2 +-
 source4/dsdb/samdb/ldb_modules/naming_fsmo.c  |    2 +-
 source4/dsdb/samdb/ldb_modules/objectclass.c  |    2 +-
 source4/dsdb/samdb/ldb_modules/pdc_fsmo.c     |    2 +-
 source4/dsdb/samdb/ldb_modules/samldb.c       |    2 +-
 source4/dsdb/samdb/ldb_modules/schema_fsmo.c  |    2 +-
 source4/dsdb/samdb/samdb.c                    |    2 +-
 source4/dsdb/samdb/samdb_privilege.c          |    2 +-
 source4/dsdb/schema/schema_init.c             |    2 +-
 source4/dsdb/schema/schema_set.c              |    2 +-
 source4/include/includes.h                    |    5 +-
 source4/kdc/hdb-samba4.c                      |    2 +-
 source4/kdc/kdc.c                             |    2 +-
 source4/kdc/kpasswdd.c                        |    2 +-
 source4/ldap_server/ldap_backend.c            |    2 +-
 source4/ldap_server/ldap_extended.c           |    2 +-
 source4/ldap_server/ldap_server.c             |    4 +-
 source4/lib/charset/iconv.c                   |    2 +-
 source4/lib/com/main.c                        |    2 +-
 source4/lib/com/tables.c                      |    2 +-
 source4/lib/messaging/messaging.c             |    6 +-
 source4/lib/registry/interface.c              |    2 +-
 source4/lib/registry/local.c                  |    2 +-
 source4/lib/registry/registry.h               |    4 +-
 source4/lib/socket/interface.c                |    2 +-
 source4/lib/stream/packet.c                   |    2 +-
 source4/lib/tdb_wrap.c                        |    2 +-
 source4/lib/torture/torture.c                 |    2 +-
 source4/lib/util/Doxyfile                     |   24 -
 source4/lib/util/asn1.c                       |  770 -----------------------
 source4/lib/util/asn1.h                       |   54 --
 source4/lib/util/attr.h                       |   90 ---
 source4/lib/util/become_daemon.c              |   93 ---
 source4/lib/util/byteorder.h                  |  231 -------
 source4/lib/util/capability.c                 |  103 ----
 source4/lib/util/capability.m4                |   17 -
 source4/lib/util/config.mk                    |   71 ---
 source4/lib/util/data_blob.c                  |  232 -------
 source4/lib/util/data_blob.h                  |  123 ----
 source4/lib/util/debug.c                      |  248 --------
 source4/lib/util/debug.h                      |  129 ----
 source4/lib/util/dlinklist.h                  |  113 ----
 source4/lib/util/dprintf.c                    |  111 ----
 source4/lib/util/fault.c                      |  226 -------
 source4/lib/util/fault.m4                     |    5 -
 source4/lib/util/fsusage.c                    |  154 -----
 source4/lib/util/fsusage.m4                   |  190 ------
 source4/lib/util/genrand.c                    |  361 -----------
 source4/lib/util/idtree.c                     |  403 ------------
 source4/lib/util/mainpage.dox                 |   11 -
 source4/lib/util/ms_fnmatch.c                 |  223 -------
 source4/lib/util/mutex.c                      |   56 --
 source4/lib/util/mutex.h                      |   75 ---
 source4/lib/util/params.c                     |  587 ------------------
 source4/lib/util/safe_string.h                |   44 --
 source4/lib/util/signal.c                     |  144 -----
 source4/lib/util/signal.m4                    |    1 -
 source4/lib/util/system.c                     |   90 ---
 source4/lib/util/tests/file.c                 |   97 ---
 source4/lib/util/tests/genrand.c              |   65 --
 source4/lib/util/tests/idtree.c               |  121 ----
 source4/lib/util/tests/str.c                  |  121 ----
 source4/lib/util/tests/strlist.c              |  103 ----
 source4/lib/util/time.c                       |  622 -------------------
 source4/lib/util/time.h                       |  232 -------
 source4/lib/util/time.m4                      |    9 -
 source4/lib/util/unix_privs.c                 |   77 ---
 source4/lib/util/util.c                       |  599 ------------------
 source4/lib/util/util.h                       |  813 -------------------------
 source4/lib/util/util.m4                      |    1 -
 source4/lib/util/util_file.c                  |  404 ------------
 source4/lib/util/util_getent.c                |  283 ---------
 source4/lib/util/util_ldb.c                   |  134 ----
 source4/lib/util/util_ldb.h                   |   27 -
 source4/lib/util/util_pw.c                    |   77 ---
 source4/lib/util/util_str.c                   |  790 ------------------------
 source4/lib/util/util_strlist.c               |  308 ----------
 source4/lib/util/util_tdb.c                   |  546 -----------------
 source4/lib/util/wrap_xattr.c                 |  120 ----
 source4/lib/util/wrap_xattr.h                 |   12 -
 source4/lib/util/xattr.m4                     |   32 -
 source4/lib/util/xfile.c                      |  389 ------------
 source4/lib/util/xfile.h                      |   99 ---
 source4/libcli/cldap/cldap.c                  |    2 +-
 source4/libcli/cldap/cldap.h                  |    2 +-
 source4/libcli/dgram/dgramsocket.c            |    2 +-
 source4/libcli/dgram/mailslot.c               |    2 +-
 source4/libcli/ldap/ldap.c                    |    2 +-
 source4/libcli/ldap/ldap_client.c             |    4 +-
 source4/libcli/ldap/ldap_controls.c           |    2 +-
 source4/libcli/raw/clitransport.c             |    2 +-
 source4/libcli/raw/rawnotify.c                |    2 +-
 source4/libcli/raw/rawrequest.c               |    2 +-
 source4/libcli/raw/rawtrans.c                 |    2 +-
 source4/libcli/resolve/resolve.c              |    2 +-
 source4/libcli/smb2/request.c                 |    2 +-
 source4/libcli/smb2/transport.c               |    2 +-
 source4/libcli/wrepl/winsrepl.c               |    2 +-
 source4/libnet/libnet_join.c                  |    2 +-
 source4/libnet/libnet_samdump.c               |    2 +-
 source4/libnet/libnet_samsync_ldb.c           |    2 +-
 source4/libnet/libnet_vampire.c               |    2 +-
 source4/librpc/ndr/libndr.h                   |    2 +-
 source4/librpc/ndr/ndr.c                      |    2 +-
 source4/librpc/ndr/ndr_drsuapi.c              |    2 +-
 source4/librpc/ndr/ndr_table.c                |    2 +-
 source4/librpc/rpc/dcerpc.c                   |    2 +-
 source4/librpc/rpc/dcerpc.h                   |    2 +-
 source4/main.mk                               |    2 +-
 source4/nbt_server/defense.c                  |    2 +-
 source4/nbt_server/dgram/netlogon.c           |    2 +-
 source4/nbt_server/interfaces.c               |    2 +-
 source4/nbt_server/nodestatus.c               |    2 +-
 source4/nbt_server/query.c                    |    2 +-
 source4/nbt_server/register.c                 |    2 +-
 source4/ntptr/simple_ldb/ntptr_simple_ldb.c   |    2 +-
 source4/ntvfs/cifs/vfs_cifs.c                 |    2 +-
 source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c |    2 +-
 source4/ntvfs/common/notify.c                 |    4 +-
 source4/ntvfs/ipc/vfs_ipc.c                   |    2 +-
 source4/ntvfs/ntvfs_base.c                    |    2 +-
 source4/ntvfs/ntvfs_util.c                    |    2 +-
 source4/ntvfs/posix/pvfs_acl_nfs4.c           |    2 +-
 source4/ntvfs/posix/pvfs_acl_xattr.c          |    2 +-
 source4/ntvfs/posix/pvfs_lock.c               |    2 +-
 source4/ntvfs/posix/pvfs_notify.c             |    2 +-
 source4/ntvfs/posix/pvfs_open.c               |    2 +-
 source4/ntvfs/posix/pvfs_search.c             |    2 +-
 source4/ntvfs/posix/pvfs_wait.c               |    2 +-
 source4/ntvfs/posix/pvfs_xattr.c              |    2 +-
 source4/ntvfs/posix/vfs_posix.c               |    2 +-
 source4/ntvfs/posix/xattr_system.c            |    2 +-
 source4/ntvfs/simple/vfs_simple.c             |    2 +-
 source4/ntvfs/smb2/vfs_smb2.c                 |    2 +-
 source4/ntvfs/sysdep/inotify.c                |    2 +-
 source4/ntvfs/sysdep/sys_lease.c              |    2 +-
 source4/ntvfs/sysdep/sys_notify.c             |    2 +-
 source4/param/generic.c                       |    2 +-
 source4/param/loadparm.c                      |    2 +-
 source4/param/secrets.c                       |    4 +-
 source4/rpc_server/dcerpc_server.c            |    2 +-
 source4/rpc_server/handles.c                  |    2 +-
 source4/rpc_server/lsa/dcesrv_lsa.c           |    2 +-
 source4/rpc_server/lsa/lsa.h                  |    2 +-
 source4/rpc_server/netlogon/dcerpc_netlogon.c |    2 +-
 source4/rpc_server/samr/dcesrv_samr.c         |    2 +-
 source4/rpc_server/samr/samr_password.c       |    2 +-
 source4/rpc_server/service_rpc.c              |    2 +-
 source4/smb_server/blob.c                     |    2 +-
 source4/smb_server/handle.c                   |    2 +-
 source4/smb_server/session.c                  |    2 +-
 source4/smb_server/smb/trans2.c               |    2 +-
 source4/smb_server/smb_server.h               |    2 +-
 source4/smb_server/tcon.c                     |    2 +-
 source4/smbd/service.c                        |    2 +-
 source4/torture/basic/aliases.c               |    2 +-
 source4/torture/basic/mangle_test.c           |    2 +-
 source4/torture/ldap/schema.c                 |    2 +-
 source4/torture/ldap/uptodatevector.c         |    2 +-
 source4/torture/libnet/libnet_BecomeDC.c      |    2 +-
 source4/torture/local/config.mk               |   10 +-
 source4/torture/nbench/nbio.c                 |    2 +-
 source4/torture/ndr/ndr.c                     |    2 +-
 source4/torture/rpc/rpc.c                     |    2 +-
 source4/torture/rpc/samsync.c                 |    2 +-
 source4/torture/rpc/spoolss_notify.c          |    2 +-
 source4/torture/smb2/smb2.c                   |    2 +-
 source4/torture/smbtorture.c                  |    2 +-
 source4/torture/torture.c                     |    2 +-
 source4/torture/util_smb.c                    |    2 +-
 source4/utils/getntacl.c                      |    2 +-
 source4/web_server/web_server.c               |    2 +-
 source4/web_server/wsgi.c                     |    4 +-
 source4/winbind/wb_server.c                   |    2 +-
 source4/winbind/wb_sid2domain.c               |    2 +-
 source4/wrepl_server/wrepl_server.c           |    2 +-
 260 files changed, 11253 insertions(+), 11242 deletions(-)
 create mode 100644 lib/util/Doxyfile
 create mode 100644 lib/util/asn1.c
 create mode 100644 lib/util/asn1.h
 create mode 100644 lib/util/attr.h
 create mode 100644 lib/util/become_daemon.c
 create mode 100644 lib/util/byteorder.h
 create mode 100644 lib/util/capability.c
 create mode 100644 lib/util/capability.m4
 create mode 100644 lib/util/config.mk
 create mode 100644 lib/util/data_blob.c
 create mode 100644 lib/util/data_blob.h
 create mode 100644 lib/util/debug.c
 create mode 100644 lib/util/debug.h
 create mode 100644 lib/util/dlinklist.h
 create mode 100644 lib/util/dprintf.c
 create mode 100644 lib/util/fault.c
 create mode 100644 lib/util/fault.m4
 create mode 100644 lib/util/fsusage.c
 create mode 100644 lib/util/fsusage.m4
 create mode 100644 lib/util/genrand.c
 create mode 100644 lib/util/idtree.c
 create mode 100644 lib/util/mainpage.dox
 create mode 100644 lib/util/ms_fnmatch.c
 create mode 100644 lib/util/mutex.c
 create mode 100644 lib/util/mutex.h
 create mode 100644 lib/util/params.c
 create mode 100644 lib/util/safe_string.h
 create mode 100644 lib/util/signal.c
 create mode 100644 lib/util/signal.m4
 create mode 100644 lib/util/system.c
 create mode 100644 lib/util/tests/file.c
 create mode 100644 lib/util/tests/genrand.c
 create mode 100644 lib/util/tests/idtree.c
 create mode 100644 lib/util/tests/str.c
 create mode 100644 lib/util/tests/strlist.c
 create mode 100644 lib/util/time.c
 create mode 100644 lib/util/time.h
 create mode 100644 lib/util/time.m4
 create mode 100644 lib/util/unix_privs.c
 create mode 100644 lib/util/util.c
 create mode 100644 lib/util/util.h
 create mode 100644 lib/util/util.m4
 create mode 100644 lib/util/util_file.c
 create mode 100644 lib/util/util_getent.c
 create mode 100644 lib/util/util_ldb.c
 create mode 100644 lib/util/util_ldb.h
 create mode 100644 lib/util/util_pw.c
 create mode 100644 lib/util/util_str.c
 create mode 100644 lib/util/util_strlist.c
 create mode 100644 lib/util/util_tdb.c
 create mode 100644 lib/util/wrap_xattr.c
 create mode 100644 lib/util/wrap_xattr.h
 create mode 100644 lib/util/xattr.m4
 create mode 100644 lib/util/xfile.c
 create mode 100644 lib/util/xfile.h
 delete mode 100644 source4/lib/util/Doxyfile
 delete mode 100644 source4/lib/util/asn1.c
 delete mode 100644 source4/lib/util/asn1.h
 delete mode 100644 source4/lib/util/attr.h
 delete mode 100644 source4/lib/util/become_daemon.c
 delete mode 100644 source4/lib/util/byteorder.h
 delete mode 100644 source4/lib/util/capability.c
 delete mode 100644 source4/lib/util/capability.m4
 delete mode 100644 source4/lib/util/config.mk
 delete mode 100644 source4/lib/util/data_blob.c
 delete mode 100644 source4/lib/util/data_blob.h
 delete mode 100644 source4/lib/util/debug.c
 delete mode 100644 source4/lib/util/debug.h
 delete mode 100644 source4/lib/util/dlinklist.h
 delete mode 100644 source4/lib/util/dprintf.c
 delete mode 100644 source4/lib/util/fault.c
 delete mode 100644 source4/lib/util/fault.m4
 delete mode 100644 source4/lib/util/fsusage.c
 delete mode 100644 source4/lib/util/fsusage.m4
 delete mode 100644 source4/lib/util/genrand.c
 delete mode 100644 source4/lib/util/idtree.c
 delete mode 100644 source4/lib/util/mainpage.dox
 delete mode 100644 source4/lib/util/ms_fnmatch.c
 delete mode 100644 source4/lib/util/mutex.c
 delete mode 100644 source4/lib/util/mutex.h
 delete mode 100644 source4/lib/util/params.c
 delete mode 100644 source4/lib/util/safe_string.h
 delete mode 100644 source4/lib/util/signal.c
 delete mode 100644 source4/lib/util/signal.m4
 delete mode 100644 source4/lib/util/system.c
 delete mode 100644 source4/lib/util/tests/file.c
 delete mode 100644 source4/lib/util/tests/genrand.c
 delete mode 100644 source4/lib/util/tests/idtree.c
 delete mode 100644 source4/lib/util/tests/str.c
 delete mode 100644 source4/lib/util/tests/strlist.c
 delete mode 100644 source4/lib/util/time.c
 delete mode 100644 source4/lib/util/time.h
 delete mode 100644 source4/lib/util/time.m4
 delete mode 100644 source4/lib/util/unix_privs.c
 delete mode 100644 source4/lib/util/util.c
 delete mode 100644 source4/lib/util/util.h
 delete mode 100644 source4/lib/util/util.m4
 delete mode 100644 source4/lib/util/util_file.c
 delete mode 100644 source4/lib/util/util_getent.c
 delete mode 100644 source4/lib/util/util_ldb.c
 delete mode 100644 source4/lib/util/util_ldb.h
 delete mode 100644 source4/lib/util/util_pw.c
 delete mode 100644 source4/lib/util/util_str.c
 delete mode 100644 source4/lib/util/util_strlist.c
 delete mode 100644 source4/lib/util/util_tdb.c
 delete mode 100644 source4/lib/util/wrap_xattr.c
 delete mode 100644 source4/lib/util/wrap_xattr.h
 delete mode 100644 source4/lib/util/xattr.m4
 delete mode 100644 source4/lib/util/xfile.c
 delete mode 100644 source4/lib/util/xfile.h


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index e585504..fa4fc5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -231,11 +231,11 @@ 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/asn1_proto.h
+lib/util/pidfile.h
+lib/util/unix_privs.h
+lib/util/util_proto.h
+lib/util/util_tdb.h
 source4/mkconfig.mk
 source4/nbt_server/dgram/proto.h
 source4/nbt_server/nbt_server_proto.h
diff --git a/lib/util/Doxyfile b/lib/util/Doxyfile
new file mode 100644
index 0000000..02e36a7
--- /dev/null
+++ b/lib/util/Doxyfile
@@ -0,0 +1,24 @@
+PROJECT_NAME           = SAMBA_UTIL
+OUTPUT_DIRECTORY       = apidocs
+BRIEF_MEMBER_DESC	   = YES
+REPEAT_BRIEF           = YES
+OPTIMIZE_OUTPUT_FOR_C  = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+GENERATE_TODOLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+SHOW_USED_FILES        = NO
+SHOW_DIRECTORIES       = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+INPUT                  = .
+FILE_PATTERNS          = *.c *.h *.dox
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+GENERATE_MAN           = YES
+ALWAYS_DETAILED_SEC	   = YES
+JAVADOC_AUTOBRIEF	   = YES
diff --git a/lib/util/asn1.c b/lib/util/asn1.c
new file mode 100644
index 0000000..ef34654
--- /dev/null
+++ b/lib/util/asn1.c
@@ -0,0 +1,770 @@
+/* 
+   Unix SMB/CIFS implementation.
+   simple ASN1 routines
+   Copyright (C) Andrew Tridgell 2001
+   
+   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 "../lib/util/asn1.h"
+
+/* allocate an asn1 structure */
+struct asn1_data *asn1_init(TALLOC_CTX *mem_ctx)
+{
+	struct asn1_data *ret = talloc_zero(mem_ctx, struct asn1_data);
+	if (ret == NULL) {
+		DEBUG(0,("asn1_init failed! out of memory\n"));
+	}
+	return ret;
+}
+
+/* free an asn1 structure */
+void asn1_free(struct asn1_data *data)
+{
+	talloc_free(data);
+}
+
+/* write to the ASN1 buffer, advancing the buffer pointer */
+bool asn1_write(struct asn1_data *data, const void *p, int len)
+{
+	if (data->has_error) return false;
+	if (data->length < data->ofs+len) {
+		uint8_t *newp;
+		newp = talloc_realloc(data, data->data, uint8_t, data->ofs+len);
+		if (!newp) {
+			asn1_free(data);
+			data->has_error = true;
+			return false;
+		}
+		data->data = newp;
+		data->length = data->ofs+len;
+	}
+	memcpy(data->data + data->ofs, p, len);
+	data->ofs += len;
+	return true;
+}
+
+/* useful fn for writing a uint8_t */
+bool asn1_write_uint8(struct asn1_data *data, uint8_t v)
+{
+	return asn1_write(data, &v, 1);
+}
+
+/* push a tag onto the asn1 data buffer. Used for nested structures */
+bool asn1_push_tag(struct asn1_data *data, uint8_t tag)
+{
+	struct nesting *nesting;
+
+	asn1_write_uint8(data, tag);
+	nesting = talloc(data, struct nesting);
+	if (!nesting) {
+		data->has_error = true;
+		return false;
+	}
+
+	nesting->start = data->ofs;
+	nesting->next = data->nesting;
+	data->nesting = nesting;
+	return asn1_write_uint8(data, 0xff);
+}
+
+/* pop a tag */
+bool asn1_pop_tag(struct asn1_data *data)
+{
+	struct nesting *nesting;
+	size_t len;
+
+	nesting = data->nesting;
+
+	if (!nesting) {
+		data->has_error = true;
+		return false;
+	}
+	len = data->ofs - (nesting->start+1);
+	/* yes, this is ugly. We don't know in advance how many bytes the length
+	   of a tag will take, so we assumed 1 byte. If we were wrong then we 
+	   need to correct our mistake */
+	if (len > 0xFFFFFF) {
+		data->data[nesting->start] = 0x84;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		memmove(data->data+nesting->start+5, data->data+nesting->start+1, len);
+		data->data[nesting->start+1] = (len>>24) & 0xFF;
+		data->data[nesting->start+2] = (len>>16) & 0xFF;
+		data->data[nesting->start+3] = (len>>8) & 0xFF;
+		data->data[nesting->start+4] = len&0xff;
+	} else if (len > 0xFFFF) {
+		data->data[nesting->start] = 0x83;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		memmove(data->data+nesting->start+4, data->data+nesting->start+1, len);
+		data->data[nesting->start+1] = (len>>16) & 0xFF;
+		data->data[nesting->start+2] = (len>>8) & 0xFF;
+		data->data[nesting->start+3] = len&0xff;
+	} else if (len > 255) {
+		data->data[nesting->start] = 0x82;
+		if (!asn1_write_uint8(data, 0)) return false;
+		if (!asn1_write_uint8(data, 0)) return false;
+		memmove(data->data+nesting->start+3, data->data+nesting->start+1, len);
+		data->data[nesting->start+1] = len>>8;
+		data->data[nesting->start+2] = len&0xff;
+	} else if (len > 127) {
+		data->data[nesting->start] = 0x81;
+		if (!asn1_write_uint8(data, 0)) return false;
+		memmove(data->data+nesting->start+2, data->data+nesting->start+1, len);
+		data->data[nesting->start+1] = len;
+	} else {
+		data->data[nesting->start] = len;
+	}
+
+	data->nesting = nesting->next;
+	talloc_free(nesting);
+	return true;
+}
+
+/* "i" is the one's complement representation, as is the normal result of an
+ * implicit signed->unsigned conversion */
+
+static bool push_int_bigendian(struct asn1_data *data, unsigned int i, bool negative)
+{
+	uint8_t lowest = i & 0xFF;
+
+	i = i >> 8;
+	if (i != 0)
+		if (!push_int_bigendian(data, i, negative))
+			return false;
+
+	if (data->nesting->start+1 == data->ofs) {
+
+		/* We did not write anything yet, looking at the highest
+		 * valued byte */
+
+		if (negative) {
+			/* Don't write leading 0xff's */
+			if (lowest == 0xFF)
+				return true;
+
+			if ((lowest & 0x80) == 0) {
+				/* The only exception for a leading 0xff is if
+				 * the highest bit is 0, which would indicate
+				 * a positive value */
+				if (!asn1_write_uint8(data, 0xff))
+					return false;
+			}
+		} else {
+			if (lowest & 0x80) {
+				/* The highest bit of a positive integer is 1,
+				 * this would indicate a negative number. Push
+				 * a 0 to indicate a positive one */
+				if (!asn1_write_uint8(data, 0))
+					return false;
+			}
+		}
+	}
+
+	return asn1_write_uint8(data, lowest);
+}
+
+/* write an Integer without the tag framing. Needed for example for the LDAP
+ * Abandon Operation */
+
+bool asn1_write_implicit_Integer(struct asn1_data *data, int i)
+{
+	if (i == -1) {
+		/* -1 is special as it consists of all-0xff bytes. In
+                    push_int_bigendian this is the only case that is not
+                    properly handled, as all 0xff bytes would be handled as
+                    leading ones to be ignored. */
+		return asn1_write_uint8(data, 0xff);
+	} else {
+		return push_int_bigendian(data, i, i<0);
+	}
+}
+
+
+/* write an integer */
+bool asn1_write_Integer(struct asn1_data *data, int i)
+{
+	if (!asn1_push_tag(data, ASN1_INTEGER)) return false;
+	if (!asn1_write_implicit_Integer(data, i)) return false;
+	return asn1_pop_tag(data);
+}
+
+bool ber_write_OID_String(DATA_BLOB *blob, const char *OID)
+{
+	uint_t v, v2;
+	const char *p = (const char *)OID;
+	char *newp;
+	int i;
+
+	v = strtoul(p, &newp, 10);
+	if (newp[0] != '.') return false;
+	p = newp + 1;
+
+	v2 = strtoul(p, &newp, 10);
+	if (newp[0] != '.') return false;
+	p = newp + 1;
+
+	/*the ber representation can't use more space then the string one */
+	*blob = data_blob(NULL, strlen(OID));
+	if (!blob->data) return false;
+
+	blob->data[0] = 40*v + v2;
+
+	i = 1;
+	while (*p) {
+		v = strtoul(p, &newp, 10);
+		if (newp[0] == '.') {
+			p = newp + 1;
+		} else if (newp[0] == '\0') {
+			p = newp;
+		} else {
+			data_blob_free(blob);
+			return false;
+		}
+		if (v >= (1<<28)) blob->data[i++] = (0x80 | ((v>>28)&0x7f));
+		if (v >= (1<<21)) blob->data[i++] = (0x80 | ((v>>21)&0x7f));
+		if (v >= (1<<14)) blob->data[i++] = (0x80 | ((v>>14)&0x7f));
+		if (v >= (1<<7)) blob->data[i++] = (0x80 | ((v>>7)&0x7f));
+		blob->data[i++] = (v&0x7f);
+	}
+
+	blob->length = i;
+
+	return true;
+}
+
+/* write an object ID to a ASN1 buffer */
+bool asn1_write_OID(struct asn1_data *data, const char *OID)
+{
+	DATA_BLOB blob;
+
+	if (!asn1_push_tag(data, ASN1_OID)) return false;
+
+	if (!ber_write_OID_String(&blob, OID)) {
+		data->has_error = true;
+		return false;
+	}
+
+	if (!asn1_write(data, blob.data, blob.length)) {
+		data->has_error = true;
+		return false;
+	}
+	data_blob_free(&blob);
+	return asn1_pop_tag(data);
+}
+
+/* write an octet string */
+bool asn1_write_OctetString(struct asn1_data *data, const void *p, size_t length)
+{
+	asn1_push_tag(data, ASN1_OCTET_STRING);
+	asn1_write(data, p, length);
+	asn1_pop_tag(data);
+	return !data->has_error;
+}
+
+/* write a LDAP string */
+bool asn1_write_LDAPString(struct asn1_data *data, const char *s)
+{
+	asn1_write(data, s, strlen(s));
+	return !data->has_error;
+}
+
+/* write a LDAP string from a DATA_BLOB */
+bool asn1_write_DATA_BLOB_LDAPString(struct asn1_data *data, const DATA_BLOB *s)
+{
+	asn1_write(data, s->data, s->length);
+	return !data->has_error;
+}
+
+/* write a general string */
+bool asn1_write_GeneralString(struct asn1_data *data, const char *s)
+{
+	asn1_push_tag(data, ASN1_GENERAL_STRING);
+	asn1_write_LDAPString(data, s);
+	asn1_pop_tag(data);
+	return !data->has_error;
+}
+
+bool asn1_write_ContextSimple(struct asn1_data *data, uint8_t num, DATA_BLOB *blob)
+{
+	asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(num));
+	asn1_write(data, blob->data, blob->length);
+	asn1_pop_tag(data);
+	return !data->has_error;
+}
+
+/* write a BOOLEAN */
+bool asn1_write_BOOLEAN(struct asn1_data *data, bool v)
+{
+	asn1_push_tag(data, ASN1_BOOLEAN);
+	asn1_write_uint8(data, v ? 0xFF : 0);
+	asn1_pop_tag(data);
+	return !data->has_error;
+}
+
+bool asn1_read_BOOLEAN(struct asn1_data *data, bool *v)
+{
+	uint8_t tmp = 0;
+	asn1_start_tag(data, ASN1_BOOLEAN);
+	asn1_read_uint8(data, &tmp);
+	if (tmp == 0xFF) {
+		*v = true;
+	} else {
+		*v = false;
+	}
+	asn1_end_tag(data);
+	return !data->has_error;
+}
+
+/* check a BOOLEAN */
+bool asn1_check_BOOLEAN(struct asn1_data *data, bool v)
+{
+	uint8_t b = 0;
+
+	asn1_read_uint8(data, &b);
+	if (b != ASN1_BOOLEAN) {
+		data->has_error = true;
+		return false;
+	}
+	asn1_read_uint8(data, &b);
+	if (b != v) {
+		data->has_error = true;
+		return false;
+	}
+	return !data->has_error;
+}
+
+
+/* load a struct asn1_data structure with a lump of data, ready to be parsed */
+bool asn1_load(struct asn1_data *data, DATA_BLOB blob)
+{
+	ZERO_STRUCTP(data);
+	data->data = talloc_memdup(data, blob.data, blob.length);
+	if (!data->data) {
+		data->has_error = true;
+		return false;
+	}
+	data->length = blob.length;
+	return true;
+}
+
+/* Peek into an ASN1 buffer, not advancing the pointer */
+bool asn1_peek(struct asn1_data *data, void *p, int len)
+{
+	if (data->has_error)
+		return false;
+
+	if (len < 0 || data->ofs + len < data->ofs || data->ofs + len < len)
+		return false;
+
+	if (data->ofs + len > data->length) {
+		/* we need to mark the buffer as consumed, so the caller knows
+		   this was an out of data error, and not a decode error */
+		data->ofs = data->length;
+		return false;
+	}
+
+	memcpy(p, data->data + data->ofs, len);
+	return true;
+}
+
+/* read from a ASN1 buffer, advancing the buffer pointer */
+bool asn1_read(struct asn1_data *data, void *p, int len)
+{
+	if (!asn1_peek(data, p, len)) {
+		data->has_error = true;
+		return false;
+	}
+
+	data->ofs += len;
+	return true;
+}
+
+/* read a uint8_t from a ASN1 buffer */
+bool asn1_read_uint8(struct asn1_data *data, uint8_t *v)
+{
+	return asn1_read(data, v, 1);
+}
+
+bool asn1_peek_uint8(struct asn1_data *data, uint8_t *v)
+{
+	return asn1_peek(data, v, 1);
+}
+
+bool asn1_peek_tag(struct asn1_data *data, uint8_t tag)
+{
+	uint8_t b;
+
+	if (asn1_tag_remaining(data) <= 0) {
+		return false;
+	}
+
+	if (!asn1_peek_uint8(data, &b))
+		return false;
+
+	return (b == tag);
+}
+
+/* start reading a nested asn1 structure */
+bool asn1_start_tag(struct asn1_data *data, uint8_t tag)
+{
+	uint8_t b;
+	struct nesting *nesting;
+	
+	if (!asn1_read_uint8(data, &b))
+		return false;
+
+	if (b != tag) {
+		data->has_error = true;
+		return false;
+	}
+	nesting = talloc(data, struct nesting);
+	if (!nesting) {
+		data->has_error = true;
+		return false;
+	}
+
+	if (!asn1_read_uint8(data, &b)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list