1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

2472 Commits

Author SHA1 Message Date
Volker Lendecke
45934af498 Remove one reference to PI_LSARPC
(This used to be commit 40247e8d3d)
2008-07-21 14:36:30 +02:00
Volker Lendecke
e0be03d8d5 Refactoring: Change calling conventions for cli_rpc_pipe_open_ntlmssp
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit a13f059955)
2008-07-20 17:37:11 +02:00
Volker Lendecke
1335da2a7c Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 9abc9dc4dc)
2008-07-20 17:37:11 +02:00
Andreas Schneider
c400d0a0af Use the macro to call samba_version_string().
Signed-off-by: Andreas Schneider <anschneider@suse.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit d2682295f5)
2008-07-17 14:16:33 +02:00
Derrell Lipman
cd90c85bab The compatibility function also should have a const buffer pointer
(This used to be commit b731447ec5)
2008-07-16 10:45:09 -04:00
Andreas Schneider
43892abff6 The buf in the smbclient write function should be const.
As we try to provide POSIX function, we should use const like all other
POSIX function.

Signed-off-by: Andreas Schneider <anschneider@suse.de>
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
(This used to be commit 36e5df5954)
2008-07-16 10:41:43 -04:00
Derrell Lipman
db7bff1bab Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into v3-3-test
(This used to be commit 11d74fc51c)
2008-07-16 09:48:23 -04:00
Derrell Lipman
a49f6f17c6 Fix typos.
libsmbclient doesn't have bool defined; rather it uses smbc_bool

Derrell
(This used to be commit e1ade80f46)
2008-07-16 09:45:02 -04:00
Andreas Schneider
525a3f3c49 Release still reachable memory if the smbclient context is freed.
Signed-off-by: Andreas Schneider <anschneider@suse.de>
(This used to be commit 7a65053bc8)
2008-07-15 17:13:17 -07:00
Günther Deschner
1939177582 fix build warning.
Guenther
(This used to be commit 5076607069)
2008-07-15 23:06:48 +02:00
Volker Lendecke
d3def9a18c Revert "Pass NULL to gencache_get when we are not interested in the timeout value"
This reverts commit 16062dfc3d.
(This used to be commit 114ca85775)
2008-07-11 17:53:25 +02:00
Volker Lendecke
d670d0a09b Revert "Remove gencache_[un]lock_entry"
This reverts commit 7a5a575ffe.
(This used to be commit 62e444dd50)
2008-07-11 17:53:25 +02:00
Derrell Lipman
31262a59bc [BUG 5580] Allow access to DFS shares via libsmbclient
Brian Sheehan provided a nice patch intended for the 3.0 code base.  This
commit applies a similar patch for the 3.3 code base.  It adds a new public
function to libsmbclient -- smbc_set_credentials() -- that may be called from
the authentication callback when DFS referrals are in use.

