[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre2-645-g7f6b35f

Karolin Seeger kseeger at samba.org
Sat Apr 12 05:50:53 GMT 2008


The branch, v3-2-stable has been updated
       via  7f6b35f20c8906ca2bc7fa14d96ce17c793eb0bf (commit)
       via  21337076859570b2dc6d1a6b4e3121635254a059 (commit)
       via  a491a114a9be92f9e8d191e50d2f9699bdd47227 (commit)
       via  0025c55a81ea32422cb9f7b86e86a550dd4f59cb (commit)
       via  67061ab9917a262b833c7f7c31ebe251d9c7fe0d (commit)
       via  55d44ed8405bc3677d8c761097dfb96969b0d125 (commit)
       via  94fb69291e7a8fd3919bc1e2f4dd357f86c673c9 (commit)
       via  be3de53167e5b8d4a9a0f9d50d698f6e4adfb5aa (commit)
       via  eb45084d99aad58760cedd1df97e8c7d2e4af43c (commit)
       via  4be691a9b6da484e89de3bf4ff76f01b267d71a9 (commit)
       via  81f2c8f1658d6f0762d87175d7328b693277d7ce (commit)
       via  4b945c42f4f92bfb78f5a9e8e3e1f0856a67ff73 (commit)
       via  7d2712d6f738a351c5fe26891aeb2943bbca3558 (commit)
       via  93f3fec4ac2cbb6223f46fce8b584a9628aec58d (commit)
       via  6472c974bfbc14bd5e4f5637b88298e4a65b665c (commit)
       via  e572dbb975932c20ec67cef47f76a31b8fb0bd35 (commit)
       via  7a5e211677ebd461dcd251d9fa89fa9d2c6da666 (commit)
       via  a5fd46bd25f34e2280d2b186e2d78cd89f33a666 (commit)
       via  0cdc4c18567bd12244f502283842f6da2528cafc (commit)
       via  ca39bc54e57077e0dbebc4684f111f05b0d3a7c5 (commit)
       via  f0b6e462105dab6da8da0956b7071b4eab7ca20e (commit)
       via  7287aa1ebb7980a15e588bb04b60163f0f84026a (commit)
       via  fabfd86a91d272bc9374e35f1cbc1d7cb4f15e0d (commit)
       via  0abbc73c3283353cd8dcc56ff02a46f90f64bcb7 (commit)
       via  33bb04b4142a8384ce96804e14c31d85a840cb4b (commit)
       via  8ff8a606985399c0ef148dbb41a8f2e49ddbc100 (commit)
       via  d0b582e5a8ee179b98866a84450b54633b1b029c (commit)
       via  3c446dfa9801b27584c63bc5a282a2e1f381fcb0 (commit)
       via  a8e3b78e2a182cd9692dc6884f3465ade1cfae11 (commit)
       via  b8d786474d3c4b536b4cad05dc4395fea50c1670 (commit)
       via  29eebbf94ac2410c942ffa8633b87fa531cf3bc0 (commit)
       via  4fe5693ae08bd3dc1838cdb95b962b706c7e785d (commit)
       via  bd3972e0be6f80454407af85f09f2c60c69cc9c7 (commit)
       via  3541e98954ca5e3662dd5412ab254606f8277312 (commit)
       via  9cb533e88a9745f14b2489d7c96c1d5ad280c1ea (commit)
       via  df30d61f5fdeddd7eccf821f41d65640815373e8 (commit)
       via  0fe4c56a2da34bae8c4376cc421b8aed79e50318 (commit)
       via  b36d1bbfc83d49f1137bc33dde5d22f1ac8000b1 (commit)
       via  8ed82ab41024a94b3e37ee65a49c2d243a91d736 (commit)
       via  2fc60b120e9447180ebc973a210f00548172d82a (commit)
       via  14ce3f445dd31f687144eb5f64cd59f16dfd6e27 (commit)
       via  476102be870ff29296a372624686e5029a676a7d (commit)
       via  78815d708a94dd2980b4cbf22322b31f021f527b (commit)
       via  7a7dec2cc4bd3e57d84d1e12d70040a5aaf8b7e6 (commit)
       via  b58bfbbf82e961e9da73f3a6a9d645dadab9a360 (commit)
       via  1f83e6da0dd7ca1be921e8d123f4318ebe61d28c (commit)
       via  6c56cea58ad1bb5f15ccab109d6de82c8b061a93 (commit)
       via  3a548de2c705186a1068d80d81d7a015d7438b2c (commit)
       via  b3aea92228bbab5a29fea2fe587f75c4c7c0c8e9 (commit)
       via  a43b76be08b0ebb7596623c5aaeb5d99642d4732 (commit)
       via  85bd401dbce25abf715dbb6c515cc3bf0dd60897 (commit)
       via  0f83bae41a9b0fb3e77bf7ecfc0e72b68c3f5194 (commit)
       via  68849494e307536e4d2d318151ed6dba5f72eb5b (commit)
       via  29715973d33887271fc798d833300c73d86a4d8f (commit)
       via  6b583de8e5de0c3fcf9508ac572d0d4c3ee8e1c5 (commit)
       via  7d20487f9629f1eeb6da5a07a3d6fe9bb043b943 (commit)
       via  f864e5877ca35ebba7ad5ff3c68704bddeaaccba (commit)
       via  7b6d0b061ac6af80335941aecc0415cf421f1a85 (commit)
       via  b910b11200526120c13bfe4b0733ccaf20c8ba87 (commit)
       via  f690263c7340677dc88b9b578ca8f388e0453a96 (commit)
       via  b2bae33aa075464c1bb8dc595afab83d7a544123 (commit)
       via  56fe7b02250df99142c9b62f8600b4829227a8dd (commit)
       via  40306db45b667d92c76e8363b0153a5afca83465 (commit)
       via  d6f7c6bfe1659c3491700c877cf44c4fda479e5c (commit)
       via  19ae5d295c747358e8cfed6d9f7643b10aabdb3a (commit)
       via  5eaee1824383f95c729e4cd8d1d4ece764a7850b (commit)
       via  b82899c28642cfca0152f3262d8a0f96d46753f5 (commit)
       via  8b040235a6064231510227e3e98f5778bdd25d88 (commit)
       via  f67430b6a4a75c0f236690896a15d96e800cdf07 (commit)
      from  134de6a97dfb51f2260087f24457cb931f340650 (commit)

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


- Log -----------------------------------------------------------------
commit 7f6b35f20c8906ca2bc7fa14d96ce17c793eb0bf
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 22:44:00 2008 +0200

    Use libnetapi_open_pipe in netapi functions.
    
    Guenther
    (cherry picked from commit 5804d8b112e1da022988c635284eb4799974d4c7)

commit 21337076859570b2dc6d1a6b4e3121635254a059
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 22:42:07 2008 +0200

    Add libnetapi_open_pipe, inspired by the cli_cm_ interface.
    
    Guenther
    (cherry picked from commit 87d8fc338f6e6b48691bff3eeebfc00c5d408ff7)

commit a491a114a9be92f9e8d191e50d2f9699bdd47227
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 22:04:04 2008 +0200

    Use libnetapi_open_ipc_connection in libnetapi.
    
    Guenther
    (cherry picked from commit d9f19fc61586d606393368799dee9757c169d602)

commit 0025c55a81ea32422cb9f7b86e86a550dd4f59cb
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:56:12 2008 +0200

    Fix one missing netapi_private header.
    
    Guenther
    (cherry picked from commit d34c3e8ad2b21051162e2a9d65f773c486c43d8b)

commit 67061ab9917a262b833c7f7c31ebe251d9c7fe0d
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:52:03 2008 +0200

    Split out private headers in libnetapi.
    
    Guenther
    (cherry picked from commit dd6251d51472a96bfc5ba3d62ea788c8924d4c6b)

commit 55d44ed8405bc3677d8c761097dfb96969b0d125
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:41:03 2008 +0200

    Add very basic cli_cm_* based connection handler to libnetapi.
    
    Guenther
    (cherry picked from commit e9e46cfcbe25366121f680a6d81fe08c128bf00a)

commit 94fb69291e7a8fd3919bc1e2f4dd357f86c673c9
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:31:12 2008 +0200

    Use SERVER_INFO_1005 in libnetapi.
    
    Guenther
    (cherry picked from commit 5f8793dd1d8a3694afb7f2d882cfb9990eb40b75)

commit be3de53167e5b8d4a9a0f9d50d698f6e4adfb5aa
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:29:05 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 0d5130ddb61aa2db603339e693f54fff302eb947)

