[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-819-g0c3de6f

Günther Deschner gd at samba.org
Fri Dec 21 16:18:06 GMT 2007


The branch, v3-2-test has been updated
       via  0c3de6f3458419e57daaa71f1dad679897388f5a (commit)
       via  1e090654320ba3ce94d8114acaf931dbb2557a0c (commit)
       via  1489870f05695a929902264eb9b95eab886bdaa6 (commit)
       via  cf57ade5ec4a808eccb19a7723d753742fb71ca9 (commit)
       via  c502686f09713a7cf3786c254be6515a7aa23555 (commit)
       via  c527a28c47f42617853cd28772ef46e5e6b058b6 (commit)
       via  faedc78fc78527ee3bf05e1177ea43653aea67b2 (commit)
       via  5bc49546a32abb4524133b9f2916cdd51d4eb462 (commit)
       via  e46aa35d432e930835206b9ce7583f46933015d8 (commit)
       via  4df868e3c366958c64ed8445489c8d1e8a28e50b (commit)
       via  acc5d8e784b706001457ceeeb9bd4961a13d57d2 (commit)
       via  b95801db595109e8eade7cf7c344f281c8684249 (commit)
       via  c255654c68923aca3e258906e49be82d719d5ccd (commit)
       via  a2c5beda2ec98dea8951fb3a37774f5f325410ef (commit)
       via  15c2bc15f20a677c3c94895150e396275de6ac9b (commit)
       via  1cad549f54563c3a9787624ba7a56b54107ebd57 (commit)
       via  d1e4f9dd5cde79f915e3e0f652621d966aa850e8 (commit)
       via  465e61a3599a277366ada6ecda3a1e6ddb1f2490 (commit)
       via  74048fe7cfbd05994d533bea4a477d6ca93449d9 (commit)
       via  89e8abb1163984eed358a4da9be4699a8e3a43f9 (commit)
       via  96ebdca45b998da7e6137973dea717bf3ac76328 (commit)
       via  24605c9175fb313c9c888783817da755cd8ce594 (commit)
       via  fbc60c1648ff8b1fa0ae33c09237e41232f9769c (commit)
       via  11e90dcbf5dd1a91118e6a5cee53735d72767c93 (commit)
       via  f0e8d744c92d2602722e04be6266196941362d63 (commit)
       via  91b884989891881b8abea70e11b87c16c574daaa (commit)
       via  e640c3a4a7695613e9e619516befbaf3d44ecb10 (commit)
       via  65d50f518766ab0a8115c2599d190e642eb00754 (commit)
       via  97449ea341539a709953a57869570cf13be0f44e (commit)
       via  78d8f0e41aa3db0060596a7b345c2f04261986e0 (commit)
       via  7c38f706b5dc17f15708ac932c84d863a0cc713e (commit)
       via  086c55005976b3173e915e465108214876aa5bd6 (commit)
       via  a42850926a26a4065a6126affc3754d291a2e178 (commit)
       via  c10481dba01a084b0f9c4265f3408a0ec9a8b646 (commit)
       via  c818f5505a124a6f0bb9274a1ba4a6147d2f17b3 (commit)
       via  1d47247283f7bc75291007be3fde72b1d3d95b99 (commit)
       via  46db8754511f915c296771e08e822ba810f804d5 (commit)
       via  9f129c069f9feb357cbe1185058cfe3390609c09 (commit)
       via  07d33557b95106ac57fdef8c767ab86192930a6d (commit)
       via  9b0423e7d918b7b3837ca4ebf997edd80d4da6de (commit)
       via  4896f22bb50ea9ae0c4807ed9b2dd4283c254364 (commit)
       via  fb6315b68b16d64625457881302fd191f90defa0 (commit)
       via  13c46b1407117c93b8f0275cc16ea5aa49596750 (commit)
       via  d2f21ce6727ec9e4df67989db07b48470d0790a4 (commit)
       via  2b41ac926de76804a50681bd246b3a20e112853b (commit)
       via  8cbc6bdede9e8fc423488c7632546c548234cc0c (commit)
       via  d341d251d6e22e9cc1c4596038fd5fe5c7c6c174 (commit)
      from  b1ad3def98911c91ed55a3b7aec7d0894b2dd8fd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 0c3de6f3458419e57daaa71f1dad679897388f5a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 17:05:55 2007 +0100

    Move libnetapi examples into subdirs.
    
    Guenther

commit 1e090654320ba3ce94d8114acaf931dbb2557a0c
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:49:33 2007 +0100

    Gitignore some generated files.
    
    Guenther

commit 1489870f05695a929902264eb9b95eab886bdaa6
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:44:52 2007 +0100

    Deactive remote join code server side until some last issues are resolved.
    
    Guenther

commit cf57ade5ec4a808eccb19a7723d753742fb71ca9
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:36:06 2007 +0100

    Add netdomjoin-gui (my first gui application), another libnetapi user.
    
    Guenther

commit c502686f09713a7cf3786c254be6515a7aa23555
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:08:13 2007 +0100

    Add netdomjoin cmd line tool (another libnetapi example).
    
    Guenther

commit c527a28c47f42617853cd28772ef46e5e6b058b6
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:03:12 2007 +0100

    Make sure libnetapi has getdcname support.
    
    Guenther

commit faedc78fc78527ee3bf05e1177ea43653aea67b2
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 16:02:35 2007 +0100

    Add getdc.c, a libnetapi example (incl. Makefile).
    
    Guenther

commit 5bc49546a32abb4524133b9f2916cdd51d4eb462
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 15:51:00 2007 +0100

    Add basic remote NetGetDCName and NetGetAnyDCName versions to libnetapi.
    
    Guenther

commit e46aa35d432e930835206b9ce7583f46933015d8
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 15:30:29 2007 +0100

    Make libnetapi_errstr use our NTSTATUS and WERROR error string macros.
    
    Guenther

commit 4df868e3c366958c64ed8445489c8d1e8a28e50b
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 20 15:06:20 2007 +0100

    Add error string for access denied in libnetapi.
    
    Guenther

commit acc5d8e784b706001457ceeeb9bd4961a13d57d2
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 20 15:03:12 2007 +0100

    Remove doubled cli_set_timeout calls from libnetapi.
    
    Guenther

commit b95801db595109e8eade7cf7c344f281c8684249
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 20 12:13:04 2007 +0100

    Fix typo.
    
    Guenther

commit c255654c68923aca3e258906e49be82d719d5ccd
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 20 12:12:06 2007 +0100

    Keep libnetapi_NetX calls static for now.
    
    Guenther

commit a2c5beda2ec98dea8951fb3a37774f5f325410ef
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 20 01:19:26 2007 +0100

    Merge all headers into libnetapi.h.
    
    Guenther

commit 15c2bc15f20a677c3c94895150e396275de6ac9b
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 16:07:40 2007 +0100

    Implement NetServerSetInfo level 1005 in local mode with smbconf registry.
    
    Guenther

commit 1cad549f54563c3a9787624ba7a56b54107ebd57
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 15:10:24 2007 +0100

    Add NetServerGetInfo and NetServerSetInfo (for level 1005).
    
    Guenther

commit d1e4f9dd5cde79f915e3e0f652621d966aa850e8
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 13:52:51 2007 +0100

    Split out local and remote paths for NetGetJoinInformation.
    
    Guenther

commit 465e61a3599a277366ada6ecda3a1e6ddb1f2490
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 12:09:08 2007 +0100

    Add libnetapi_errstr().
    
    Guenther

commit 74048fe7cfbd05994d533bea4a477d6ca93449d9
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 11:03:45 2007 +0100

    Add support for remote and local unjoining in libnetapi.
    
    Guenther

commit 89e8abb1163984eed358a4da9be4699a8e3a43f9
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 11:02:39 2007 +0100

    Add libnet_Unjoin(), libnet_UnjoinCtx and friends.
    
    Guenther

commit 96ebdca45b998da7e6137973dea717bf3ac76328
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 10:55:52 2007 +0100

    Remove unrequired TALLOC_CTX from libnetapi_NetJoinDomain & friends.
    
    Guenther

commit 24605c9175fb313c9c888783817da755cd8ce594
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 10:52:45 2007 +0100

    Fix NetJoinDomainLocal.
    
    Guenther

commit fbc60c1648ff8b1fa0ae33c09237e41232f9769c
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 02:25:15 2007 +0100

    Use DsGetDcName in local libnetapi join to find a dc.
    
    Guenther

commit 11e90dcbf5dd1a91118e6a5cee53735d72767c93
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 11:24:10 2007 +0100

    Build libnetapi shared and static if possible.
    
    Guenther

commit f0e8d744c92d2602722e04be6266196941362d63
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 10:31:12 2007 +0100

    In libnet join code, try lsa query with level 12 first.
    
    Guenther

commit 91b884989891881b8abea70e11b87c16c574daaa
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 10:16:40 2007 +0100

    Making do_DomainJoin return NTSTATUS again.
    
    Guenther

commit e640c3a4a7695613e9e619516befbaf3d44ecb10
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:54:18 2007 +0100

    Move NetJoinDomain and friends to NET_API_STATUS and the static libnetapi_ctx.
    
    Guenther

commit 65d50f518766ab0a8115c2599d190e642eb00754
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:52:34 2007 +0100

    Missed on instance of external creds.
    
    Guenther

commit 97449ea341539a709953a57869570cf13be0f44e
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:47:01 2007 +0100

    Add static libnetapi_ctx.
    
    Guenther

commit 78d8f0e41aa3db0060596a7b345c2f04261986e0
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:43:22 2007 +0100

    Use full string based debug_parse_levels in libnetapi.
    
    Guenther

commit 7c38f706b5dc17f15708ac932c84d863a0cc713e
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:34:07 2007 +0100

    Add basic credential functions for libnetapi.
    
    Guenther

commit 086c55005976b3173e915e465108214876aa5bd6
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:29:50 2007 +0100

    Move basic libnetapi functions to NET_API_STATUS.
    
    Guenther

commit a42850926a26a4065a6126affc3754d291a2e178
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:21:38 2007 +0100

    Define NET_API_STATUS to be just a uin32_t.
    
    Guenther

commit c10481dba01a084b0f9c4265f3408a0ec9a8b646
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 18 02:15:49 2007 +0100

    Getting rid of external credentials in libnetapi.
    
    Guenther

commit c818f5505a124a6f0bb9274a1ba4a6147d2f17b3
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 14 17:37:24 2007 +0100

    Make sure we also support non-domain join.
    
    Guenther

commit 1d47247283f7bc75291007be3fde72b1d3d95b99
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 14 12:22:20 2007 +0100

    Some libnet and netapi build fixes.
    
    Guenther

commit 46db8754511f915c296771e08e822ba810f804d5
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 13 16:21:27 2007 +0100

    Fill in local branch of NetGetJoinInformation().
    
    Guenther

commit 9f129c069f9feb357cbe1185058cfe3390609c09
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 12 19:00:41 2007 +0100

    More minor libnetapi fixes.
    
    Guenther

commit 07d33557b95106ac57fdef8c767ab86192930a6d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 12 18:14:54 2007 +0100

    Build fixes for libnetapi.
    
    Guenther

commit 9b0423e7d918b7b3837ca4ebf997edd80d4da6de
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 12 16:12:14 2007 +0100

    Add _wkssvc_NetrJoinDomain2() server.
    
    Guenther

commit 4896f22bb50ea9ae0c4807ed9b2dd4283c254364
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 11 21:32:16 2007 +0100

    Fill in NetJoinDomainLocal().
    
    Guenther

commit fb6315b68b16d64625457881302fd191f90defa0
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 11 21:31:44 2007 +0100

    Add libnet_Join().
    
    Heavily based on existing code in net_ads_join().
    
    Guenther

commit 13c46b1407117c93b8f0275cc16ea5aa49596750
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 11 21:25:41 2007 +0100

    Add libnet_JoinCtx structure.
    
    Guenther

commit d2f21ce6727ec9e4df67989db07b48470d0790a4
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 11 21:23:40 2007 +0100

    Split NetJoinDomain() into NetJoinDomainRemote() and the unsupported
    NetJoinDomainLocal().
    
    Guenther

commit 2b41ac926de76804a50681bd246b3a20e112853b
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 11 21:21:17 2007 +0100

    Very quick conversion of net_conf functions into the libnet_conf layer.
    Certainly needs cleanup later.
    
    Guenther

commit 8cbc6bdede9e8fc423488c7632546c548234cc0c
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 6 19:15:30 2007 +0100

    For the fun of it, build netapi.so|.a.
    
    Guenther

commit d341d251d6e22e9cc1c4596038fd5fe5c7c6c174
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 6 19:04:49 2007 +0100

    Add NetGetJoinInformation().
    
    Guenther

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

Summary of changes:
 .gitignore                                         |    2 +
 source/Makefile.in                                 |   63 +-
 source/configure.in                                |   54 +-
 source/exports/libnetapi.syms                      |    3 +
 source/lib/netapi/examples/Makefile.in             |   57 +
 source/lib/netapi/examples/getdc/getdc.c           |   57 +
 source/lib/netapi/examples/netdomjoin-gui/logo.png |  Bin 0 -> 9329 bytes
 .../lib/netapi/examples/netdomjoin-gui/samba.ico   |  Bin 0 -> 1406 bytes
 .../netapi/examples/netdomjoin/netdomjoin-gui.c    | 1347 ++++++++++++++++++++
 source/lib/netapi/examples/netdomjoin/netdomjoin.c |  107 ++
 source/lib/netapi/getdc.c                          |  243 ++++
 source/lib/netapi/joindomain.c                     |  435 ++++++-
 source/lib/netapi/joindomain.h                     |   29 -
 source/lib/netapi/netapi.c                         |  160 +++
 source/lib/netapi/netapi.h                         |   74 ++
 source/lib/netapi/serverinfo.c                     |  297 +++++
 source/libnet/libnet.h                             |   26 +
 source/libnet/libnet_conf.c                        |  195 +++
 source/libnet/libnet_join.c                        |  579 +++++++++
 source/libnet/libnet_join.h                        |   65 +
 source/rpc_server/srv_wkssvc_nt.c                  |   69 +-
 source/utils/net_conf.c                            |  158 +--
 source/utils/net_dom.c                             |   16 +-
 23 files changed, 3786 insertions(+), 250 deletions(-)
 create mode 100644 source/exports/libnetapi.syms
 create mode 100644 source/lib/netapi/examples/Makefile.in
 create mode 100644 source/lib/netapi/examples/getdc/getdc.c
 create mode 100644 source/lib/netapi/examples/netdomjoin-gui/logo.png
 create mode 100755 source/lib/netapi/examples/netdomjoin-gui/samba.ico
 create mode 100644 source/lib/netapi/examples/netdomjoin/netdomjoin-gui.c
 create mode 100644 source/lib/netapi/examples/netdomjoin/netdomjoin.c
 create mode 100644 source/lib/netapi/getdc.c
 delete mode 100644 source/lib/netapi/joindomain.h
 create mode 100644 source/lib/netapi/netapi.c
 create mode 100644 source/lib/netapi/netapi.h
 create mode 100644 source/lib/netapi/serverinfo.c
 create mode 100644 source/libnet/libnet.h
 create mode 100644 source/libnet/libnet_conf.c
 create mode 100644 source/libnet/libnet_join.c
 create mode 100644 source/libnet/libnet_join.h


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index bd1cba1..d3266ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.po
 *~
 source/client/client_proto.h
+source/libnet/libnet_proto.h
 source/include/build_env.h
 source/include/config.h
 source/include/config.h.in
@@ -9,6 +10,7 @@ source/include/proto.h
 source/include/stamp-h
 source/include/version.h
 source/Makefile
+source/lib/netapi/examples/Makefile
 source/config.log
 source/config.status
 source/configure
diff --git a/source/Makefile.in b/source/Makefile.in
index 599b050..f2b0bc6 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -141,6 +141,7 @@ PIDDIR = @piddir@
 LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
 LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
 LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
+LIBNETAPI=bin/libnetapi.a @LIBNETAPI_SHARED@
 
 FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
 FLAGS2 =
@@ -198,7 +199,7 @@ EVERYTHING_PROGS = bin/debug2html at EXEEXT@ bin/smbfilter at EXEEXT@ \
 	bin/log2pcap at EXEEXT@ bin/sharesec at EXEEXT@ bin/ndrdump at EXEEXT@ \
 	bin/vlp at EXEEXT@
 
-SHLIBS = @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@
+SHLIBS = @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@
 
 PAM_MODULES = @PAM_MODULES@
 
@@ -558,7 +559,7 @@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
 		$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
 		$(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
 		$(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
-		$(BUILDOPT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
+		$(BUILDOPT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ) $(LIBNET_OBJ)
 
 PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
                printing/print_cups.o printing/print_generic.o \
@@ -705,7 +706,21 @@ REG_API_OBJ = registry/reg_api.o \
 	      $(UTIL_REG_API_OBJ) \
 	      $(UTIL_REG_SMBCONF_OBJ)
 
-NETAPI_OBJ = lib/netapi/joindomain.o
+
+LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
+		 lib/netapi/joindomain.o \
+		 lib/netapi/serverinfo.o \
+		 lib/netapi/getdc.o
+
+LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
+		 $(REG_API_OBJ) \
+		 $(PARAM_WITHOUT_REG_OBJ) $(LIB_NONSMBD_OBJ) \
+		 $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
+		 $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
+		 $(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
+		 $(DCUTIL_OBJ) $(LIBADS_OBJ)
+
+LIBNET_OBJ = libnet/libnet_conf.o libnet/libnet_join.o
 
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
 	   utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
@@ -726,7 +741,7 @@ NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
 	  $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
 	  $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
 	  $(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
-	  $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(NETAPI_OBJ)
+	  $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(LIBNETAPI_OBJ1) $(LIBNET_OBJ)
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
 	  $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
@@ -1034,7 +1049,7 @@ idl:
 #####################################################################
 
 
-everything: all libsmbclient debug2html smbfilter talloctort replacetort modules torture \
+everything: all libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
 	$(EVERYTHING_PROGS)
 
 .SUFFIXES:
@@ -1353,6 +1368,16 @@ bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
 	@echo Linking non-shared library $@
 	@-$(AR) -rc $@ $(LIBADDNS_OBJ)
 
+bin/libnetapi. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+	@echo Linking shared library $@
+	@$(SHLD_DSO) $(LIBNETAPI_OBJ) $(LIBS) \
+		$(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
+		@SONAMEFLAG@`basename $@`.$(SONAME_VER)
+
+bin/libnetapi.a: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+	@echo Linking non-shared library $@
+	@-$(AR) -rc $@ $(LIBNETAPI_OBJ)
+
 bin/libsmbclient. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
 	@echo Linking shared library $@
 	@$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) $(LIBS) \
@@ -1389,6 +1414,7 @@ bin/libbigballofmud. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ)
 libsmbclient: $(LIBSMBCLIENT)
 libsmbsharemodes: $(LIBSMBSHAREMODES)
 libaddns: $(LIBADDNS)
+libnetapi: $(LIBNETAPI)
 
 # Linker command to link a RPC, VFS, AUTH, CHARSET or PASSDB module.
 SHLD_MODULE = $(SHLD) $(LDSHFLAGS) $(MODULE_EXPORTS) \
@@ -1725,7 +1751,7 @@ bin/timelimit at EXEEXT@: script/tests/timelimit.o
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(DYNEXP) script/tests/timelimit.o
 
-install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ @INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@
+install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ @INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBNETAPI@
 
 
 install-everything: install installmodules
@@ -1804,6 +1830,12 @@ installlibaddns: installdirs libaddns
 	-$(INSTALLLIBCMD_SH) bin/libaddns. at SHLIBEXT@ $(DESTDIR)$(LIBDIR)
 	-$(INSTALLLIBCMD_A) bin/libaddns.a $(DESTDIR)$(LIBDIR)
 
+installlibnetapi: installdirs libnetapi
+	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
+	-$(INSTALLLIBCMD_SH) bin/libnetapi. at SHLIBEXT@ $(DESTDIR)$(LIBDIR)
+	-$(INSTALLLIBCMD_A) bin/libnetapi.a $(DESTDIR)$(LIBDIR)
+	-$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/lib/netapi/libnetapi.h $(DESTDIR)${prefix}/include
+
 installpammodules: $(PAM_MODULES)
 	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(PAMMODULESDIR)
 	@for module in $(PAM_MODULES); do \
@@ -1838,7 +1870,7 @@ showlayout:
 	@echo "  swatdir:     $(SWATDIR)"
 
 
-uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@
+uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
 
 uninstallman:
 	@$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
@@ -1888,6 +1920,11 @@ uninstalllibaddns:
 	-$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libaddns. at SHLIBEXT@
 	-$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libaddns.a
 
+uninstalllibnetapi:
+	-$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libnetapi. at SHLIBEXT@
+	-$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libnetapi.a
+	-rm -f $(DESTDIR)${prefix}/include/libnetapi.h
+
 uninstallpammodules:
 	@for module in $(PAM_MODULES); do \
 		echo "Removing $(DESTDIR)/$(PAMMODULESDIR)/$${module}. at SHLIBEXT@ "; \
@@ -1904,7 +1941,7 @@ clean: delheaders
 		*/*. at SHLIBEXT@ */*/*. at SHLIBEXT@ */*/*/*. at SHLIBEXT@ \
 		$(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(ROOT_SBIN_PROGS) \
 		$(MODULES) $(TORTURE_PROGS) $(LIBSMBCLIENT) $(LIBADDNS) \
-		$(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) \
+		$(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) $(LIBNETAPI) \
 		.headers.stamp */src/*.o proto_exists
 	-rm -rf t_dir
 
@@ -1923,7 +1960,7 @@ delheaders:
 		winbindd/winbindd_proto.h web/swat_proto.h \
 		client/client_proto.h utils/net_proto.h \
 		smbd/build_options.c utils/ntlm_auth_proto.h \
-		utils/passwd_proto.h
+		utils/passwd_proto.h libnet/libnet_proto.h
 
 MKPROTO_SH = $(srcdir)/script/mkproto.sh
 
@@ -1968,6 +2005,11 @@ utils/ntlm_auth_proto.h:
 	  -h _NTLM_AUTH_PROTO_H_ $(builddir)/utils/ntlm_auth_proto.h \
 	  $(NTLM_AUTH_OBJ1)
 
+libnet/libnet_proto.h:
+	@cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
+	  -h _LIBNET_PROTO_H_ $(builddir)/libnet/libnet_proto.h \
+	  $(LIBNET_OBJ)
+
 # "make headers" or "make proto" calls a subshell because we need to
 # make sure these commands are executed in sequence even for a
 # parallel make.
@@ -1981,7 +2023,8 @@ headers:
 	$(MAKE) client/client_proto.h; \
 	$(MAKE) utils/ntlm_auth_proto.h; \
 	$(MAKE) utils/net_proto.h; \
-	$(MAKE) utils/passwd_proto.h;
+	$(MAKE) utils/passwd_proto.h; \
+	$(MAKE) libnet/libnet_proto.h;
 
 proto: headers
 
diff --git a/source/configure.in b/source/configure.in
index 6015837..a9053d9 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -326,6 +326,10 @@ AC_SUBST(INSTALL_LIBSMBSHAREMODES)
 AC_SUBST(UNINSTALL_LIBSMBSHAREMODES)
 AC_SUBST(LIBSMBSHAREMODES_SHARED)
 AC_SUBST(LIBSMBSHAREMODES)
+AC_SUBST(INSTALL_LIBNETAPI)
+AC_SUBST(UNINSTALL_LIBNETAPI)
+AC_SUBST(LIBNETAPI_SHARED)
+AC_SUBST(LIBNETAPI)
 AC_SUBST(PRINT_LIBS)
 AC_SUBST(AUTH_LIBS)
 AC_SUBST(ACL_LIBS)
@@ -5067,6 +5071,51 @@ if test $enable_static = yes; then
 fi
 
 #################################################
+# should we build libnetapi?
+INSTALL_LIBNETAPI=
+UNINSTALL_LIBNETAPI=
+LIBNETAPI_SHARED=
+LIBNETAPI=
+AC_MSG_CHECKING(whether to build the libnetapi shared library)
+AC_ARG_WITH(libnetapi,
+[  --with-libnetapi         Build the libnetapi shared library (default=no undefined API)],
+[ case "$withval" in
+  *)
+     AC_MSG_RESULT(no)
+     ;;
+  yes)
+     if test $BLDSHARED = true; then
+        LIBNETAPI_SHARED=bin/libnetapi.$SHLIBEXT
+        LIBNETAPI=libnetapi
+        AC_MSG_RESULT(yes)
+     else
+	enable_static=yes
+        AC_MSG_RESULT(no shared library support -- will supply static library)
+     fi
+     if test $enable_static = yes; then
+        LIBNETAPI=libnetapi
+     fi
+     INSTALL_LIBNETAPI=installlibnetapi
+     UNINSTALL_LIBNETAPI=uninstalllibnetapi
+     ;;
+  esac ],
+[
+# if unspecified, default is to built it if possible.
+  if test $BLDSHARED = true; then
+     LIBNETAPI_SHARED=bin/libnetapi.$SHLIBEXT
+     LIBNETAPI=libnetapi
+     AC_MSG_RESULT(yes)
+   else
+     enable_static=yes
+     AC_MSG_RESULT(no shared library support -- will supply static library)
+   fi
+   if test $enable_static = yes; then
+     LIBNETAPI=libnetapi
+  fi]
+  INSTALL_LIBNETAPI=installlibnetapi
+)
+
+#################################################
 # should we build libaddns?
 INSTALL_LIBADDNS=
 UNINSTALL_LIBADDNS=
@@ -6554,7 +6603,10 @@ AC_SUBST(builddir)
 SMBD_LIBS="$samba_dmapi_libs"
 AC_SUBST(SMBD_LIBS)
 
-AC_OUTPUT(Makefile library-versions script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh)
+AC_OUTPUT(Makefile library-versions
+	  script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh
+	  lib/netapi/examples/Makefile
+	  )
 
 #################################################
 # Print very concise instructions on building/use
diff --git a/source/exports/libnetapi.syms b/source/exports/libnetapi.syms
new file mode 100644
index 0000000..eb34bfc
--- /dev/null
+++ b/source/exports/libnetapi.syms
@@ -0,0 +1,3 @@
+{
+	global: *;
+};
diff --git a/source/lib/netapi/examples/Makefile.in b/source/lib/netapi/examples/Makefile.in
new file mode 100644
index 0000000..c2f453d
--- /dev/null
+++ b/source/lib/netapi/examples/Makefile.in
@@ -0,0 +1,57 @@
+GTK_FLAGS=`pkg-config gtk+-2.0 --cflags`
+GTK_LIBS=`pkg-config gtk+-2.0 --libs`
+
+KRB5LIBS=@KRB5_LIBS@
+LDAP_LIBS=@LDAP_LIBS@
+LIBS=@LIBS@ -lnetapi
+DEVELOPER_CFLAGS=@DEVELOPER_CFLAGS@
+FLAGS=@CFLAGS@ $(GTK_FLAGS)
+CC=@CC@
+LDFLAGS=@PIE_LDFLAGS@ @LDFLAGS@
+DYNEXP=@DYNEXP@
+
+# Compile a source file.
+COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@
+COMPILE = $(COMPILE_CC)
+
+BINARY_PREREQS = proto_exists bin/.dummy
+
+MAKEDIR = || exec false; \
+	  if test -d "$$dir"; then :; else \
+	  echo mkdir "$$dir"; \
+	  mkdir -p "$$dir" >/dev/null 2>&1 || \
+	  test -d "$$dir" || \
+	  mkdir "$$dir" || \
+	  exec false; fi || exec false
+
+.c.o:
+	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
+	 dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
+	@echo Compiling $*.c
+	@$(COMPILE) && exit 0;\
+		echo "The following command failed:" 1>&2;\
+		echo "$(COMPILE_CC)" 1>&2;\
+		$(COMPILE_CC) >/dev/null 2>&1
+
+GETDC_OBJ = getdc/getdc.o
+NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o
+NETDOMJOIN_GUI_OBJ = netdomjoin-gui/netdomjoin-gui.o
+
+PROGS = bin/getdc at EXEEXT@ bin/netdomjoin at EXEEXT@ bin/netdomjoin-gui at EXEEXT@
+
+all: $(PROGS)
+
+bin/getdc at EXEEXT@: $(GETDC_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+
+bin/netdomjoin at EXEEXT@: $(NETDOMJOIN_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+
+bin/netdomjoin-gui at EXEEXT@: $(NETDOMJOIN_GUI_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) $(GTK_FLAGS) -o $@ $(NETDOMJOIN_GUI_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(GTK_LIBS)
+
+clean:
+	@rm -f $(PROGS)
diff --git a/source/lib/netapi/examples/getdc/getdc.c b/source/lib/netapi/examples/getdc/getdc.c
new file mode 100644
index 0000000..ed6a8bd
--- /dev/null
+++ b/source/lib/netapi/examples/getdc/getdc.c
@@ -0,0 +1,57 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  GetDCName query
+ *  Copyright (C) Guenther Deschner 2007
+ *
+ *  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 <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <libnetapi.h>
+
+int main(int argc, char **argv)
+{
+	NET_API_STATUS status;
+	struct libnetapi_ctx *ctx = NULL;
+	uint8_t *buffer;
+
+	if (argc < 3) {
+		printf("usage: getdc <hostname> <domain>\n");
+		return -1;
+	}
+
+	status = libnetapi_init(&ctx);
+	if (status != 0) {
+		return status;
+	}
+
+	libnetapi_set_username(ctx, "");
+	libnetapi_set_password(ctx, "");
+
+	status = NetGetDCName(argv[1], argv[2], &buffer);
+	if (status != 0) {
+		printf("GetDcName failed with: %s\n", libnetapi_errstr(ctx, status));
+	} else {
+		printf("%s\n", (char *)buffer);
+	}
+
+	libnetapi_free(ctx);
+
+	return status;
+}
diff --git a/source/lib/netapi/examples/netdomjoin-gui/logo.png b/source/lib/netapi/examples/netdomjoin-gui/logo.png
new file mode 100644
index 0000000..6df4ace
Binary files /dev/null and b/source/lib/netapi/examples/netdomjoin-gui/logo.png differ
diff --git a/source/lib/netapi/examples/netdomjoin-gui/samba.ico b/source/lib/netapi/examples/netdomjoin-gui/samba.ico
new file mode 100755
index 0000000..b70c959
Binary files /dev/null and b/source/lib/netapi/examples/netdomjoin-gui/samba.ico differ
diff --git a/source/lib/netapi/examples/netdomjoin/netdomjoin-gui.c b/source/lib/netapi/examples/netdomjoin/netdomjoin-gui.c
new file mode 100644
index 0000000..8ca6897
--- /dev/null
+++ b/source/lib/netapi/examples/netdomjoin/netdomjoin-gui.c
@@ -0,0 +1,1347 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Join Support (gtk + netapi)
+ *  Copyright (C) Guenther Deschner 2007
+ *
+ *  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/>.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gprintf.h>
+
+#include <libnetapi.h>
+
+#define MAX_CRED_LEN 256
+#define MAX_NETBIOS_NAME_LEN 15
+
+#define SAMBA_ICON_PATH  "/usr/share/pixmaps/samba/samba.ico"
+#define SAMBA_IMAGE_PATH "/usr/share/pixmaps/samba/logo.png"
+
+#define WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED ( 0x00000020 )
+#define WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE ( 0x00000004 )
+#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 )
+#define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 )
+
+#define NetSetupWorkgroupName ( 2 )
+#define NetSetupDomainName ( 3 )
+
+#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
+
+struct srvsvc_NetSrvInfo1005 {
+	const char *comment;/* [unique,charset(UTF16)] */
+};
+
+static gboolean verbose = FALSE;
+
+typedef struct join_state {
+	struct libnetapi_ctx *ctx;
+	GtkWidget *window_main;
+	GtkWidget *window_parent;
+	GtkWidget *window_do_change;
+	GtkWidget *window_creds_prompt;
+	GtkWidget *entry_account;
+	GtkWidget *entry_password;
+	GtkWidget *entry_domain;
+	GtkWidget *entry_workgroup;
+	GtkWidget *button_ok;
+	GtkWidget *button_apply;
+	GtkWidget *button_ok_creds;
+	GtkWidget *label_reboot;
+	GtkWidget *label_current_name_buffer;
+	GtkWidget *label_current_name_type;
+	GtkWidget *label_full_computer_name;
+	uint16_t name_type_initial;
+	uint16_t name_type_new;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list