Derrell
(This used to be commit 888f922bd0)
2008-07-08 20:44:39 -04:00
Volker Lendecke
352b5c1857 Remove gencache_[un]lock_entry
Günther agreed that it might be unnecessary in dsgetdcname_cache_store() :-)
(This used to be commit 7a5a575ffe)
2008-07-03 16:40:46 +02:00
Volker Lendecke
962beb2872 Pass NULL to gencache_get when we are not interested in the timeout value
(This used to be commit 16062dfc3d)
2008-07-03 15:17:58 +02:00
Jeremy Allison
4a09c5a09f Two more fixes from Jim Brown <jim.brown@miami.edu> for SGI compiler warnings.
Jeremy.
(This used to be commit d85cbdbe29)
2008-07-01 15:39:41 -07:00
Jeremy Allison
23cafd02d3 Fix return of uninitialized variable.
Jeremy.
(This used to be commit 384052f546)
2008-06-26 13:19:40 -07:00
Günther Deschner
5a4cf3dbf2 errors: add WERR_DS_DRA_BAD_NC and WERR_DS_DRA_BAD_DN.
Guenther
(This used to be commit 2efe18f7c9)
2008-06-26 10:24:02 +02:00
Günther Deschner
059293cbf4 rename rpccli_samr_chgpasswd_user to rpccli_samr_chgpasswd_user2.
Guenther
(This used to be commit 5b4650d56c)
2008-06-25 23:58:50 +02:00
Günther Deschner
9a5fc5b5d3 crypto: add decrypt_drsuapi_blob from samba4.
Guenther
(This used to be commit 3b6352a60e)
2008-06-24 23:44:20 +02:00
Günther Deschner
640a2972c5 kerberos: add smb_krb5_keytab_name().
Guenther
(This used to be commit c273ce8798)
2008-06-24 23:34:17 +02:00
Günther Deschner
0ac8c5d49a kerberos: make smb_krb5_kt_add_entry public, allow to pass keys without salting them.
Guenther
(This used to be commit 7c4da23be1)
2008-06-24 23:34:05 +02:00
Günther Deschner
fd288b4110 clikrb5: remove unrequired create_kerberos_key_from_string_direct() prototype.
Guenther
(This used to be commit ec86852fc6)
2008-06-17 19:51:52 +02:00
Günther Deschner
513bc4e791 dsgetdcname: allow to use NULL mem_ctx.
Guenther
(This used to be commit d20353d30c)
2008-06-17 19:51:24 +02:00
Volker Lendecke
dd30dd2a14 Fix a crash in add_failed_connection_entry
(This used to be commit 2a689aa66a)
2008-06-07 08:16:23 +02:00
Volker Lendecke
a191f3d2fe Make the gencache based conncache use talloc_tos()
(This used to be commit f7f912a478)
2008-06-07 08:16:23 +02:00
Marc VanHeyningen
d4cbc4408e Negative conn cache uses gencache
(This used to be commit 8765eb8ad7)
2008-06-07 08:16:23 +02:00
Jeremy Allison
48a2a3780b More correct fix (hopefully :-) for any memory leaks.
Jerry promised to check :-). Vl also please review.
Jeremy.
(This used to be commit 8abc6e7421)
2008-06-05 14:27:26 -07:00
Jeremy Allison
1c0a9759b9 Fix bug reported by David Eisner <deisner@gmail.com>. When allocating cli
buffers for large read/write - make sure we take account of the large
read/write SMB headers as well as the buffer space.
Jeremy.
(This used to be commit 19519bca9b)
2008-06-02 18:37:16 -07:00
Günther Deschner
39101acba5 errors: add more WERRORs.
Guenther
(This used to be commit 973de861c9)
2008-06-03 01:27:44 +02:00
Günther Deschner
ff7b8bcebf doserr: Add WERR_GROUP_EXISTS and WERR_SPECIAL_ACCOUNT.
Guenther
(This used to be commit 058cf7001e)
2008-06-03 01:27:40 +02:00
Chere Zhou
70b37891f9 minor memory leak fix
(This used to be commit 0c61631f34)
2008-05-30 17:55:14 -07:00
Jeremy Allison
d36434f312 Security fix for CVE-2008-1105: Boundary failure when parsing SMB responses
can result in a buffer overrun.
Jeremy.
(This used to be commit 23b825e9d2)
2008-05-28 09:31:42 -07:00
Jeremy Allison
d5d4a9511d Memory leak fixes from Chere Zhou <czhou@isilon.com>.
Jeremy.
(This used to be commit 201bcc8ed2)
2008-05-27 12:27:57 -07:00
Günther Deschner
c73cc63e92 dsgetdcname: use family (instead of sa_family).
Guenther
(This used to be commit 355fb81e9e)
2008-05-27 11:40:50 +02:00
Günther Deschner
372a6c0360 doserr: add WERR_REVISION_MISMATCH.
Guenther
(This used to be commit 017ad275e5)
2008-05-27 11:01:30 +02:00
Volker Lendecke
aacfa7b3ad Fix two bogus uninitalized variable warnings
(This used to be commit 194ea682d9)
2008-05-25 13:53:44 +02:00
Günther Deschner
6b3bcb3724 drsuapi: add all code required for our drsuapi rpc client.
Guenther
(This used to be commit 7c93190843)
2008-05-23 23:56:21 +02:00
Gerald W. Carter
4d2f71e53f Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e97977
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Wed May 7 13:34:26 2008 -0700

      spnego SPN fix when contacting trusted domains

      cli_session_setup_spnego() was not taking into consideration the situation
      where we're connecting to a trusted domain, specifically one (like W2K8)
      which doesn't return a SPN in the NegTokenInit.

      This caused two problems:

      1) When guessing the SPN using kerberos_get_default_realm_from_ccache() we
      were always using our default realm, not the realm of the domain we're
      connecting to.

      2) When falling back on NTLMSSP for authentication we were passing the name
      of the domain we're connecting to for use in our credentials when we should be
      passing our own workgroup name.

      The fix for both was to split the single "domain" parameter into
      "user_domain" and "dest_realm" parameters.  We use the "user_domain"
      parameter to pass into the NTLM call, and we used "dest_realm" to create an SPN
      if none was returned in the NegTokenInit2 packet.  If no "dest_realm" is
      provided we assume we're connecting to our own domain and use the credentials
      cache to build the SPN.

      Since we have a reasonable guess at the SPN, I removed the check that defaults
      us directly to NTLM when negHint is empty.
(This used to be commit b78b14c88e)
2008-05-23 16:01:45 -05:00
Jeremy Allison
b04bcefc58 Fix bug #5479, print spool shares require max_xmit to
be adhered to.
Jeremy.
(This used to be commit 478a359ede)
2008-05-21 12:39:08 -07:00
Volker Lendecke
e2d8b0a792 Fix some signed/unsigned warnings
(This used to be commit dbb4d8107a)
2008-05-20 23:06:38 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Günther Deschner
175cca1729 dsgetdcname: store client sitename for mailslot and cldap replies.
Guenther
(This used to be commit a01ed719c3)
2008-05-16 11:58:24 +02:00
Günther Deschner
4d593cdb19 dsgetdcname: add site support.
Guenther
(This used to be commit e305368538)
2008-05-15 16:59:46 +02:00
Günther Deschner
2e8b43c58d dsgetdcname: check for invalid sitename/flag combinations.
Guenther
(This used to be commit 255e509474)
2008-05-15 16:41:18 +02:00
Günther Deschner
5547e5a416 dsgetdcname: In case we didn't get a mailslot reply, don't cache the nodestatus.
Guenther
(This used to be commit 12e47be02f)
2008-05-14 09:45:39 +02:00
Günther Deschner
c49487805b mailslot: Also pick domain name and pdc name from type 15 cldap reply.
Guenther
(This used to be commit 836877c400)
2008-05-14 09:45:39 +02:00
Volker Lendecke
44b7f672b8 Fix signing problem in the client with transs requests
This is a different fix than Jeremy put into 3-0-test with 040db1ce85 and other
branches with different hashes. Jeremy, I think your fix led to bug 5436, so I
reverted your fix. This fixes the original problem I found with the transs
requests for large rpc queries in a different way. Please check!

Thanks,