commit eb45084d99aad58760cedd1df97e8c7d2e4af43c
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:28:17 2008 +0200

    Add SERVER_INFO_1005 to libnetapi.idl.
    
    Guenther
    (cherry picked from commit 5387c6e8d19f7f26561c5fbacb1c75a5ba8fea60)

commit 4be691a9b6da484e89de3bf4ff76f01b267d71a9
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:23:59 2008 +0200

    Fix typo.
    
    Guenther
    (cherry picked from commit 30337bce2c748e5338f9cc923e096883322f50d3)

commit 81f2c8f1658d6f0762d87175d7328b693277d7ce
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:21:27 2008 +0200

    Add some more cli_cm_set_X functions.
    
    Guenther
    (cherry picked from commit 882475f5566592b3a675d3609c3af8cf7d4e256d)

commit 4b945c42f4f92bfb78f5a9e8e3e1f0856a67ff73
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 10 21:19:30 2008 +0200

    Add MAX_NERR define.
    
    Guenther
    (cherry picked from commit 729eda95401e63feabb3ed329c6d2888dabe1d68)

commit 7d2712d6f738a351c5fe26891aeb2943bbca3558
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:50:30 2008 +0200

    Add NetUserEnum example.
    
    Guenther
    (cherry picked from commit 7d9f64fd8401f8abb938757b4f092e25fd6b154f)

commit 93f3fec4ac2cbb6223f46fce8b584a9628aec58d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:47:51 2008 +0200

    Add NetUserEnum to libnetapi.
    
    Guenther
    (cherry picked from commit 6c933d0b3838808aeee7f4b29ee89aab8d203538)

commit 6472c974bfbc14bd5e4f5637b88298e4a65b665c
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:42:48 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 285072479bebf09c94fccf55578ef587627c888e)

commit e572dbb975932c20ec67cef47f76a31b8fb0bd35
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:41:54 2008 +0200

    Add NetUserEnum to libnetapi IDL.
    
    Guenther
    (cherry picked from commit dbbefb4e97df49dc28d47b5d9ba759f90efb9aab)

commit 7a5e211677ebd461dcd251d9fa89fa9d2c6da666
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:38:39 2008 +0200

    Add Add NetUserDel example.
    
    Guenther
    (cherry picked from commit 3123e68bda70ad1cff9bd8f9375fd7935bf755dd)

commit a5fd46bd25f34e2280d2b186e2d78cd89f33a666
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:35:49 2008 +0200

    Add NetUserDel to libnetapi.
    
    Guenther
    (cherry picked from commit 92ba18fcd0816fb85846c6e788ea4a04c71e02a8)

commit 0cdc4c18567bd12244f502283842f6da2528cafc
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:32:19 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 51d0cbe3d972b5917f89cea8624bc21910116132)

