1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

31015 Commits

Author SHA1 Message Date
Volker Lendecke
0beac794b6 s3: Fix some DEBUG messages 2010-01-31 15:40:59 +01:00
Jeremy Allison
687e4eba3c Fix bug #7079 - cliconnect gets realm wrong with trusted domains.
Passing NULL as dest_realm for cli_session_setup_spnego() was
always using our own realm (as for a NetBIOS name). Change this
to look for the mapped realm using krb5_get_host_realm() if
the destination machine name is a DNS name (contains a '.').
Could get fancier with DNS name detection (length, etc.) but
this will do for now.

Jeremy.
2010-01-30 19:24:28 -08:00
Steven Danneman
f42971c520 s3/smbd: Fix string buffer overflow causing heap corruption
The destname malloc size was not taking into account the 1 extra byte
needed if a string without a leading '/' was passed in and that slash
was added.

This would cause the '\0' byte to be written past the end of the
malloced destname string and corrupt whatever heap memory was there.

This problem would be hit if a share name was given in smb.conf without
a leading '/' and if it was the exact size of the allocated STRDUP memory
which in some implementations of malloc is a power of 2.
2010-01-30 13:38:31 -08:00
Jeremy Allison
1876b5a7e3 Fix a really interesting problem found by Volker's conversion of sessionsetup SPNEGO to asynchronous code.
Normally clistr_push_fn() can depend upon cli->outbuf being
initialized by negprot and sessionsetup packets, and cli->outbuf[smb_flgs2] being
correctly set with FLAGS2_UNICODE_STRINGS when cli_setup_packet() is called. When
all the sessionsetups are async, then cli_setup_packet() is never called, the async
code uses cli_setup_packet_buf() - which initializes the allocated async buffer,
not the cli->outbuf one. So the first time clistr_push_fn() is called is from
libsmb/clidfs.c:cli_dfs_get_referral(), just after the connection and tconX.
In this case cli->outbuf has never been initialized, and cli->outbuf[smb_flgs2] = 0
so the DFS query pushes ASCII on the wire, which is not what we want :-).

Remove the dependency on cli->outbuf[smb_flgs2] in clistr_push_fn(), and
fake up a SVAL(cli->outbuf, smb_flg2) value using cli_ucs2(cli) function
instead, which has been initialized. We only care about the FLAGS2_UNICODE_STRINGS
bit anyway.

I don't think this is an issue for 3.5.0 as the sessionsetup is still
synchronous there, but Volker PLEASE CHECK !

Jeremy.
2010-01-29 16:41:53 -08:00
Björn Jacke
a20b43f23f s3: link thread objects in libsmbclient only and adjust linker flags 2010-01-29 15:26:36 +01:00
olivier
e95e3270d1 AIX doesn't have MSG_DONTWAIT 2010-01-29 15:26:36 +01:00
Björn Jacke
118725c892 s3: by default don't use pthread pool support 2010-01-29 12:43:13 +01:00
Jeremy Allison
f387ed88e8 Fix bug #7069 - smbget does not return an error status after some errors
A combination patch from Johannes Poehlmann <johannes@lst.de> and
Jeremy. Fix the return codes from smb_download_file() and smb_download_dir().

Jeremy.
2010-01-28 10:38:24 -08:00
Karolin Seeger
1396345638 s3/winbind_ccache: Fix typo in debug message.
Karolin
2010-01-28 15:10:54 +01:00
Jeremy Allison
69fd8461b8 Second part of fix for bug #7072 - Accounts can't be unlocked from ldap.
Missed read of entry_timestamp (was entry->entry_timestamp).

Jeremy.
2010-01-27 16:52:40 -08:00
Jeremy Allison
627fb85092 Fix bug #7072 - Accounts can't be unlocked from ldap.
Fix suggested by Andy Hanton <andyhanton@gmail.com>. The LOGIN_CACHE
struct contains two time_t entries, but was being written to and
read from via tdb_pack/tdb_unpack functions using explicit 32-bit int specifiers.
This would break on machines with a 64-bit time_t. Use correct int
sizes for tdb_pack/tdb_unpack.

We have to fix this properly before 2037 :-).

Jeremy.
2010-01-27 16:42:06 -08:00
Björn Jacke
1f7e97a8a2 s3: syntax fix 2010-01-27 23:45:14 +01:00
Lars Müller
2f9eb6bff5 s3: Install and uninstall the static version of libwbclient
This requires to call configure with --enable-static which isn't the case
by default.
2010-01-27 22:40:19 +01:00
Björn Jacke
6bade10a1e s3: get pthread detection also on HP-UX right 2010-01-27 18:59:16 +01:00
Günther Deschner
1ead83947f s3-selftest: try to get RPC-SPOOLSS-NOTIFY running during make test on the buildfarm.
Guenther
2010-01-27 13:40:16 +01:00
Jeremy Allison
899bd0005f Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to respond to a read or write.
Only works on Linux kernels 2.6.26 and above. Grants CAP_KILL capability
to allow Linux threads under different euids to send signals to each other.

Jeremy.
2010-01-26 16:51:57 -08:00
Lars Müller
2dd301e5cd Add dependency of bin/smbfilter to libwbclient. 2010-01-26 22:54:15 +01:00
Volker Lendecke
08fa57335a s3: Enable use of ccache by default for libsmbclient
Disable this by setting the environment variable LIBSMBCLIENT_NO_CCACHE, which
has the advantage over an smb.conf option to be easily settable per
application.
2010-01-26 11:45:56 +01:00
Jeremy Allison
1e2e92f54d Correct fix for unused variable return from ndr_decode. Use it :-).
Jeremy.
2010-01-25 17:38:55 -08:00
Jeremy Allison
2fff1e13f1 Revert "s3: remove unused Variable"
This reverts commit 9536d94d54.