Volker
(This used to be commit c572d537e0)
2008-05-13 16:29:47 +02:00
Volker Lendecke
8ef2ada0ef Revert "Fix signing bug found by Volker. That one was *subtle*."
This reverts commit 816aea6c1a.
(This used to be commit e402e6508c)
2008-05-13 16:29:47 +02:00
Günther Deschner
1830d6b159 dsgetdcname: add reminder that we need to support ipv6 here once we know how.
Guenther
(This used to be commit 4b3617bf50)
2008-05-09 17:56:04 +02:00
Günther Deschner
d59cf703ba dsgetdcname: make use of nbt_cldap_netlogon_15.
Guenther
(This used to be commit 5b0eda98f3)
2008-05-09 17:41:50 +02:00
Günther Deschner
67c644aa59 dsgetdcname: use existing messaging_context if possible.
Guenther
(This used to be commit 7889516a38)
2008-05-09 14:59:20 +02:00
Günther Deschner
c58ab8f3b2 dsgetdcname: the forest name should never be empty.
Guenther
(This used to be commit 2c0a96f1e5)
2008-05-09 14:59:20 +02:00
Günther Deschner
e668cb4594 dsgetdcname: add map_dc_and_domain_names() for consolidating returned names.
Guenther
(This used to be commit eb7fee6e2a)
2008-05-09 14:59:19 +02:00
Günther Deschner
4bd94c8338 cldap: move out cldap object to fix the build.
Guenther
(This used to be commit 56be9c98d2)
2008-05-09 14:59:19 +02:00
Günther Deschner
5e24d83e41 dsgetdcname: fix gencache store for dsgetdcname().
While storing always a type 29 reply structure in gencache, we are now able to
deliver correct data according to return flags such as DS_RETURN_FLAT_NAME and
DS_RETURN_DNS_NAME out of the cached data from gencache.

Guenther
(This used to be commit c67b6dc0ca)
2008-05-09 14:59:19 +02:00
Günther Deschner
5d7a60afd8 dsgetdcname: pure cosmetics.
Guenther
(This used to be commit 4b56c294e8)
2008-05-09 14:59:19 +02:00
Günther Deschner
9adc40a38f dsgetdcname: simply call ourself with DS_FORCE_REDISCOVERY after cache expiry.
Guenther
(This used to be commit 847f258632)
2008-05-09 14:59:19 +02:00
Günther Deschner
8441681819 dsgetdcname: be more paranoid about the existance of an ip_address.
Guenther
(This used to be commit d13fe66f3d)
2008-05-09 14:59:19 +02:00
Günther Deschner
eaef936523 dsgetdcname: remove invalid assumption in discover_dc_dns().
Guenther
(This used to be commit f48b2e844b)
2008-05-09 14:59:19 +02:00
Günther Deschner
9be17e2187 dsgetdcname: mailslot replies are identical to the cldap ones, use cldap everywhere.
Guenther
(This used to be commit fe904ee77a)
2008-05-09 14:59:19 +02:00
Günther Deschner
926cc82897 dsgetdcname: wait a little longer for mailslot replies.
Guenther
(This used to be commit bc0d7a90dc)
2008-05-09 14:59:18 +02:00
Günther Deschner
9d99ef899c dsgetdcname: map additional flags to nt_version.
Guenther
(This used to be commit 1009123b86)
2008-05-09 14:59:18 +02:00
Günther Deschner
0354d00ddf dsgetdcname: use make_dc_info_from_cldap_reply() for cldap replies.
Guenther
(This used to be commit a3e5b073f0)
2008-05-09 14:59:18 +02:00
Günther Deschner
81aa670343 dsgetdcname: add make_dc_info_from_cldap_reply().
Guenther
(This used to be commit 9db2e50a20)
2008-05-09 14:59:18 +02:00
Günther Deschner
9b4ea32c2d dsgetdcname: add get_cldap_reply_server_flags().
Guenther
(This used to be commit 3c05c56d4c)
2008-05-09 14:59:18 +02:00
Günther Deschner
cdd9913c4a cldap: let ads_cldap_netlogon() return all possible cldap replies.
Guenther
(This used to be commit 6f9d5e1cc9)
2008-05-09 14:59:18 +02:00
Günther Deschner
64cb9461fb dsgetdcname: add pull_mailslot_cldap_reply().
Guenther
(This used to be commit 95fb01d870)
2008-05-09 14:59:18 +02:00
Günther Deschner
fcdee39988 dsgetdcname: add map_ds_flags_to_nt_version.
Guenther
(This used to be commit 1809ea22c3)
2008-05-09 14:59:18 +02:00
Günther Deschner
7b5ec90b72 dsgetdcname: remove invalid assumptions when using DNS for the DC query.
Guenther
(This used to be commit a81818ae54)
2008-05-07 14:09:41 +02:00
Günther Deschner
611d79d0ed build: fix the build w/o ldap.
Guenther
(This used to be commit a159ec5f1f)
2008-05-06 09:48:16 +02:00
Günther Deschner
1f6065765c mailslot/cldap: use nt_version bits in queries.
Guenther
(This used to be commit b261f06312)
2008-05-06 09:41:41 +02:00
Günther Deschner
5c02872a10 dsgetdcname: use correct dc name for name cache store.
Guenther
(This used to be commit ce1556d0fb)
2008-05-06 09:41:41 +02:00
Volker Lendecke
7245a8e3b8 Fix a C++ warning
(This used to be commit e7a4027acf)
2008-05-05 18:28:59 +02:00
Günther Deschner
4d8836ab96 Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
(This used to be commit d077ef64cd)
2008-05-05 16:59:53 +02:00
Günther Deschner
e7142ef180 ntlmssp: replace UNKNOWN_02000000 with NTLMSSP_NEGOTIATE_VERSION.
Guenther
(This used to be commit 2c41d69bcf)
2008-04-30 18:55:57 +02:00
Günther Deschner
d0411c19dc errors: add WERR_NOT_FOUND.
Guenther
(This used to be commit b9ac03bdfa)
2008-04-29 20:22:01 +02:00
Günther Deschner
dddac2bc8f errors: add WERR_INVALID_DOMAINNAME.
Guenther
(This used to be commit b11a5e70d3)
2008-04-25 14:49:31 +02:00
Volker Lendecke
9e9d40d097 Refactoring: Make cli_pipe_auth_data a pointer off rpc_pipe_client
(This used to be commit f665afaaa3)
2008-04-25 11:12:50 +02:00
Günther Deschner
051ff45c60 mailslot/dsgetdcname: do what XP does and request nt_version 11.
This allows dsgetdcname to query for a flat, non-dns domain name and
come back with all information about the DC (site names, guid, forest,
etc.) based on a mailslot reply. The version 11 request is downgraded
to version 1 in case we do a query against NT4.