commit ca39bc54e57077e0dbebc4684f111f05b0d3a7c5
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:31:53 2008 +0200

    Add NetUserDel to libnetapi IDL.
    
    Guenther
    (cherry picked from commit 8a0b6532af4ccd71f2dcc202db6e976161627372)

commit f0b6e462105dab6da8da0956b7071b4eab7ca20e
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:28:30 2008 +0200

    Add NetUserAdd example.
    
    Guenther
    (cherry picked from commit 0d795606655a67d79c8c3bb2f3676ca7ee28f347)

commit 7287aa1ebb7980a15e588bb04b60163f0f84026a
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 12:38:22 2008 +0200

    Add NetUserAdd to libnetapi.
    
    Guenther
    (cherry picked from commit cb98996ed2ac93a0e15838048405772d2043021a)

commit fabfd86a91d272bc9374e35f1cbc1d7cb4f15e0d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 12:36:02 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 0d84f0d48559d8bed91bcb478d8be0bb3b96acac)

commit 0abbc73c3283353cd8dcc56ff02a46f90f64bcb7
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 12:35:09 2008 +0200

    Add NetUserAdd to libnetapi IDL.
    
    Guenther
    (cherry picked from commit 08afca2188d28ff9727d0ae3f051681a1e1dc5c8)

commit 33bb04b4142a8384ce96804e14c31d85a840cb4b
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 9 13:17:42 2008 +0200

    Fix parameters string for rpc_trustdom_add_internals().
    
    Guenther
    (cherry picked from commit e161bb64a8348ecf7929dbc04d5923d8bd3542ad)

commit 8ff8a606985399c0ef148dbb41a8f2e49ddbc100
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 23:09:24 2008 +0200

    Fix lsa_QueryTrustedDomainInfo caller.
    
    Guenther
    (cherry picked from commit 9f148daaf2e240002914183655c2b2cc9067759f)

commit d0b582e5a8ee179b98866a84450b54633b1b029c
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 23:04:22 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit ad3073749089f7166d9070c232ef02e6ba203215)

commit 3c446dfa9801b27584c63bc5a282a2e1f381fcb0
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 23:02:48 2008 +0200

    Fix IDL for lsa_LookupPrivName.
    
    Guenther
    (cherry picked from commit 7b56a4bcf23f124fc9530fe1401add094f25fb28)

commit a8e3b78e2a182cd9692dc6884f3465ade1cfae11
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:58:16 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 6f474326030b916ca972b68ce36e4d7287192a33)

commit b8d786474d3c4b536b4cad05dc4395fea50c1670
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:57:16 2008 +0200

    Fix IDL for lsa_QueryTrustedDomainInfo.
    
    Guenther
    (cherry picked from commit a064d000969233cf517f2e47b890d4e983c957ad)

commit 29eebbf94ac2410c942ffa8633b87fa531cf3bc0
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:55:52 2008 +0200

    Fix lsa_TrustedDomainInfo callers.
    
    Guenther
    (cherry picked from commit e0eae3901750c7b76560bbab9a86f24a64d42c8b)

commit 4fe5693ae08bd3dc1838cdb95b962b706c7e785d
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:54:18 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit 83dc2e1477333480511b8948d4e3e8e90ff86e25)

commit bd3972e0be6f80454407af85f09f2c60c69cc9c7
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:52:26 2008 +0200

    Fix IDL for lsa_QueryTrustedDomainInfoBySid.
    
    Guenther
    (cherry picked from commit 7903103c70119d28b9d73cc340a1d85d04313b83)

commit 3541e98954ca5e3662dd5412ab254606f8277312
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:51:55 2008 +0200

    Fix IDL for lsa_QueryTrustedDomainInfoByName.
    
    Guenther
    (cherry picked from commit 18272d53859378b8832c098bcfafacf306e0eeca)

commit 9cb533e88a9745f14b2489d7c96c1d5ad280c1ea
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 22:50:05 2008 +0200

    Fix IDL for lsa_QueryDomainInformationPolicy.
    
    Guenther
    (cherry picked from commit 7a822c3c71fde8e86bc99c28701517e0db076263)

commit df30d61f5fdeddd7eccf821f41d65640815373e8
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 19:54:57 2008 +0200

    Move is_valid_policy_hnd() out of net.
    
    Guenther
    (cherry picked from commit aae4d91e726ef8dcad173cdd1d6f719d94462948)

commit 0fe4c56a2da34bae8c4376cc421b8aed79e50318
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 19:42:26 2008 +0200

    Try to use kerberos in libnetapi.
    
    Guenther
    (cherry picked from commit 9cfce2229508c2145c3527074ac76520544e5d25)

commit b36d1bbfc83d49f1137bc33dde5d22f1ac8000b1
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 18:45:26 2008 +0200

    Add DsGetDcName libnetapi example.
    
    Guenther
    (cherry picked from commit 0216e55fa87a14fc45c320268f0511eb6638460b)

commit 8ed82ab41024a94b3e37ee65a49c2d243a91d736
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 18:43:51 2008 +0200

    Add DsGetDcName call to libnetapi library.
    
    Guenther
    (cherry picked from commit 27780e984152e38c8f80e1c67ddf13b73a2b220d)

commit 2fc60b120e9447180ebc973a210f00548172d82a
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 14:38:10 2008 +0200

    Re-run make idl.
    
    Guenther
    (cherry picked from commit a47642011a5d4732afa939a9162c232922a29f61)

commit 14ce3f445dd31f687144eb5f64cd59f16dfd6e27
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 14:37:09 2008 +0200

    Add DsGetDCName call to libnetapi.idl.
    
    Guenther
    (cherry picked from commit e8cea4db013de63ec0eb9f8c9db530688483e5b6)