Bjorn, your change removed the ndr_decoding of the dos attribute.
Not a good idea :-).

Jeremy.
2010-01-25 17:06:54 -08:00
Björn Jacke
5439e1a03f s3: fix detection and flags for using pthread
I hope this fixes the build on Tru64, IRIX and maybe bug #6983
2010-01-26 00:19:10 +01:00
Björn Jacke
60a3086d78 s3: remove unused variable 2010-01-26 00:19:10 +01:00
Björn Jacke
38be40f63c s3:async_smb: remove unused variable 2010-01-26 00:19:10 +01:00
Björn Jacke
9536d94d54 s3: remove unused Variable
Jeremy, please check!
2010-01-26 00:19:10 +01:00
Björn Jacke
55d448254a s3:netapi: remove unused variable 2010-01-26 00:19:09 +01:00
Karolin Seeger
9ce9fdd9f4 s3/registry: Fix typo in comment.
Karolin
2010-01-25 19:50:21 +01:00
Volker Lendecke
2024d4fb27 Revert "s3: Make string_to_sid a wrapper around dom_sid_parse"
This reverts commit dff03b61fd.
2010-01-25 12:41:48 +01:00
Volker Lendecke
4eb1523d87 s3-libsmbclient: Add smbc_setOptionUseCCache()
Can we enable this by default? This would be a change in behaviour, but this
feature is just too cool for everyone to catch up in the apps.

The patch would be
2010-01-24 20:32:17 +01:00
Volker Lendecke
dc1bcec73c s3: Add --use-ccache to net 2010-01-24 20:32:17 +01:00
Volker Lendecke
aa837d4aee s3: add libnetapi_set_use_ccache() 2010-01-24 20:32:17 +01:00
Volker Lendecke
bff48738a8 s3: Fix a bug in net's use of popt
In order to add --use-ccache to net, I added another "bool opt_ccache;" to
struct net_context. popt did not like this, it took a while to figure out why.
Popt has the lines

    /* XXX Check alignment, may fail on funky platforms. */
    if (arg == NULL || (((unsigned long)arg) & (sizeof(*arg)-1)))
        return POPT_ERROR_NULLARG;

The "bool opt_ccache;" was not aligned anymore...
2010-01-24 20:32:17 +01:00
Volker Lendecke
b8996baba6 s3: Enable -C in rpcclient 2010-01-24 20:32:17 +01:00
Volker Lendecke
ca48d6ab77 s3: Add CLI_FULL_CONNECTION_USE_CCACHE 2010-01-24 20:32:17 +01:00
Volker Lendecke
d016bdb72c s3: Use -C in smbclient
$ bin/wbinfo --ccache-save=w2k3ad\\vl%Password
saving creds succeeded
$ bin/smbclient //192.168.42.160/tmp -Uvl -N -C -W w2k3ad
OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server 2003 R2 5.2]
smb: \>
$ bin/wbinfo --ccache-save=w2k3ad\\vl%WrongPassword
saving creds succeeded
$ bin/smbclient //192.168.42.160/tmp -Uvl -N -C -W w2k3ad
Anonymous login successful
Domain=[W2K3AD] OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server 2003 R2 5.2]
tree connect failed: NT_STATUS_ACCESS_DENIED
$
2010-01-24 20:32:17 +01:00
Volker Lendecke
21ec6a6cbd s3: Add -C (--use-ccache) to popt_common_credentials 2010-01-24 20:32:17 +01:00
Volker Lendecke
a03a83ad26 s3: Add ccache use to cli_session_setup_ntlmssp 2010-01-24 20:32:17 +01:00
Volker Lendecke
ff0274c519 s3: Add NTLMSSP_FEATURE_CCACHE
Uses the winbind ccache to do authentication if asked to do so
2010-01-24 20:32:17 +01:00
Volker Lendecke
6ba9bf004f s3: Add the session key to the ccache_ntlm_auth response 2010-01-24 20:32:16 +01:00
Volker Lendecke
7d18d058a1 s3: Add wbinfo --ccache-save
With this command you can give winbind your password for later use by
the automatic ntlm_auth
2010-01-24 20:32:16 +01:00
Volker Lendecke
185815a647 s3: Remove some calls to memset -- reduces text size by some bytes for me 2010-01-24 14:52:33 +01:00
Volker Lendecke
dff03b61fd s3: Make string_to_sid a wrapper around dom_sid_parse 2010-01-23 16:28:12 +01:00
Volker Lendecke
397a6faed9 s3: Add a little torture test for dom_sid_parse 2010-01-23 16:28:11 +01:00
Volker Lendecke
dbf9017a80 s3: Remove string_sid_talloc
All but one call were pointless, so I think this API should go
2010-01-23 14:35:37 +01:00
Volker Lendecke
2002b4e4c2 s3: Remove a call to string_sid_talloc 2010-01-23 14:35:37 +01:00
Volker Lendecke
c2c71b8e05 s3: Fix sending NULL sids to lookupsids3 2010-01-23 14:35:37 +01:00
Volker Lendecke
9fcbe3a65c s3: Remove some pointless uses of string_sid_talloc 2010-01-23 14:35:37 +01:00
Volker Lendecke
3e1a1616ec s3: Use global_sid_Builtin in net_groupmap_memberships 2010-01-23 14:35:37 +01:00
Volker Lendecke
8905b599b4 s3: Fix some nonempty blank lines 2010-01-23 14:35:37 +01:00
Volker Lendecke
9acbed13e8 s3: Fix some nonempty blank lines 2010-01-22 13:34:25 +01:00
Volker Lendecke
ee4a3606e6 s3: Fix a typo in a comment 2010-01-22 13:34:25 +01:00