Guenther
(This used to be commit d8b2ff3c87)
2008-04-24 22:01:52 +02:00
Günther Deschner
b77601a4b7 mailslot: allow to give back struct nbt_ntlogon_packet.
Guenther
(This used to be commit 2b178dcae6)
2008-04-24 22:01:52 +02:00
Günther Deschner
012d678211 mailslot: make sure we are looking at the correct reply structure.
Guenther
(This used to be commit c6ce07fdf5)
2008-04-24 22:01:51 +02:00
Günther Deschner
e66d452466 mailslot: allow to define nt_version in send_getdc_request().
Guenther
(This used to be commit ce3728191b)
2008-04-24 22:01:51 +02:00
Günther Deschner
aba7809188 build: fix the build.
Guenther
(This used to be commit 09a0001063)
2008-04-22 00:06:57 +02:00
Günther Deschner
de9186ecc6 dsgetdcname: Fix discover_dc_dns().
Guenther
(This used to be commit ec86deb349)
2008-04-22 00:05:05 +02:00
Günther Deschner
bd3991ac97 dsgetdcname: add very basic flat name support.
Guenther
(This used to be commit bb72d0b71e)
2008-04-22 00:04:25 +02:00
Volker Lendecke
b78453326b Remove the "pwd" struct from rpc_pipe_client
The only user of this was decrypt_trustdom_secret, and this only needs the NT
hash anyway.
(This used to be commit 3d8c2a47e6)
2008-04-21 23:36:05 +02:00
Günther Deschner
bcbac69d1a cldap: avoid duplicate definitions so remove ads_cldap.h.
Guenther
(This used to be commit 538eefe22a)
2008-04-21 20:21:40 +02:00
Günther Deschner
1dd7ab38e7 cldap: add talloc context to ads_cldap_netlogon().
Guenther
(This used to be commit 4cee7b1bd5)
2008-04-21 20:21:40 +02:00
Günther Deschner
ba98dd4989 libads: Use libnbt for CLDAP reply parsing.
Guenther
(This used to be commit 751f3064a5)
2008-04-21 20:21:39 +02:00
Günther Deschner
1eca3f138c winbind: pass down existing talloc context.
Guenther
(This used to be commit 675bf42cff)
2008-04-21 20:21:39 +02:00
Günther Deschner
937091161b winbind: Use libnbt for NTLOGON SAMLOGON mailslot request and reply.
Guenther
(This used to be commit 2d6a1c5da6)
2008-04-21 11:03:32 +02:00
Günther Deschner
b437f09595 samlogoncache: Use data_blob_const in netsamlogon_cache_get.
Guenther
(This used to be commit f27a20f25c)
2008-04-21 10:25:28 +02:00
Günther Deschner
e03321697e cli_cm: Make nicer password prompt in do_connect().
Guenther
(This used to be commit cc967e76a3)
2008-04-20 23:20:21 +02:00
Volker Lendecke
e73e8297f5 Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
(This used to be commit 99fc3283c4)
2008-04-20 14:08:16 +02:00
Volker Lendecke
f56eedb95c Remove the pipe_idx variable from rpc_pipe_client
(This used to be commit 4840febcd4)
2008-04-20 11:47:33 +02:00
Volker Lendecke
9048cafbea Move srv_name_slash from cli_state to rpc_pipe_client
(This used to be commit a9061e52e1)
2008-04-20 00:14:13 +02:00
Volker Lendecke
2a2188591b Add "desthost" to rpc_pipe_client
This reduces the dependency on cli_state
(This used to be commit 783afab9c8)
2008-04-20 00:13:09 +02:00
Volker Lendecke
b46d340fd5 Refactoring: Make struct rpc_pipe_client its own talloc parent
(This used to be commit a6d74a5a56)
2008-04-20 00:12:52 +02:00
Volker Lendecke
b7d2e94296 Fix bug 5399
Thanks to Jason Mader!

Volker
(This used to be commit 36740f4959)
2008-04-19 17:04:09 +02:00
Günther Deschner
bbded540b6 Move GETDC mailslot out of winbindd.
Guenther
(This used to be commit b003ba65e3)
2008-04-17 15:17:29 +02:00
Günther Deschner
f466e53b64 dsgetdcname: Fix discover_dc_dns.
Guenther
(This used to be commit 2fe416ffa5)
2008-04-17 00:08:24 +02:00
Günther Deschner
c1d4243c5a errors: Add WERR_NO_SUCH_USER.
Guenther
(This used to be commit 82803186fe)
2008-04-16 02:37:27 +02:00
Günther Deschner
44912a9fb9 errors: Add WERR_NONE_MAPPED.
Guenther
(This used to be commit dc165e1c80)
2008-04-16 02:23:20 +02:00
Günther Deschner
202e8cc57e doserr: Add WERR_INVALID_DOMAIN_STATE and WERR_INVALID_DOMAIN_ROLE.
Guenther
(This used to be commit 91a55fc27d)
2008-04-14 15:48:23 +02:00
Volker Lendecke
394150d269 Make use of ZERO_STRUCT instead of memset in namequery.c
(This used to be commit 4f1d49615e)
2008-04-14 13:13:46 +02:00
Günther Deschner
98abf71ff5 Add WERR_USER_ALREADY_EXISTS and WERR_PASSWORD_RESTRICTION.
Guenther
(This used to be commit eefd03d39b)
2008-04-12 18:30:14 +02:00
Tim Prouty
bb869741dd Cleanup size_t return values in convert_string_allocate
This patch is the first iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 59124382d2)
2008-04-11 11:33:33 +02:00
Günther Deschner
1db69e9180 Add some more cli_cm_set_X functions.
Guenther
(This used to be commit 882475f556)
2008-04-10 21:21:27 +02:00
Günther Deschner
e49200c1a2 Add CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS define.
This allows to switch on the cli->fallback_after_kerberos switch.