commit 476102be870ff29296a372624686e5029a676a7d
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 17:17:17 2008 +0200

    Fix includes in libnetapi examples common.c
    
    Guenther
    (cherry picked from commit 922ff9d01668c2c2ad10decfd09c0e7b3f0d7592)

commit 78815d708a94dd2980b4cbf22322b31f021f527b
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 14:34:30 2008 +0200

    Use popt in libetapi example code.
    
    Guenther
    (cherry picked from commit 6f239df3f5a57c9549f1637e53fd42d2ed604c3f)

commit 7a7dec2cc4bd3e57d84d1e12d70040a5aaf8b7e6
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 14:29:21 2008 +0200

    Prefill in username in libnetapi ctx.
    
    Guenther
    (cherry picked from commit 394bdb89ef350db0ab6aca093054e1048a8ffe1f)

commit b58bfbbf82e961e9da73f3a6a9d645dadab9a360
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 14:10:48 2008 +0200

    Add CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS define.
    
    This allows to switch on the cli->fallback_after_kerberos switch.
    
    Guenther
    (cherry picked from commit 15ba45e567d910c1b2336dcc0c475e12b082f30f)

commit 1f83e6da0dd7ca1be921e8d123f4318ebe61d28c
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 02:42:50 2008 +0200

    Restructure inner workings of libnetapi a bit.
    
    Guenther
    (cherry picked from commit a4e3bc2bade8bf74696e1c6ced74da563ff2df7b)

commit 6c56cea58ad1bb5f15ccab109d6de82c8b061a93
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 02:26:21 2008 +0200

    Add libnetapi generated files.
    
    Guenther
    (cherry picked from commit 78da087b3a04f25bd0ea3195debf5c46731bac74)

commit 3a548de2c705186a1068d80d81d7a015d7438b2c
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 02:25:31 2008 +0200

    Build libnetapi.idl.
    
    Guenther
    (cherry picked from commit c098714ac4bac8a7e27be761979a96190b77de1f)

commit b3aea92228bbab5a29fea2fe587f75c4c7c0c8e9
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 02:25:00 2008 +0200

    Add libnetapi.idl.
    
    Guenther
    (cherry picked from commit 5231a135068a64aedbe2643a9168f2a14c40b139)

commit a43b76be08b0ebb7596623c5aaeb5d99642d4732
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 8 02:14:44 2008 +0200

    Whatsnew
    (cherry picked from commit 5cb480a664938d93d6cd059c78da9bc78eb58dcb)

commit 85bd401dbce25abf715dbb6c515cc3bf0dd60897
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 12:00:26 2008 +0200

    Fix _samr_GetUserPwInfo() (to return more then just zeros).
    
    Guenther
    (cherry picked from commit 624371ce32a7c0816963745059e743e5b3e92e2a)

commit 0f83bae41a9b0fb3e77bf7ecfc0e72b68c3f5194
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 11:59:32 2008 +0200

    Fix _samr_GetDomPwInfo (to return more then zeros).
    
    Guenther
    (cherry picked from commit 1cde9579f10ab8c43c25dfd6e5c658c7653f9a37)

commit 68849494e307536e4d2d318151ed6dba5f72eb5b
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 02:53:40 2008 +0200

    Use sid_array_from_info3 in lookup_usergroups_cached().
    
    Guenther
    (cherry picked from commit 65b4cb20ea3fb806cfd50281e08f32bea70fafce)

commit 29715973d33887271fc798d833300c73d86a4d8f
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 01:44:16 2008 +0200

    Remove some dead code in rpcclient.
    
    Guenther
    (cherry picked from commit c7ae1a9b53ef578cf4dfdf8e05915817c69896b5)

commit 6b583de8e5de0c3fcf9508ac572d0d4c3ee8e1c5
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 01:40:29 2008 +0200

    Move rpccli_try_samr_connects out of rpcclient.
    
    Guenther
    (cherry picked from commit f550cdb6f240830ee1e3a2dfe5f4128bca0cf836)

commit 7d20487f9629f1eeb6da5a07a3d6fe9bb043b943
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 4 01:44:43 2008 +0200

    Always uppercase cli->srv_name_slash.
    
    Not that I think it is of any importance...
    
    Guenther
    (cherry picked from commit 352f8440c74bc22416e21783e1dc5fecf5869902)

commit f864e5877ca35ebba7ad5ff3c68704bddeaaccba
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 3 17:23:22 2008 +0200

    Fix pam_winbind macros.
    
    Guenther
    (cherry picked from commit 37091859126167e84e55afe8a32025ac0f65065e)

commit 7b6d0b061ac6af80335941aecc0415cf421f1a85
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 3 15:41:26 2008 +0200

    Use pwb_context in pam_winbind.
    
    Guenther
    (cherry picked from commit bf960f57e7adf09cdf096f2c72065ea1ff8b0daa)

commit b910b11200526120c13bfe4b0733ccaf20c8ba87
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 3 13:23:34 2008 +0200

    Add _pam_winbind_init/free_context.
    
    Guenther
    (cherry picked from commit d62676cf886d910334b3d6f7ce0147b75ef53aec)

commit f690263c7340677dc88b9b578ca8f388e0453a96
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 3 13:19:46 2008 +0200

    Add pwb_context to pam_winbind.h.
    
    Guenther
    (cherry picked from commit fe8acb064433b286938e0b572ca1faa8a54414b7)

commit b2bae33aa075464c1bb8dc595afab83d7a544123
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 3 13:06:14 2008 +0200

    Make more functions in pam_winbind static.
    
    Guenther
    (cherry picked from commit ea2175ee0e6288ccb132e86b9dd0bf8a0e4169c9)