Guenther
(This used to be commit 15ba45e567)
2008-04-08 14:25:13 +02:00
Bill Ricker
f700ee6418 Fix Kerberos interop with Mac OS X 10.5 clients.
Ignore optional req_flags. Use the Kerberos mechanism OID negotiated
with the client rather than hardcoding OID_KERBEROS5_OLD.
(This used to be commit 59a2bcf30f)
2008-04-07 15:05:51 -07:00
James Peach
2dfec9e829 Use bool for BOOL and true/false for True/False. We need lowercase
bool to get the declarations picked up by the prototype parser.
(This used to be commit fd168e7b50)
2008-04-07 15:05:50 -07:00
Volker Lendecke
aa41d74843 Fix a misleading debug message
(This used to be commit 494b32197f)
2008-04-07 10:20:32 +02:00
Jeremy Allison
1a64916775 When using plaintext ucs2 passwords clistr_push calls ucs2_align, which causes
the space taken by the unicode password to be one byte too
long (as we're on an odd byte boundary here). Reduce the
count by 1 to cope with this. Fixes smbclient against NetApp
servers which can't cope. Fix from
bryan.kolodziej@allenlund.com in bug #3840.
Jeremy.
(This used to be commit 1e7e7d86a1)
2008-04-04 15:28:14 -07:00
Günther Deschner
69b23a39cd Always uppercase cli->srv_name_slash.
Not that I think it is of any importance...

Guenther
(This used to be commit 352f8440c7)
2008-04-04 01:44:43 +02:00
Günther Deschner
b028fd3f8c Add NT_STATUS_RPC_CANNOT_SUPPORT.
Guenther
(This used to be commit 9e15ce03ca)
2008-04-03 00:26:55 +02:00
Günther Deschner
da7863c4c9 Apply some const in clirap.
Guenther
(This used to be commit 8a1a9f967d)
2008-04-02 12:23:07 +02:00
Günther Deschner
99d3590455 Fix NETLOGON credential chain with Windows 2008 all over the place.
In order to avoid receiving NT_STATUS_DOWNGRADE_DETECTED from a w2k8
netr_ServerAuthenticate2 reply, we need to start with the AD netlogon negotiate
flags everywhere (not only when running in security=ads). Only for NT4 we need
to do a downgrade to the returned negotiate flags.

Tested with w2k8, w2ksp4, w2k3r2 and nt4sp6.

Guenther
(This used to be commit 0970369ca0)
2008-04-02 11:12:47 +02:00
Jeremy Allison
d1e99642f7 Fix bug #5326 - OS/2 servers give strange "high word" replies for print jobs.
Jeremy.
(This used to be commit d090d25cb7)
2008-03-28 10:12:07 -07:00
Michael Adam
9644b6cb50 Add a talloc context parameter to current_timestring() to fix memleaks.
current_timestring used to return a string talloced to talloc_tos().
When called by DEBUG from a TALLOC_FREE, this produced messages
"no talloc stackframe around, leaking memory". For example when
used from net conf.

This also adds a temporary talloc context to alloc_sub_basic().
For this purpose, the exit strategy is slightly altered: a common
exit point is used for success and failure.

Michael
(This used to be commit 16b5800d4e)
2008-03-28 16:34:51 +01:00
Volker Lendecke
8f6b03b673 More ssize_t->SMB_OFF_T
(This used to be commit 8dd6458049)
2008-03-28 15:32:02 +01:00
Günther Deschner
33a8e9b537 Check for buffer in decode_wkssvc_join_password_buffer.
Guenther
(This used to be commit 2134d80c05)
2008-03-28 14:15:20 +01:00
Günther Deschner
7f1a0a5cdf Remove unneeded pack_dsdcinfo/unpack_dsdcinfo.
Guenther
(This used to be commit 34dd8f32e1)
2008-03-28 13:37:25 +01:00
Günther Deschner
76a819c9c0 Use NDR for netr_DsRGetDCNameInfo un-/marshalling in dsgetdcname.
Guenther
(This used to be commit 7fa5391105)
2008-03-28 13:36:31 +01:00
Volker Lendecke
e6a1027757 Fix a valgrind error
In winbind, we're using the info3 struct to send it to the winbind client after
netsamlogon_cache_store. Without this info3->base.account_name.string was
prematurely freed.
(This used to be commit aa4377561b)
2008-03-25 23:36:13 +01:00
Volker Lendecke
4b3351e5dc On Solaris, size_t seems to be only 32 bit.
Fix bug 5341, thanks a lot to Karoly Vegh for testing it!

Volker
(This used to be commit 19eb8c9316)
2008-03-21 13:41:42 +01:00
Günther Deschner
fe1a6668c8 Add error mapping for WERR_SERVICE_NEVER_STARTED.
Guenther
(This used to be commit 818044d877)
2008-03-20 00:54:20 +01:00
Volker Lendecke
b2ec8372ba !NT_STATUS_IS_OK != NT_STATUS_IS_ERR
When reading from a pipe, Windows return STATUS_BUFFER_OVERFLOW which is *not*
an error.
(This used to be commit 24018d882d)
2008-03-19 22:38:13 +01:00
Volker Lendecke
16cbc22a99 Fix bug 5334
I did not test with a zero length file :-)
(This used to be commit 7d7a73944c)
2008-03-18 13:49:46 +01:00
Derrell Lipman
8b0783072a Fix use of AuthDataWithContext capability
During my initial plans for, and the subsequent discussion of a more
significant change to the API for libsmbclient, I had removed the
AuthDataWithContext usage, in favor of a more generalized planned interface.
When the API returned to its original state, I neglected to reinsert this
code.

Use of an authentication function with the context can be tested using

  examples/libsmbclient/testbrowse -C

Derrell
(This used to be commit 38eab68dfb)
2008-03-17 11:34:25 -04:00
Volker Lendecke
e2ab1a0f98 Fix Coverity ID 555
(This used to be commit 44122f06d0)
2008-03-15 22:30:25 +01:00
Günther Deschner
5e86a172a5 For convenience reasons, always create cli->srv_name_slash in the rpc_client.
Guenther
(This used to be commit 6363c383d6)
2008-03-12 16:19:56 +01:00
Günther Deschner
a6fa0ca321 Use rpccli_srvsvc_NetShareEnumAll in libsmbclient.
Guenther
(This used to be commit 6aad05f3f1)
2008-03-10 04:58:43 +01:00
Günther Deschner
d185fb48fb Remove insane amount of whitespace.
Guenther
(This used to be commit 8216310e9f)
2008-03-10 04:35:31 +01:00
Volker Lendecke
973734cde6 Correctly calculate the max read size
(This used to be commit f556c9e162)
2008-03-08 22:28:01 +01:00
Volker Lendecke
464f74df2f Move inbuf handling to before the PDU handling
In an error case, correctly discard the offending PDU
(This used to be commit 0aa195b5d6)
2008-03-08 22:02:33 +01:00
Volker Lendecke
8da1e033a8 Pass specific packets to build_nmb and build_dgram
To me it was not clear what parts of struct packet_struct are actually used in
build_packet(). This makes it a bit more clear that only the specific parts are
used.
(This used to be commit eb8b6f2404)
2008-03-08 12:31:21 +01:00
Volker Lendecke
6a2dbea794 Fix some typos
(This used to be commit cfa1b83814)
2008-03-08 12:31:21 +01:00
Derrell Lipman
914cd3e483 Eliminate global variable in_client and a plethora of extern declarations.
Derrell
(This used to be commit b7f34e7ef2)
2008-03-06 10:41:42 -05:00
Volker Lendecke
5eb347193f Fix a "nested extern declaration" warning
(This used to be commit e473e6d50c)
2008-03-06 15:50:46 +01:00
Derrell Lipman
5b80b9340f Check for NULL pointers before dereferencing them.
(This used to be commit 6f65390cec)
2008-03-06 09:00:37 -05:00
Volker Lendecke
a015227490 Convert cli_read to use cli_pull
(This used to be commit d69b20111a)
2008-03-06 13:28:23 +01:00
Volker Lendecke
6244578835 Add async cli_pull support
This is the big (and potentially controversial) one. It took a phone call to
explain to metze what is going on inside cli_pull_read_done, but I would really
like everybody to understand this function. It is a very good and reasonably
complex example of async programming. If we want more asynchronism in s3, this
is what we will have to deal with :-)

Make use of it in the smbclient "get" command.

Volker
(This used to be commit 76f9b360ee)
2008-03-06 13:28:23 +01:00
Volker Lendecke
1ea0a5d0cd Add infrastructure to support async SMB requests
(This used to be commit e215330135)
2008-03-06 13:28:23 +01:00
Volker Lendecke
e82c9d1c31 Check the right pointer for non-NULL
Fix Coverity ID 558, 559
(This used to be commit 8e33d19d93)
2008-03-06 11:33:26 +01:00
Derrell Lipman
1363ee9d65 Continued revamping of libsmbclient.
- James suggested using gcc's "deprecated" attribute to mark the context
  structure fields to generate warnings.  This creates a scenario with the
  best of all worlds.  I'm able to move to an organization that more easily
  allows future enhancements, while avoiding any mandatory changes by
  applications.  Thanks, James!

- Updated WHATSNEW.txt so that it accurately reflects the current state of
  affairs.

Derrell
(This used to be commit a67f96fbe9)
2008-03-03 18:13:33 -05:00
Derrell Lipman
fc65c6698e Return NULL, not 0, from a function which returns a pointer.
(This used to be commit 23cb9c49e3)
2008-03-01 21:19:52 -05:00
Derrell Lipman
223940d9a8 Additional revamped libsmbclient documentation
- Ensured that all public functions have documentation in libsmbclient.h
- Reformatted for "proper" indentation
- Re-added temporarily-disabled alternate authentication function capability

Derrell
(This used to be commit 64b7150d92)
2008-03-01 20:47:22 -05:00
Derrell Lipman
4ba42cbe0f Modified revamp of the libsmbclient interface.
Given the tacit (if that) approval by some people, and clear disapproval by
others for my proposed clean-up and reorganization of libsmbclient, I've come
up with a slightly different approach.  This commit changes back to the
original libsmbclient.h SMBCCTX structure which will maintain ABI
compatibility.  I retain, here, the setter and getter functions which all new
code should use.  Older programs already compiled should continue to work
fine.  Older programs being recompiled will encounter compile-time errors
(intentionally!) so that the code can be corrected to use the setter/getter
interfaces.

Although this doesn't clean up the interface in the way I had wanted, the code
reorganization and requirement for new programs to use the setters and getters
allows future progress to be made on libsmbclient without further muddying up
the interface, while retaining the ABI compatibility that was the big issue
causing disapproval.  I hope that this compromise is adequate.

Derrell
(This used to be commit 56429a3d60)
2008-03-01 20:47:22 -05:00
Derrell Lipman
257b7b0929 Initial revamp of the libsmbclient interface.
The libsmbclient interface has suffered from difficulty of improvement and
feature enrichment without causing ABI breakage.  Although there were a number
of issues, the primary ones were:

(a) the user of the library would manually manipulate the context structure
    members, meaning that nothing in the context structure could change other
    than adding stuff at the end;

(b) there were three methods of setting options: setting bits in a flags field
    within the context structure, setting explicit options variables within an
    options structure in the context structure, and by calling the
    smbc_option_set() function;