commit 56fe7b02250df99142c9b62f8600b4829227a8dd
Author: Gerald W. Carter <jerry at samba.org>
Date:   Thu Mar 27 11:57:26 2008 -0500

    Only add WBFLAG_PAM_CONTACT_TRUSTDOM when performing a krb5 auth request.
    
    NTLM logons must go against our DC.
    (cherry picked from commit 2e24f7c0243c67a00102c11258cfa6f61caf499f)

commit 40306db45b667d92c76e8363b0153a5afca83465
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 28 13:37:25 2008 +0100

    Remove unneeded pack_dsdcinfo/unpack_dsdcinfo.
    
    Guenther
    (cherry picked from commit 34dd8f32e1b7fe256ab5dfde5ef5bb8abeec121a)

commit d6f7c6bfe1659c3491700c877cf44c4fda479e5c
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 28 13:36:31 2008 +0100

    Use NDR for netr_DsRGetDCNameInfo un-/marshalling in dsgetdcname.
    
    Guenther
    (cherry picked from commit 7fa53911054a39681df3f08d19aad92f60d59e28)

commit 19ae5d295c747358e8cfed6d9f7643b10aabdb3a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 28 13:31:40 2008 +0100

    Re-run make idl.
    
    Guenther
    (cherry picked from commit f8835462f2b88daa687edc79378511ffcb30905d)

commit 5eaee1824383f95c729e4cd8d1d4ece764a7850b
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 28 13:30:13 2008 +0100

    Make netr_DsRGetDCNameInfo public.
    
    Guenther
    (cherry picked from commit 62c876080c1f3afdd143d1f7f66529827b0f2990)

commit b82899c28642cfca0152f3262d8a0f96d46753f5
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 29 14:51:37 2008 +0100

    Pure cosmetics, trying to get my group policy diff smaller.
    
    Gunther
    (cherry picked from commit d7346e9360ffa97e44fa781293d32c707436193b)

commit 8b040235a6064231510227e3e98f5778bdd25d88
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:35:41 2008 +0100

    Use existing srv_name_slash.
    
    Guenther
    (cherry picked from commit 5f2b3145fcaeee58f285b6527e9fac09c5337e8a)

commit f67430b6a4a75c0f236690896a15d96e800cdf07
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:19:56 2008 +0100

    For convenience reasons, always create cli->srv_name_slash in the rpc_client.
    
    Guenther
    (cherry picked from commit 6363c383d6989d2dfb2ee488ffa7aeb128c5385b)

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

Summary of changes:
 WHATSNEW.txt                                       |    2 +
 source/Makefile.in                                 |    8 +-
 source/auth/auth_util.c                            |    2 +-
 source/include/client.h                            |    2 +
 source/include/doserr.h                            |    4 +
 source/lib/netapi/cm.c                             |  185 +++++
 source/lib/netapi/examples/Makefile.in             |   41 +-
 source/lib/netapi/examples/common.c                |   61 ++
 source/lib/netapi/examples/common.h                |   11 +
 source/lib/netapi/examples/dsgetdc/dsgetdc.c       |   89 +++
 source/lib/netapi/examples/getdc/getdc.c           |   45 +-
 .../examples/getjoinableous/getjoinableous.c       |   77 +--
 .../examples/netdomjoin-gui/netdomjoin-gui.c       |   14 +-
 source/lib/netapi/examples/netdomjoin/netdomjoin.c |   96 +--
 source/lib/netapi/examples/user/user_add.c         |  103 +++
 source/lib/netapi/examples/user/user_del.c         |   82 ++
 source/lib/netapi/examples/user/user_enum.c        |  100 +++
 source/lib/netapi/getdc.c                          |  207 ++----
 source/lib/netapi/joindomain.c                     |  553 ++++-----------
 source/lib/netapi/libnetapi.c                      |  587 +++++++++++++++
 source/lib/netapi/libnetapi.h                      |  103 +++
 source/lib/netapi/netapi.c                         |   12 +-
 source/lib/netapi/netapi.h                         |  213 ++++--
 source/lib/netapi/netapi_private.h                 |   36 +
 source/lib/netapi/serverinfo.c                     |  230 ++-----
 source/lib/netapi/user.c                           |  709 +++++++++++++++++
 source/lib/util.c                                  |    8 +
 source/lib/util_sid.c                              |    9 +-
 source/libgpo/gpo_fetch.c                          |   35 +-
 source/libgpo/gpo_filesync.c                       |    4 +-
 source/libgpo/gpo_ini.c                            |    4 +-
 source/libgpo/gpo_ldap.c                           |   12 +-
 source/libgpo/gpo_sec.c                            |    8 +-
 source/librpc/gen_ndr/cli_lsa.c                    |   26 +-
 source/librpc/gen_ndr/cli_lsa.h                    |   10 +-
 source/librpc/gen_ndr/libnetapi.h                  |  237 ++++++
 source/librpc/gen_ndr/lsa.h                        |   10 +-
 source/librpc/gen_ndr/ndr_libnetapi.c              |  717 ++++++++++++++++++
 source/librpc/gen_ndr/ndr_libnetapi.h              |   85 +++
 source/librpc/gen_ndr/ndr_lsa.c                    |  207 ++++--
 source/librpc/gen_ndr/ndr_netlogon.c               |    4 +-
 source/librpc/gen_ndr/ndr_netlogon.h               |    2 +
 source/librpc/gen_ndr/netlogon.h                   |    2 +-
 source/librpc/gen_ndr/srv_lsa.c                    |   10 +-
 source/librpc/idl/libnetapi.idl                    |  136 ++++
 source/librpc/idl/lsa.idl                          |   20 +-
 source/librpc/idl/netlogon.idl                     |    2 +-
 source/libsmb/cliconnect.c                         |    7 +
 source/libsmb/clidfs.c                             |   53 ++-
 source/libsmb/dsgetdcname.c                        |  186 +----
 source/nsswitch/pam_winbind.c                      |  793 ++++++++++----------
 source/nsswitch/pam_winbind.h                      |   31 +-
 source/rpc_client/cli_lsarpc.c                     |    3 +-
 source/rpc_client/cli_samr.c                       |   68 ++-
 source/rpc_server/srv_samr_nt.c                    |   71 ++-
 source/rpcclient/cmd_lsarpc.c                      |   12 +-
 source/rpcclient/cmd_samr.c                        |  176 ++---
 source/rpcclient/cmd_srvsvc.c                      |    4 +-
 source/utils/net_rpc.c                             |   16 +-
 source/utils/net_util.c                            |    7 -
 source/winbindd/winbindd_pam.c                     |    2 +-
 source/winbindd/winbindd_util.c                    |   50 +-
 62 files changed, 4762 insertions(+), 1837 deletions(-)
 create mode 100644 source/lib/netapi/cm.c
 create mode 100644 source/lib/netapi/examples/common.c
 create mode 100644 source/lib/netapi/examples/common.h
 create mode 100644 source/lib/netapi/examples/dsgetdc/dsgetdc.c
 create mode 100644 source/lib/netapi/examples/user/user_add.c
 create mode 100644 source/lib/netapi/examples/user/user_del.c
 create mode 100644 source/lib/netapi/examples/user/user_enum.c
 create mode 100644 source/lib/netapi/libnetapi.c
 create mode 100644 source/lib/netapi/libnetapi.h
 create mode 100644 source/lib/netapi/netapi_private.h
 create mode 100644 source/lib/netapi/user.c
 create mode 100644 source/librpc/gen_ndr/libnetapi.h
 create mode 100644 source/librpc/gen_ndr/ndr_libnetapi.c
 create mode 100644 source/librpc/gen_ndr/ndr_libnetapi.h
 create mode 100644 source/librpc/idl/libnetapi.idl


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 114a50c..1338ea1 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -226,6 +226,8 @@ o   Guenther Deschner <gd at samba.org>
     * Fix build targets for bin/net.
     * Fix _dssetup_DsRoleGetPrimaryDomainInformation().
     * Fix the build of cifs.spnego.
+    * Migration of the SRVSVC client and server DCE/RPC code to IDL
+      based structures and autogenerated code
 
 
 o   Volker Lendecke <vl at samba.org>
diff --git a/source/Makefile.in b/source/Makefile.in
index 0e81ee4..7bcb9c9 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -808,9 +808,13 @@ CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
 	     $(DISPLAY_SEC_OBJ) 
 
 LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
+		 lib/netapi/cm.o \
+		 librpc/gen_ndr/ndr_libnetapi.o \
+		 lib/netapi/libnetapi.o \
 		 lib/netapi/joindomain.o \
 		 lib/netapi/serverinfo.o \
-		 lib/netapi/getdc.o
+		 lib/netapi/getdc.o \
+		 lib/netapi/user.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
 		 $(LIBSMBCONF_OBJ) \
@@ -1174,7 +1178,7 @@ modules: SHOWFLAGS $(MODULES)
 IDL_FILES = lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
 	srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
 	epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
-	dssetup.idl krb5pac.idl ntsvcs.idl
+	dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl
 
 idl:
 	@IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index a95a59e..7013285 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -1620,7 +1620,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 	nt_status = sid_array_from_info3(result, info3,
 					 &result->sids,
 					 &result->num_sids,
-					 False);
+					 false, false);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		TALLOC_FREE(result);
 		return nt_status;