(c) the authentication callback did not traditionally provide enough
    information to the callee which required adding an option for a callback
    with a different signature, and now there are requests for even more
    information at the callback, requiring yet a third signature and option to
    set it (if we implement that feature).

This commit provides a reorganization of the code which fixes (a) and (b).
The context structure is now entirely opaque, and there are setter and getter
functions for manipulating it.  This makes maintaining ABI consistency much,
much easier.

Additionally, the options setting/getting has been unified into a single
mechanism using smbc_option_set() and smbc_option_get().

Yet to be completed is a refactoring of the authentication callback (c).

The test programs in examples/libsmbclient have been modified (if necessary;
some applications require no changes at all) for the new API and a few have
been minimally tested.

Derrell
(This used to be commit d4b4bae8de)
2008-03-01 20:47:22 -05:00
Volker Lendecke
45a877f392 Revert "Add infrastructure to support async SMB requests"
This reverts commit f535682569.
(This used to be commit 5f53a62be8)
2008-03-01 09:38:14 +01:00
Volker Lendecke
a34d158880 Revert "Add async cli_pull support"
This reverts commit 844a163458.
(This used to be commit 5ab1cfda50)
2008-03-01 09:38:14 +01:00
Volker Lendecke
342859edfc Revert "Convert cli_read to use cli_pull"
This reverts commit 719527f55e.
(This used to be commit ac301fada2)
2008-03-01 09:38:14 +01:00
Volker Lendecke
5e0d86c407 Restore 3.0 behaviour with empty /etc/hosts
Jeremy, in 3.0 we allowed get_mydnsdomname and get_mydnsfullname to fail
without filling in anything useful. Worked fine. Without this patch and a empty
/etc/hosts and no DNS configured, session setup would return
NT_STATUS_BAD_NETWORK_NAME. This is confusing at best, BAD_NETWORK_NAME afaik
is only ever returned from tcon normally.

This restores the 3.0 behaviour.

Comments?

Volker
(This used to be commit 2bd3b7d474)
2008-02-29 22:39:45 +01:00
Volker Lendecke
45615d6283 Check the right variable for being NULL
(This used to be commit f2c6780379)
2008-02-29 22:39:45 +01:00
Günther Deschner
bddceee09a Fix memleak in netsamlogon_cache_get().
Guenther
(This used to be commit b736c77dc6)
2008-02-28 23:15:11 +01:00
Volker Lendecke
95222d115a Convert cli_read to use cli_pull
(This used to be commit 719527f55e)
2008-02-28 15:27:55 +01:00
Volker Lendecke
525aac775e Add async cli_pull support
This is the big (and potentially controversial) one. It took a phone call to
explain to metze what is going on inside cli_pull_read_done, but I would really
like everybody to understand this function. It is a very good and reasonably
complex example of async programming. If we want more asynchronism in s3, this
is what we will have to deal with :-)

Make use of it in the smbclient "get" command.

Volker
(This used to be commit 844a163458)
2008-02-28 15:27:55 +01:00
Volker Lendecke
1d41b5bd2a Add infrastructure to support async SMB requests
(This used to be commit f535682569)
2008-02-28 15:27:55 +01:00
Jeremy Allison
6e2e0e2ce7 Fix the build - don't use SMB_TRANS_ENC_GSS without
KRB5.
Jeremy.
(This used to be commit d16c295642)
2008-02-28 06:01:09 -08:00
Volker Lendecke
be4a76a861 Add cli_setup_packet_buf
This is == cli_setup_packet but takes an explicit buffer argument
(This used to be commit f64b46dc27)
2008-02-28 14:20:17 +01:00
Volker Lendecke
57a9fba097 Make cli_struct a talloc parent
(This used to be commit e69244a5c8)
2008-02-28 14:20:17 +01:00
Günther Deschner
11b81cb8e4 Add WERR_TIME_SKEW to werror mapping tables.
Guenther
(This used to be commit 74767be627)
2008-02-28 14:10:53 +01:00
Volker Lendecke
b9f7dd2909 Add explicit buf arg to cli_check_sign_mac
(This used to be commit ffc1c8cc03)
2008-02-28 13:12:34 +01:00
Volker Lendecke
4b5169f590 Add explicit buf arg to cli_encrypt_message and cli_calculate_sign_mac
(This used to be commit db6ae9ed23)
2008-02-28 13:12:34 +01:00
Günther Deschner
0d8985f2da Let dsgetdcname() return a struct netr_DsRGetDCNameInfo.
Guenther
(This used to be commit b1a4b21f8c)
2008-02-28 12:40:55 +01:00
Jeremy Allison
1d940490e8 Fix from Guenter Kukkukk <linux@kukkukk.com> to fix listing against
OS/2 servers. OS/2 returns eclass == ERRDOS && ecode == ERRnofiles
for a zero entry directory listing.
Jeremy.
(This used to be commit b34da62705)
2008-02-28 02:22:13 -08:00
Günther Deschner
7269a504fd Add my copyright.
Guenther
(This used to be commit d078a87571)
2008-02-27 19:38:48 +01:00
Günther Deschner
2d01ec2c39 Use new LSA_POLICY defines in lsa rpc server code and other places.
Guenther
(This used to be commit 58cca9faf9)
2008-02-27 15:57:09 +01:00
Derrell Lipman
fa341d5262 add smbc_ftruncate() to emulate POSIX ftruncate()
(This used to be commit 6f5051b9c1)
2008-02-26 21:44:51 -05:00
Derrell Lipman
c58e7427bf add a function to truncate a file to a specified size
(This used to be commit 7e5752812d)
2008-02-26 21:42:26 -05:00
Volker Lendecke
3176392878 Fix some warnings
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
(This used to be commit ad37b7b0ae)
2008-02-25 16:09:26 +01:00
Volker Lendecke
a5e43bc817 Fix typo
(This used to be commit 621db68f32)
2008-02-23 21:40:39 +01:00
Volker Lendecke
6548493de7 Fix a C++ warning
(This used to be commit ac027a9b2e)
2008-02-23 11:04:13 +01:00
Tim Potter
441de75e58 Fix memory leaks on error path
(This used to be commit 47dd0700b4)
2008-02-20 18:27:40 -08:00
Günther Deschner
5b8ebcf397 Remove unused creds_client_check and creds_client_step.
Guenther
(This used to be commit 1dcb32424d)
2008-02-17 03:08:42 +01:00
Günther Deschner
c1793b2b31 Use new IDL based PAC structures in clikrb5.c
Guenther
(This used to be commit 3b0135d57e)
2008-02-17 02:11:59 +01:00
Günther Deschner
8027b7c25d Use netr_SamInfo3 in samlogon cache and use ndr functions for storing the blob.
Guenther
(This used to be commit bf860ae1ac)
2008-02-17 02:11:59 +01:00
Günther Deschner
dd65a34935 Use rpccli_netr_ServerPasswordSet in "just_change_the_password()".
Guenther
(This used to be commit 33f91c8944)
2008-02-16 16:04:01 +01:00
Günther Deschner
b6285fc052 Remove unused creds_server_check and creds_server_step.
Guenther
(This used to be commit 2fb73a3545)
2008-02-16 15:14:04 +01:00
Günther Deschner
3f24ef1848 Replace DOM_CHAL with "struct netr_Credential" where we can right now.
This allows to remove some more old netlogon client calls.