diff --git a/source/include/client.h b/source/include/client.h
index 52dc513..0e73745 100644
--- a/source/include/client.h
+++ b/source/include/client.h
@@ -123,6 +123,7 @@ struct cli_state {
 	int privileges;
 
 	fstring desthost;
+	fstring srv_name_slash;
 
 	/* The credentials used to open the cli_state connection. */
 	fstring domain;
@@ -241,5 +242,6 @@ typedef struct file_info {
 #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001
 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002
 #define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004
+#define CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS 0x0008
 
 #endif /* _CLIENT_H */
diff --git a/source/include/doserr.h b/source/include/doserr.h
index 5794fbe..d5892c1 100644
--- a/source/include/doserr.h
+++ b/source/include/doserr.h
@@ -270,6 +270,10 @@
 #define NERR_BASE (2100)
 #endif
 
+#ifndef MAX_NERR
+#define MAX_NERR (NERR_BASE+899)
+#endif
+
 #define WERR_DFS_NO_SUCH_VOL            W_ERROR(NERR_BASE+562)
 #define WERR_DFS_NO_SUCH_SHARE          W_ERROR(NERR_BASE+565)
 #define WERR_DFS_NO_SUCH_SERVER         W_ERROR(NERR_BASE+573)
diff --git a/source/lib/netapi/cm.c b/source/lib/netapi/cm.c
new file mode 100644
index 0000000..9608724
--- /dev/null
+++ b/source/lib/netapi/cm.c
@@ -0,0 +1,185 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  NetApi Support
+ *  Copyright (C) Guenther Deschner 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 "lib/netapi/netapi.h"
+#include "lib/netapi/netapi_private.h"
+
+/********************************************************************
+********************************************************************/
+
+WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
+				     const char *server_name,
+				     struct cli_state **cli)
+{
+	struct cli_state *cli_ipc = NULL;
+
+	if (!ctx || !cli || !server_name) {
+		return WERR_INVALID_PARAM;
+	}
+
+	cli_cm_set_signing_state(Undefined);
+	cli_cm_set_use_kerberos();
+
+	if (ctx->password) {
+		cli_cm_set_password(ctx->password);
+	}
+	if (ctx->username) {
+		cli_cm_set_username(ctx->username);
+	}
+
+	if (ctx->username && ctx->username[0] &&
+	    ctx->password && ctx->password[0]) {
+		cli_cm_set_fallback_after_kerberos();
+	}
+
+	cli_ipc = cli_cm_open(ctx, NULL,
+			      server_name, "IPC$",
+			      false, false);
+	if (!cli_ipc) {
+		libnetapi_set_error_string(ctx,
+			"Failed to connect to IPC$ share on %s", server_name);
+		return WERR_CAN_NOT_COMPLETE;
+	}
+
+	*cli = cli_ipc;
+
+	return WERR_OK;
+}
+
+/********************************************************************
+********************************************************************/
+
+WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx)
+{
+	cli_cm_shutdown();
+
+	return WERR_OK;
+}
+
+/********************************************************************
+********************************************************************/
+
+struct client_pipe_connection {
+	struct client_pipe_connection *prev, *next;
+	struct rpc_pipe_client *pipe;
+};
+
+static struct client_pipe_connection *pipe_connections;
+
+/********************************************************************
+********************************************************************/
+
+static struct rpc_pipe_client *pipe_cm_find(struct cli_state *cli,
+					    int pipe_idx,
+					    NTSTATUS *status)
+{
+	struct client_pipe_connection *p;
+
+	for (p = pipe_connections; p; p = p->next) {
+
+		if (!p->pipe->cli) {
+			*status = NT_STATUS_PIPE_EMPTY;
+			return NULL;
+		}
+
+		if (strequal(cli->desthost, p->pipe->cli->desthost) &&
+		    pipe_idx == p->pipe->pipe_idx) {
+			*status = NT_STATUS_OK;
+			return p->pipe;
+		}
+	}
+
+	*status = NT_STATUS_PIPE_NOT_AVAILABLE;
+
+	return NULL;
+}
+
+/********************************************************************
+********************************************************************/
+
+static struct rpc_pipe_client *pipe_cm_connect(TALLOC_CTX *mem_ctx,
+					       struct cli_state *cli,
+					       int pipe_idx,
+					       NTSTATUS *status)
+{
+	struct client_pipe_connection *p;
+
+	p = TALLOC_ZERO_ARRAY(mem_ctx, struct client_pipe_connection, 1);
+	if (!p) {
+		*status = NT_STATUS_NO_MEMORY;
+		return NULL;
+	}
+
+	p->pipe = cli_rpc_pipe_open_noauth(cli, pipe_idx, status);
+	if (!p->pipe) {
+		TALLOC_FREE(p);
+		return NULL;
+	}
+
+	DLIST_ADD(pipe_connections, p);
+
+	return p->pipe;
+}
+
+/********************************************************************
+********************************************************************/
+
+static struct rpc_pipe_client *pipe_cm_open(TALLOC_CTX *ctx,
+					    struct cli_state *cli,
+					    int pipe_idx,
+					    NTSTATUS *status)
+{
+	struct rpc_pipe_client *p;
+
+	p = pipe_cm_find(cli, pipe_idx, status);
+	if (!p) {
+		p = pipe_cm_connect(ctx, cli, pipe_idx, status);
+	}
+
+	return p;
+}
+
+/********************************************************************
+********************************************************************/
+
+WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
+			   struct cli_state *cli,
+			   int pipe_idx,
+			   struct rpc_pipe_client **pipe_cli)
+{
+	NTSTATUS status;
+
+	if (!cli || !pipe_cli) {
+		return WERR_INVALID_PARAM;
+	}
+
+	*pipe_cli = pipe_cm_open(ctx, cli, pipe_idx, &status);
+	if (!*pipe_cli) {
+		libnetapi_set_error_string(ctx, "failed to open PIPE %s: %s",
+			cli_get_pipe_name(pipe_idx),
+			get_friendly_nt_error_msg(status));
+		return WERR_DEST_NOT_FOUND;
+	}
+
+	return WERR_OK;
+}
+
+
diff --git a/source/lib/netapi/examples/Makefile.in b/source/lib/netapi/examples/Makefile.in
index 000eef1..84a8ecf 100644
--- a/source/lib/netapi/examples/Makefile.in
+++ b/source/lib/netapi/examples/Makefile.in
@@ -10,15 +10,21 @@ CC=@CC@
 PICFLAG=@PICFLAG@
 LDFLAGS=@PIE_LDFLAGS@ @LDFLAGS@
 DYNEXP=@DYNEXP@
+NETAPI_LIBS=$(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+CMDLINE_LIBS=$(NETAPI_LIBS) @POPTLIBS@
 
 # Compile a source file.
 COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@
 COMPILE = $(COMPILE_CC)
 
 PROGS = bin/getdc at EXEEXT@ \
+	bin/dsgetdc at EXEEXT@ \
 	bin/netdomjoin at EXEEXT@ \
 	bin/netdomjoin-gui at EXEEXT@ \
-	bin/getjoinableous at EXEEXT@
+	bin/getjoinableous at EXEEXT@ \
+	bin/user_add at EXEEXT@ \
+	bin/user_del at EXEEXT@ \
+	bin/user_enum at EXEEXT@
 
 all: $(PROGS)
 
@@ -46,27 +52,48 @@ bin/.dummy:
 		echo "$(COMPILE_CC)" 1>&2;\
 		$(COMPILE_CC) >/dev/null 2>&1
 
-GETDC_OBJ = getdc/getdc.o
-NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o
+CMDLINE_OBJ = common.o
+GETDC_OBJ = getdc/getdc.o $(CMDLINE_OBJ)
+DSGETDC_OBJ = dsgetdc/dsgetdc.o $(CMDLINE_OBJ)
+NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o $(CMDLINE_OBJ)
 NETDOMJOIN_GUI_OBJ = netdomjoin-gui/netdomjoin-gui.o
-GETJOINABLEOUS_OBJ = getjoinableous/getjoinableous.o
+GETJOINABLEOUS_OBJ = getjoinableous/getjoinableous.o $(CMDLINE_OBJ)
+USERADD_OBJ = user/user_add.o $(CMDLINE_OBJ)
+USERDEL_OBJ = user/user_del.o $(CMDLINE_OBJ)
+USERENUM_OBJ = user/user_enum.o $(CMDLINE_OBJ)
 
 bin/getdc at EXEEXT@: $(BINARY_PREREQS) $(GETDC_OBJ)
 	@echo Linking $@
-	@$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+	@$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
+
+bin/dsgetdc at EXEEXT@: $(BINARY_PREREQS) $(DSGETDC_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(DSGETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
 
 bin/getjoinableous at EXEEXT@: $(BINARY_PREREQS) $(GETJOINABLEOUS_OBJ)
 	@echo Linking $@
-	@$(CC) $(FLAGS) -o $@ $(GETJOINABLEOUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+	@$(CC) $(FLAGS) -o $@ $(GETJOINABLEOUS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
 
 bin/netdomjoin at EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_OBJ)
 	@echo Linking $@
-	@$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+	@$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
 
 bin/netdomjoin-gui at EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_GUI_OBJ)
 	@echo Linking $@
 	@$(CC) $(FLAGS) $(GTK_FLAGS) -o $@ $(NETDOMJOIN_GUI_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(GTK_LIBS)
 
+bin/user_add at EXEEXT@: $(BINARY_PREREQS) $(USERADD_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(USERADD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
+
+bin/user_del at EXEEXT@: $(BINARY_PREREQS) $(USERDEL_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(USERDEL_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
+
+bin/user_enum at EXEEXT@: $(BINARY_PREREQS) $(USERENUM_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(USERENUM_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
+
 clean:
 	-rm -f $(PROGS)
 	-rm -f core */*~ *~ \
diff --git a/source/lib/netapi/examples/common.c b/source/lib/netapi/examples/common.c
new file mode 100644
index 0000000..2c3e4d7
--- /dev/null
+++ b/source/lib/netapi/examples/common.c
@@ -0,0 +1,61 @@
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <inttypes.h>
+
+#include <popt.h>
+#include <netapi.h>
+
+void popt_common_callback(poptContext con,
+			 enum poptCallbackReason reason,
+			 const struct poptOption *opt,
+			 const char *arg, const void *data)
+{
+	struct libnetapi_ctx *ctx = NULL;
+
+	libnetapi_getctx(&ctx);
+
+	if (reason == POPT_CALLBACK_REASON_PRE) {
+	}
+
+	if (reason == POPT_CALLBACK_REASON_POST) {
+	}
+
+	if (!opt) {
+		return;
+	}
+	switch (opt->val) {
+		case 'U': {
+			char *puser = strdup(arg);
+			char *p = NULL;
+
+			if ((p = strchr(puser,'%'))) {
+				size_t len;
+				*p = 0;
+				libnetapi_set_username(ctx, puser);
+				libnetapi_set_password(ctx, p+1);
+				len = strlen(p+1);
+				memset(strchr(arg,'%')+1,'X',len);
+			} else {
+				libnetapi_set_username(ctx, puser);
+			}
+			free(puser);
+			break;
+		}
+		case 'd':
+			libnetapi_set_debuglevel(ctx, arg);
+			break;
+		case 'p':
+			libnetapi_set_password(ctx, arg);
+			break;
+	}
+}
+
+struct poptOption popt_common_netapi_examples[] = {
+	{ NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_callback },
+	{ "user", 'U', POPT_ARG_STRING, NULL, 'U', "Username used for connection", "USERNAME" },
+	{ "password", 'p', POPT_ARG_STRING, NULL, 'p', "Password used for connection", "PASSWORD" },
+	{ "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Debuglevel", "DEBUGLEVEL" },
+	POPT_TABLEEND
+};
+
diff --git a/source/lib/netapi/examples/common.h b/source/lib/netapi/examples/common.h
new file mode 100644
index 0000000..85df51d
--- /dev/null
+++ b/source/lib/netapi/examples/common.h
@@ -0,0 +1,11 @@
+#include <popt.h>
+
+void popt_common_callback(poptContext con,
+			 enum poptCallbackReason reason,
+			 const struct poptOption *opt,
+			 const char *arg, const void *data);
+
+extern struct poptOption popt_common_netapi_examples[];
+
+#define POPT_COMMON_LIBNETAPI_EXAMPLES { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netapi_examples, 0, "Common samba netapi example options:", NULL },
+
diff --git a/source/lib/netapi/examples/dsgetdc/dsgetdc.c b/source/lib/netapi/examples/dsgetdc/dsgetdc.c
new file mode 100644
index 0000000..7c0ec4d
--- /dev/null
+++ b/source/lib/netapi/examples/dsgetdc/dsgetdc.c
@@ -0,0 +1,89 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  DsGetDcName query
+ *  Copyright (C) Guenther Deschner 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 <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <netapi.h>
+
+#include "common.h"
+
+int main(int argc, const char **argv)
+{
+	NET_API_STATUS status;
+	struct libnetapi_ctx *ctx = NULL;
+
+	const char *hostname = NULL;
+	const char *domain = NULL;
+	struct DOMAIN_CONTROLLER_INFO *info = NULL;
+
+	poptContext pc;
+	int opt;
+
+	struct poptOption long_options[] = {
+		POPT_AUTOHELP
+		POPT_COMMON_LIBNETAPI_EXAMPLES
+		POPT_TABLEEND
+	};
+
+	status = libnetapi_init(&ctx);
+	if (status != 0) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list