Guenther
(This used to be commit c0b1a87658)
2008-02-15 23:57:54 +01:00
Günther Deschner
f8bd3e82e5 Add netlogon_creds_server_check and netlogon_creds_server_step.
Guenther
(This used to be commit ea0bf74918)
2008-02-15 20:58:34 +01:00
Günther Deschner
401c0a6551 Add netlogon_creds_client_check and netlogon_creds_client_step.
Guenther
(This used to be commit 41d33a2507)
2008-02-15 14:04:55 +01:00
Jeremy Allison
39e0dbcf07 Allow the mechOID to be written separately.
Jeremy.
(This used to be commit e3e08c6e7d)
2008-02-14 11:29:54 -08:00
Günther Deschner
0ba3d44f73 Use rpccli_lsa_EnumTrustDom all over the place.
Guenther
(This used to be commit a25e7ffbca)
2008-02-13 00:29:37 +01:00
Volker Lendecke
b4dd60efa9 Add a missing return
If I'm not completely blind, we should return here. Not doing it here seems not
to be a major flaw, as far as I can see we're only missing the error code. This
might account for some of the very unhelpful NT_STATUS_UNSUCCESSFUL error
messages people see during joins.

All with stake in Samba client, please check!
(This used to be commit eadd15c936)
2008-02-11 18:37:58 +01:00
Jeremy Allison
20d6ebe813 We don't need the extra null termination - we've
already got this in the cli_receive_trans calls.
Jeremy.
(This used to be commit 99424bba7b)
2008-02-08 22:02:00 -08:00
Jeremy Allison
0b583e4329 Make clilist work again with OS/2 (kukks help!).
Jeremy.
(This used to be commit 2e27309401)
2008-02-08 19:02:49 -08:00
Jeremy Allison
73d838a2da From kukks - prevent crashes if finfo.name == NULL.
Jeremy.
(This used to be commit 101f194795)
2008-02-08 18:44:33 -08:00
Jeremy Allison
48ea5852b6 Try and fix length and finfo calls for older clients. Working
on issues reported by kukks.
Jeremy.
(This used to be commit dcd77dd4f4)
2008-02-08 11:22:53 -08:00
Jeremy Allison
c0e92cd4b8 Fix bug reported on IRC enumerating shares with OS/2.
Report and fix from kukks (thanks once again !).
Jeremy.
(This used to be commit 3ca58b792f)
2008-02-08 10:07:05 -08:00
Karolin Seeger
2a6a2288c5 Fix some typos.
Karolin
(This used to be commit 2bec0a1fb7)
2008-02-08 10:05:32 +01:00
Volker Lendecke
88c27f83d4 Convert receive_smb_raw to NTSTATUS
(This used to be commit ba771bd858)
2008-02-02 11:03:23 +01:00
Volker Lendecke
6ddfa6ae77 read_socket_with_timeout_ntstatus->read_socket_with_timeout
(This used to be commit 90554799af)
2008-02-02 11:03:22 +01:00
Volker Lendecke
5e43eeb1b6 Get rid of read_socket_with_timeout
(This used to be commit f9c8ac83ff)
2008-02-02 11:03:22 +01:00
Günther Deschner
5ab43ae0d8 Eliminate remote tree of dsgetdcname (which will happen in libnetapi then).
Guenther
(This used to be commit fd490d236b)
2008-01-29 15:09:56 +01:00
Tim Potter
54db183987 Adding missing calls to va_end().
Just a small commit to get a handle on this git thingy.  This patch
fixes some missing calls to va_end() to match various calls to va_start()
and VA_COPY().

Tim.
(This used to be commit ec367f307d)
2008-01-27 09:33:42 +01:00
Günther Deschner
372f74bba2 Add WERR_INVALID_COMPUTER_NAME.
Guenther
(This used to be commit cb1ff32eff)
2008-01-24 23:41:59 +01:00
Derrell Lipman
2e7e3095a6 Merge branch 'setxattr-dos-mode' into v3-2-test
(This used to be commit 4c08725a42)
2008-01-23 20:50:24 -05:00
Derrell Lipman
e0021b586d Allow clearing all settable DOS mode bits. A mode value of zero is ignored by
Windows.  If the requested mode is zero, we instead send the appropriate one
of 0x80 (NORMAL) or 0x10 (DIRECTORY).

Thanks Jeremy!

Derrell
(This used to be commit 54abf7d0e5)
2008-01-23 20:44:54 -05:00