Volker Lendecke [Sat, 18 Dec 2010 15:02:09 +0000 (16:02 +0100)]
s3: Fix bug 7066 -- wbcAuthenticateEx gives unix times
We might eventually want to change this, but right now we get unix times
out of the winbind pipe struct
(cherry picked from commit
993923880e213136de89b5b8d59f6f32a51b94b7)
Volker Lendecke [Tue, 6 Jul 2010 14:55:14 +0000 (16:55 +0200)]
s3: Fix another aspect of bug 7262
(Unable to maintain users' groups via UsrMgr)
(cherry picked from commit
9b1d0d409824cff275aaf9563eaa3ed77ccf8466)
Björn Jacke [Fri, 26 Nov 2010 00:32:53 +0000 (01:32 +0100)]
ѕ3/configue: set Tru64 cc's PIC switch right (none)
-fPIC made shared library builds fail there
Fixes #7821
(cherry picked from commit
dbcf73c45782c310cb7ff1f2177d410399e2f06d)
(cherry picked from commit
83eb2e9aef40e5e838d2654298e281ad3ec98af3)
Michael Adam [Thu, 30 Dec 2010 10:12:42 +0000 (11:12 +0100)]
s3:winbind: fix bug #7894 - sporadic winbind panic in rpc query_user_list
correctly evaluate return code of rpccli_samr_QueryDisplayInfo()
before accessing results.
(cherry picked from commit
bdebae14aa646dd9f969db5b3d1aa25c971c9381)
Jeremy Allison [Wed, 29 Dec 2010 01:24:27 +0000 (17:24 -0800)]
Fix bug #7892 - open_file_fchmod() leaves a stale lock.
(cherry picked from commit
8d9ef26538a29ab9f5b0a3179c28beecab1a099a)
Volker Lendecke [Tue, 21 Dec 2010 20:55:01 +0000 (21:55 +0100)]
s3: Use smbsock_any_connect in winbind
The last 7 patches address bug #7881 (winbind flaky against w2k8).
(cherry picked from commit
969f452de253cd8dbe6f4448168eaa11baed1fbc)
Volker Lendecke [Tue, 21 Dec 2010 17:52:53 +0000 (18:52 +0100)]
s3: Retry *SMBSERVER in nb_connect
(cherry picked from commit
6e9e567dfeb860c8b9a342bf46765f8c9b8ea7db)
Volker Lendecke [Mon, 13 Dec 2010 16:17:51 +0000 (17:17 +0100)]
s3: Add smbsock_any_connect
(cherry picked from commit
b289052828eb03b8c353b85691ce6af6aef6bf41)
Volker Lendecke [Sun, 12 Dec 2010 17:55:06 +0000 (18:55 +0100)]
s3: Add an async smbsock_connect
This connects to 445 and after 5 milliseconds also to 139. It treats a netbios
session setup failure as equivalent as a TCP connect failure. So if 139 is
faster but fails the nb session setup, the 445 still has the chance to succeed.
(cherry picked from commit
8b6b80ef591031ea6e394cebd6e0fdf8c7b8485a)
Volker Lendecke [Wed, 22 Dec 2010 14:21:27 +0000 (15:21 +0100)]
v3-5-test: Pull in tevent_req_poll_ntstatus from master
(cherry picked from commit
0b13028cb4d6fc2ff267df477b5c2c4291286a43)
Volker Lendecke [Sun, 12 Dec 2010 17:54:31 +0000 (18:54 +0100)]
s3: Add async cli_session_request
This does not do the redirects, but I think that might be obsolete anyway
(cherry picked from commit
a30258cf98ff334a786ea1566b607208d82617a0)
Volker Lendecke [Sun, 12 Dec 2010 17:53:49 +0000 (18:53 +0100)]
s3: Add some const to name_mangle()
(cherry picked from commit
1552acea9a55dd6bc5f386a5f424e09875ed463c)
Stefan Metzmacher [Thu, 16 Dec 2010 11:07:24 +0000 (12:07 +0100)]
s3:net ads dns register: use "cluster addresses" option if configured (bug #7871)
metze
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 17 16:49:14 CET 2010 on sn-devel-104
(cherry picked from commit
1dc2fa7616207a2d3a9f1cbe69b2ec1fc61634fd)
(cherry picked from commit
9a40e5f6a500571cc752383ca7fa27347e4efa45)
(cherry picked from commit
53f163bbc2e5722a46eeb55d15cca2c23994e71b)
Michael Adam [Thu, 16 Dec 2010 00:49:14 +0000 (01:49 +0100)]
s3:net ads dns register: add support for specifying addresse on the commandline (bug #7871)
In the clustering case, this is also made the only possiblity to do dns updates,
since the list addresses on the local interfaces is not suitable in that case.
This fixes the "net ads dns register" part of bug #7871.
It might be extended by a parsing of the "cluster addresses" setting.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
5e83a05009787d8a2086db1adc1ed58d61b3725d)
(cherry picked from commit
9ed3d33fb3d7365a127ea2752032840272697902)
(cherry picked from commit
5e708489d56bc7a2b0a033a38e62bed519249b33)
Michael Adam [Wed, 15 Dec 2010 23:52:41 +0000 (00:52 +0100)]
s3:net: add net_update_dns_ext() that accepts a list of addresses as parameter (bug# 7871)
This generalized form of net_update_dns() will be used to
add support for specifying a list of addresses on the commandline
of "net ads dns register".
This prepares the "net ads dns register" part of the fix for bug #7871.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
4d91f98b433e07922373bf4e3ba9668b7af71a00)
(cherry picked from commit
4b7775500b1055acf62decbc0fc8283b088da452)
(cherry picked from commit
ed914296df896a3805c8c6b74ad8bd9e1dcac35b)
Michael Adam [Wed, 1 Dec 2010 23:42:21 +0000 (00:42 +0100)]
s3:net: disable dynamic dns updates at the end of "net ads join" in a cluster (bug #7871)
In a clustered environment, registering the set of ip addresses that are
assigned to the interfaces of the node that performs the join does usually
not have the desired effect, since the local interfaces do not carry
complete set of the cluster's public IP addresses. And it can also contain
internal addresses that should not be visible to the outside at all.
In order to do dns updates in a clustererd setup, use net ads dns register.
This fixes the net ads join part of bug #7871.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
b8f19df53e66bf0260b4ae6c49acea87ac379deb)
(cherry picked from commit
1c73d52ddddfcec25cf079da4a0d6bf81fb030da)
(cherry picked from commit
ae5ba417d3599cf6ad81a9612e7998a30d8a4061)
Andrew Bartlett [Fri, 10 Dec 2010 04:08:53 +0000 (15:08 +1100)]
s3-net Allow 'net ads dns register' to take an optional hostname argument
This allows the administrator to more carefully chose what name to register.
Andrew Bartlett
(cherry picked from commit
c2a1ad9047508cf2745a9019e6783c8b8f7ef475)
(cherry picked from commit
10c5a59315ef69eeb4d8bc19237de9787284a63d)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
bce7e8c8e11321d98a30a8b6bb79a392a5e644ba)
Stefan Metzmacher [Wed, 1 Dec 2010 23:39:23 +0000 (00:39 +0100)]
s3:ntlm_auth: support clients which offer a spnego mechs we don't support (bug #7855)
Before we rejected the authentication if we don't support the
first spnego mech the client offered.
We now negotiate the first mech we support.
This fix works arround problems, when a client
sends the NEGOEX (1.3.6.1.4.1.311.2.2.30) oid,
which we don't support.
metze
(cherry picked from commit
f802075f08fe0d86f3d176f2302236aeb5834f3d)
Modified to work in the v3-5-test branch, e.g. use ntlmssp_end()
The last 9 patches address bug #7855 (ntlm_auth only handles the first spnego
mech).
(cherry picked from commit
ab69b55011eea73d7c8827fc339feb905474f201)
Stefan Metzmacher [Wed, 1 Dec 2010 04:59:16 +0000 (05:59 +0100)]
s3:ntlm_auth: free session key, as we don't use it (at least for now)
metze
(cherry picked from commit
ee4f5ac6182969bcab91955e6d6581e408d222f1)
(cherry picked from commit
e00cb883107753380272e128955ae5ad3057fd40)
Stefan Metzmacher [Wed, 1 Dec 2010 04:50:59 +0000 (05:50 +0100)]
s3:ntlm_auth: fix memory leak in the raw ntlmssp code path
metze
(cherry picked from commit
9a56ade6b1d627126418c75de4602610b4482503)
(cherry picked from commit
7c3bb9af54b40dbd24b781186607339c76a25a85)
Stefan Metzmacher [Tue, 30 Nov 2010 09:52:52 +0000 (10:52 +0100)]
s3: Correctly unwrap the krb ticket in gss-spnego (cherry picked from commit
547b268cfaa2e791bf92e8804bfa504c4e37050b)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
renamed to _spnego_parse_krb5_wrap()
metze
(cherry picked from commit
7cb3d84fc11490c97d7d84a3231e2d9f6b2d69fe)
Volker Lendecke [Thu, 16 Sep 2010 08:22:00 +0000 (10:22 +0200)]
s3: Fall back to raw NTLMSSP for the gss-spnego protocol
This is to handle the mod_auth_ntlm_winbind protocol
sending "Negotiate" to IE, which sends raw NTLMSSP
instead of a SPNEGO wrapped NTLMSSP blob.
(cherry picked from commit
70ab7eb5303a5ff058939541dd5bc1f81113a48e)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
7652f2a782559bb0346b0976929b5b5b5377dcbc)
Stefan Metzmacher [Tue, 30 Nov 2010 09:46:28 +0000 (10:46 +0100)]
s3: Split off output generation from manage_squid_ntlmssp_request (cherry picked from commit
de2c143f4d540f695db5c7fe8685614c03977365)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
8443abede7c3f6deb7a7c584937d9e28eb9274da)
Volker Lendecke [Thu, 16 Sep 2010 08:36:21 +0000 (10:36 +0200)]
s3: Wrap the ntlm_auth loop with a talloc_stackframe (cherry picked from commit
ae483bbe9af526623189cefe7735f3f2813da6d7)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
0d9b2e954d61c9f6211c867348a817e42bd4b12f)
Volker Lendecke [Wed, 15 Sep 2010 08:29:44 +0000 (10:29 +0200)]
s3: Fix some debug msgs in ntlm_auth (cherry picked from commit
6400f3ee62108e3dd1e6c1013ccea9fb4b08d562)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
498f1c87e6c9bc136da696bae5e9a71df9b8233e)
Volker Lendecke [Mon, 13 Sep 2010 16:09:20 +0000 (18:09 +0200)]
ntlm_auth: Fix a valgrind error (cherry picked from commit
69db4b4ccf051b05517e6eb9039ab48f90608075)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
63fa349916d72c158b1fc4ab7a60b9a909a15131)
Holger Hetterich [Sat, 4 Dec 2010 17:18:50 +0000 (18:18 +0100)]
Fix bso#3185, return false when EOF is encountered in param name.
(cherry picked from commit
a9664633c667f6d02f33b951805882258604ff1c)
Jeremy Allison [Sun, 5 Dec 2010 19:40:21 +0000 (20:40 +0100)]
s3: Fix bug 7843: Expand the local SAMs aliases
(cherry picked from commit
50c8b426385df953d2e3748a39041d4b92cd7ed9)
Volker Lendecke [Sat, 4 Dec 2010 19:34:05 +0000 (20:34 +0100)]
s3: Fix bug 7842: WINBINDD_LOOKUPRIDS does not return the domain name
(cherry picked from commit
0737a34a12e46d53e4332ea06eac0ba948608fff)
Volker Lendecke [Sat, 4 Dec 2010 19:31:36 +0000 (20:31 +0100)]
s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain
(cherry picked from commit
a257253f8f82bcab52508273b12cd92fadd3ba1a)
Jeremy Allison [Thu, 2 Dec 2010 23:27:17 +0000 (15:27 -0800)]
Fix bug #7835 - vfs_fill_sparse() doesn't use posix_fallocate when strict allocate is on
Tries posix_fallocate() and then falls back to old code.
Jeremy.
(cherry picked from commit
0c45b32bc7d93b03838405a97b054cb414267892)
Volker Lendecke [Sat, 13 Nov 2010 17:03:25 +0000 (18:03 +0100)]
s3: Fix "force group" with ntlmssp guest session setup
This one is subtle: Set "force group = <somegroup>" together with "guest ok =
yes". Then try "smbclient //server/share -U%". Works. Then try to connect to
the same share from Windows 2003 using an anonymous connection. Breaks with
make_connection: connection to share denied due to security descriptor
although the share_info.tdb is empty. I've seen reports of this on the lists,
but I could never ever nail it until a customer gave me access to such a box.
What happens? With an empty share_info.tdb we create a security descriptor
allow everything to the world. The problem with the above parameter combination
is that S-1-1-0 (World) is lost in the token. When you look at the callers of
create_local_token, they are only called if the preceding check_ntlm_password
did not create server_info->ptok. Not so with the one in auth_ntlmssp.c. So, if
we get a NTLMSSP session setup with user="", domain="", pass="" we call
create_local_token even though check_guest_security() via
make_server_info_guest() has already correctly done so. In this case
create_local_token puts S-1-1-0 into user_sids[1], which is supposed to be the
primary group sid of the user logging in. "force group" then overwrites this ->
the world is gone -> "denied due to security descriptor".
Why don't you see it with smbclient -U% (anonymous connection)? smbclient does
not use ntlmssp for anon session setup.
This seems not to happen to 3.6.
Volker
Fix bug #7817 ("force group" broken).
(cherry picked from commit
56b1082fe436e1f99a87d3e37d9ea8b017353b39)
Volker Lendecke [Thu, 18 Nov 2010 12:28:47 +0000 (13:28 +0100)]
s3: Make winbind recover from a signing error
When winbind sees a signing error on the smb connection to a DC (for whatever
reason, our bug, network glitch, etc) it should recover properly. The "old"
code in clientgen.c just closed the socket in this case. This is the right
thing to do, this connection is spoiled anyway. The new, async code did not do
this so far, which led to the code in winbindd_cm.c not detect that we need to
reconnect.
Fix bug #7800 (winbind does not recover from smb signing errors).
(cherry picked from commit
49632d414e13ecd2f17362869c5dc1cceb47862b)
olivier [Wed, 10 Nov 2010 16:48:06 +0000 (17:48 +0100)]
switch from mtime to ctime which is more reliable if files can be accessed outside samba as well
Fix bug #7789 (change vfs_scannedonly from mtime to ctime).
(cherry picked from commit
2d24c4a056e5c54b5ef4c9112cec076ac7c08d6f)
Jeremy Allison [Tue, 23 Nov 2010 22:21:25 +0000 (14:21 -0800)]
Fix bug #7812 - vfs_acl_xattr/vfs_acl_tdb: ACL inheritance cannot be disabled
We were losing the incoming security descriptor revision number and
most importantly the "type" field as sent by the client. Ensure we
correctly store these in the xattr object.
Jeremy.
(cherry picked from commit
67235a5532a00e6ccb41748dc9a8c3e9159ba79e)
Jeremy Allison [Wed, 17 Nov 2010 23:58:15 +0000 (15:58 -0800)]
Fix our privileges code to display privileges with the "high" 32-bit value set.
SeSecurityPrivilege is the first LUID we have added that has a non-zero
"high" value, ensure our LUID code correctly supports it.
Jeremy.
The last 14 patches address bug #7716 (acl_xattr and acl_tdb modules don't store
unmodified copies of security descriptors).
(cherry picked from commit
941129fb70261d4871de4804a81ce82e23d9d0f7)
Jeremy Allison [Fri, 19 Nov 2010 00:13:28 +0000 (16:13 -0800)]
Add SeSecurityPrivilige.
Jeremy.
(cherry picked from commit
f11da60f3189bc70eb82259435e108f40b2bb333)
Jeremy Allison [Fri, 22 Oct 2010 23:14:28 +0000 (16:14 -0700)]
Ensure we have correct parameters to use Windows ACL modules.
(cherry picked from commit
117d14f108cded28ac2868d5040f633856cca923)
Jeremy Allison [Sat, 23 Oct 2010 00:28:58 +0000 (17:28 -0700)]
Add acl_xattr:ignore system acls boolean (normally false) to allow Samba ACL module to ignore mapping to lower POSIX layer. With this fix Samba 3.6.x now passes RAW-ACLs (with certain smb.conf parameters set).
Jeremy.
(cherry picked from commit
7c892ed58f816985e58b9cef2ff4cd2a81d16995)
Jeremy Allison [Fri, 22 Oct 2010 23:04:53 +0000 (16:04 -0700)]
Add make_default_filesystem_acl() function to be used in following change to acl_xattr and acl_tdb module.
(cherry picked from commit
2d84fce8f20c4eac70b02f0fc4333b15e278edfc)
Jeremy Allison [Fri, 22 Oct 2010 22:56:31 +0000 (15:56 -0700)]
Fix handling of "NULL" DACL. Map to u/g/w - rwx.
(cherry picked from commit
84b2a3d013390c01ef27d10085a0bf10137c857f)
Jeremy Allison [Sat, 23 Oct 2010 00:23:13 +0000 (17:23 -0700)]
Fix "force unknown ACL user" to strip out foreign SIDs from POSIX ACLs if they can't be mapped.
(cherry picked from commit
3fcceb6c5ae55f5e3a66f71e44b5caa665596832)
Jeremy Allison [Fri, 22 Oct 2010 21:55:52 +0000 (14:55 -0700)]
Add debug message to get_nt_acl_internal() to see what we got.
(cherry picked from commit
514e3e786f999979f9fd85a9c08de9e06e50938b)
Jeremy Allison [Fri, 22 Oct 2010 21:54:19 +0000 (14:54 -0700)]
Fix valgrind "uninitialized read" error on "info" when returning !NT_STATUS_OK.
(cherry picked from commit
9b615ce8706f4f4c59055fe155446f1fdac36323)
Jeremy Allison [Fri, 15 Oct 2010 21:12:04 +0000 (14:12 -0700)]
Fix bug #7734 - When creating files with "inherit ACLs" set to true, we neglect to apply appropriate create masks.
Jeremy.
(cherry picked from commit
8cad5e23b6e2440a566def6fb138d484e3b47643)
(cherry picked from commit
e675462b3cfc53d7fe0c6e07c13a386599c5afd9)
Jeremy Allison [Fri, 15 Oct 2010 20:30:07 +0000 (13:30 -0700)]
Fix bug #7733 - Invalid client DOS attributes on create can cause incorrect unix mode_t to be generated.
It turns out a client can send an NTCreateX call for a new file, but specify
FILE_ATTRIBUTE_DIRECTORY in the attribute list. Windows silently strips this,
but we don't - causing the unix_mode() function to go through the "mode bits
for new directory" codepath, instead of the "mode bits for new file" codepath.
Jeremy.
(cherry picked from commit
92adb686372a9b67e47efb5b051bc351212f1780)
(cherry picked from commit
6b4141e92151adaa0d2ef036657783a99ef517c6)
Jeremy Allison [Sat, 23 Oct 2010 00:18:45 +0000 (17:18 -0700)]
Make the vfs_acl_xattr and other modules work with NULL SD's. Fix the "protected" inheritance problem (bleeding up from the POSIX layer).
Jeremy
(cherry picked from commit
fe5b8a9dc994d3020537f4e68f2105c806cd103b)
Jeremy Allison [Sat, 23 Oct 2010 00:11:17 +0000 (17:11 -0700)]
Canonicalize incoming and outgoing ACLs.
Jeremy.
(cherry picked from commit
b01501af60d364ce7e7c96b7e4b93502c453ac6d)
Jeremy Allison [Sat, 23 Oct 2010 00:07:10 +0000 (17:07 -0700)]
Make the posix ACL module cope with a NULL incoming DACL and a missing owner/group.
Jeremy.
(cherry picked from commit
09ee42d774c0b0f8cf9a67feb80426c19b4ce24c)
Jeremy Allison [Tue, 23 Nov 2010 19:16:31 +0000 (11:16 -0800)]
Fix bug #7785 - atime limit.
On a 64-bit time_t system make MAX_TIME_T the max value that
can be represented in a struct tm. This allows applications to
set times in the future beyond the 32-bit time_t limit (2037).
This is only in source3/configure.in, needs adding to the waf
configure/build system (but I'll need help with that).
Jeremy.
(cherry picked from commit
ff6c598f7f18e6ba945a3fe082b01255a0a42325)
Samba-JP oota [Tue, 23 Nov 2010 16:06:48 +0000 (17:06 +0100)]
s3-docs: Update 3.2 features.
(cherry picked from commit
aa54713615c5d0367528733ff2c3a5650eed96f7)
(cherry picked from commit
55754e2c1f620eee662319a0bcb89f8620014d56)
Jeremy Allison [Thu, 11 Nov 2010 17:44:21 +0000 (09:44 -0800)]
Fix bug #7791 - gvfsd-smb (Gnome vfs) fails to copy files from a SMB share using SMB signing.
The underlying problem is that the old code invoked by cli_write() increments
cli->mid directly when issuing outstanding writes. This should now be done only
in libsmb/clientgen.c to make metze's new signing engine works correctly. Just
deleting this code fixes the problem.
Jeremy.
(cherry picked from commit
9a02a38d9783b0d7dc172cc5bdc2380bc5d107cf)
Jeremy Allison [Fri, 5 Nov 2010 19:13:38 +0000 (12:13 -0700)]
Second part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error.
Ensure we return after calling passdb for SID lookups for which we are
authoritative.
Jeremy.
(cherry picked from commit
b5c8b1bbb53caa0ceabb4a5180ff7deb1e58b538)
Jeremy Allison [Fri, 5 Nov 2010 19:11:53 +0000 (12:11 -0700)]
First part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error.
Ensure idmap_init_passdb_domain() correctly initialized the default
domain first.
Jeremy.
(cherry picked from commit
32a5aa62cb54e90947bd027e72871ffc07c3dbcf)
Volker Lendecke [Sat, 6 Nov 2010 20:18:35 +0000 (21:18 +0100)]
s3: Fix bug 7779, crash in expand_msdfs
(cherry picked from commit
82e15a5ee335ac87ab473899b333056a02bf15b3)
Volker Lendecke [Wed, 3 Nov 2010 12:08:37 +0000 (13:08 +0100)]
s3: Fix a getgrent crash with many groups
Fix bug #7774.
(cherry picked from commit
d070359ca01c1b340a610dd2cf9ce60b33c256e4)
Jeremy Allison [Wed, 20 Oct 2010 20:58:15 +0000 (13:58 -0700)]
Fix bug #7744 - "dfree cache time" doesn't work.
There is a bug in processing the dfree cache time, which is associated with the
smbd idle timer. The idle timer call conn_idle_all(), which updates the
conn->lastused timestamp. The dfree cache time code in smbd/dfree.c depends on
conn->lastused being up to date to refresh the cached dfree value.
Unfortunately the conn_idle_all() returns early if any of the connection
structs is not idle, never updating any further conn->lastused timestamps. If
(as is common due to an IPC$ connection) there are more than one used
connection struct, then the conn->lastused timestamps after the IPC$ connection
in the connection list will never be updated.
Ensure we always update conn->lastused for all connections when calling
conn_idle_all().
Jeremy.
(cherry picked from commit
47841952936e28916a738105194d662207477285)
Jeremy Allison [Wed, 20 Oct 2010 18:22:57 +0000 (11:22 -0700)]
Fix bug #7743 - Inconsistent use of system name lookup can cause a domain joined machine to fail to find users.
Ensure all username lookups go through Get_Pwnam_alloc(), which is the
correct wrapper function. We were using it *some* of the time anyway,
so this just makes us properly consistent.
Jeremy.
(cherry picked from commit
6e9d95f753b2b127268f1eb9a40d601002484bd1)
Volker Lendecke [Fri, 15 Oct 2010 14:37:47 +0000 (16:37 +0200)]
s3: Fix bug 7730 -- crash in winbindd_dsgetdcname.c
(cherry picked from commit
f1b04a210074546d4e4347b62b4f7f5b879454d9)
Jeremy Allison [Thu, 7 Oct 2010 21:26:13 +0000 (14:26 -0700)]
Fix bug 7716 - acl_xattr and acl_tdb modules don't store unmodified copies of security descriptors.
As pointed out by an OEM, the code within smbd/posix_acl.c, even though passed
a const pointer to a security descriptor, still modifies the ACE entries within
it (which are not const pointers).
This means ACLs stored in the extended attribute by the acl_xattr module have
already been modified by the POSIX acl layer, and are not the original intent
of storing the "unmodified" ACL from the client.
Use dup_sec_desc to make a copy of the incoming ACL on talloc_tos() - that
is what is then modified inside smbd/posix_acl.c, leaving the original ACL
to be correctly stored in the xattr.
Jeremy.
(cherry picked from commit
02dd1fc3c777a49e4fa51982956dcdcc8761e0c9)
Volker Lendecke [Sat, 2 Oct 2010 09:50:26 +0000 (11:50 +0200)]
s3: Attempt to fix bug 7665
Quite a few of our internal routines put stuff on talloc_tos() these days.
In top-level netapi routines, properly allocate a stackframe and clean it
again. Also, don't leak memory in the rpccli_ callers onto the libnetapi
context.
(cherry picked from commit
c4421a287c7e613c0c8da188a6ae8db37e90c8fc)
Michael Adam [Sun, 31 Oct 2010 00:04:25 +0000 (02:04 +0200)]
s3:librpc/ndr: use new strlen_m_ext_term() in ndr_charset_length(): fix bug #7594
This fixes the calculation of needed space for destination unicode charset.
The last 4 patches address bug #7594 ("wbinfo -u" and "wbinfo -g" gives no
output (log=>ndr_pull_error)).
(cherry picked from commit
8e46bff8b88103f4a5b0d3920ab6e3901decaf22)
Stefan Metzmacher [Wed, 25 Aug 2010 08:05:15 +0000 (10:05 +0200)]
librpc/ndr: correctly implement ndr_charset_length()
Before we ignored the charset type.
metze
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
9fd5cc6d85d3179972d7567bad95538ab2873c30)
Michael Adam [Sun, 31 Oct 2010 00:02:16 +0000 (02:02 +0200)]
s3:lib/util_str: add strlen_m_ext_term() - variant of strlen_m_ext() counting terminator
(cherry picked from commit
f7928a0e0b2be27e83bf26644c45ac554c5acec2)
Michael Adam [Mon, 1 Nov 2010 15:28:43 +0000 (16:28 +0100)]
s3:lib/util_str: add strlen_m_ext() that takes the dest charset as a parameter.
(cherry picked from commit
054cd7ec30a3289443c97d36ea416d37f19d6b0b)
Jeremy Allison [Mon, 13 Sep 2010 23:51:59 +0000 (16:51 -0700)]
Fix bug 7409 - Thousands of reduce_name: couldn't get realpath.
Don't log this at level 1 - every EACCES will generate one.
Thanks to muehlfeld@medizinische-genetik.de for pointing this out.
Jeremy.
(cherry picked from commit
7effd963691f8a1307b658b029c4f7f255399bb6)
Karolin Seeger [Mon, 28 Feb 2011 13:46:28 +0000 (14:46 +0100)]
WHATSNEW: Start release notes for 3.5.8.
Karolin
Karolin Seeger [Mon, 28 Feb 2011 13:44:31 +0000 (14:44 +0100)]
VERSION: Bump version number up to 3.5.8.
Karolin
Karolin Seeger [Sun, 27 Feb 2011 17:42:19 +0000 (18:42 +0100)]
WHATSNEW: Prepare 3.5.7 release notes.
Karolin
Jeremy Allison [Sun, 27 Feb 2011 16:58:06 +0000 (17:58 +0100)]
Fix denial of service - memory corruption.
CVE-2011-0719
Fix bug #7949 (DoS in Winbind and smbd with many file descriptors open).
All current released versions of Samba are vulnerable to
a denial of service caused by memory corruption. Range
checks on file descriptors being used in the FD_SET macro
were not present allowing stack corruption. This can cause
the Samba code to crash or to loop attempting to select
on a bad file descriptor set.
A connection to a file share, or a local account is needed
to exploit this problem, either authenticated or unauthenticated
(guest connection).
Currently we do not believe this flaw is exploitable
beyond a crash or causing the code to loop, but on the
advice of our security reviewers we are releasing fixes
in case an exploit is discovered at a later date.
Karolin Seeger [Fri, 8 Oct 2010 12:36:50 +0000 (14:36 +0200)]
WHATASNEW: Start 3.5.7 release notes.
Karolin
(cherry picked from commit
34aa6f4b920fee5adf4376d7626efb4782ae039a)
Karolin Seeger [Fri, 8 Oct 2010 12:35:23 +0000 (14:35 +0200)]
VERSION: Bump version number up to 3.5.7.
Karolin
(cherry picked from commit
7e0ae1b5538da956d2d301cf0fe01f82f98fe024)
Karolin Seeger [Thu, 7 Oct 2010 16:21:32 +0000 (18:21 +0200)]
WHATSNEW: Update release notes.
Karolin
(cherry picked from commit
2c88eee4a311a9d62d121063051c0e3adf145000)
Volker Lendecke [Sat, 2 Oct 2010 15:07:00 +0000 (17:07 +0200)]
s3: Stop using the write cache after an oplock break
Fix bug #7715 (Setting Samba Write Cache Size Can Cause File Corruption).
(cherry picked from commit
9f8292e5f765dff586bfbb261b54da4d4b27a837)
Jeremy Allison [Sun, 26 Sep 2010 11:59:31 +0000 (04:59 -0700)]
Fix bug 7694 - Crash bug with invalid SPNEGO token.
Found by the CodeNomicon test suites at the SNIA plugfest.
http://www.codenomicon.com/
If an invalid SPNEGO packet contains no OIDs we crash in the SMB1/SMB2 server
as we indirect the first returned value OIDs[0], which is returned as NULL.
Modified for 3.5.x.
Jeremy.
(cherry picked from commit
5e7e402320ebce06957e85f35d478615b2210a87)
Karolin Seeger [Wed, 6 Oct 2010 19:24:30 +0000 (21:24 +0200)]
WHATSNEW: Update release notes.
Karolin
(cherry picked from commit
b19f866f2285da5ecc3982b2c9c0ccd005dd41cc)
Jeremy Allison [Sun, 26 Sep 2010 11:49:29 +0000 (04:49 -0700)]
Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.
Found by the CodeNomicon test suites at the SNIA plugfest.
http://www.codenomicon.com/
If an invalid NetBIOS session request is received the code in name_len() in
libsmb/nmblib.c can hit an assert.
Re-write name_len() and name_extract() to use "buf/len" pairs and
always limit reads.
(Modified for 3.5.x)
Jeremy.
(cherry picked from commit
08bb0fb61580cf528109ebd061a91e4fa5be5a2b)
Volker Lendecke [Sat, 25 Sep 2010 17:56:58 +0000 (10:56 -0700)]
s3: Fix bug 7470
S_IREAD and S_IWRITE are not standard.
Thanks to Joachim Schmitz <schmitz@hp.com> for reporting!
(cherry picked from commit
f1f260c018bfb5b2269731bb806176da1db12db8)
Karolin Seeger [Mon, 27 Sep 2010 20:04:27 +0000 (22:04 +0200)]
WHATSNEW: Update changes since 3.5.5.
Karolin
(cherry picked from commit
ca69f9665441f51a59b215f466311dac5fc1bc88)
Volker Lendecke [Sat, 18 Sep 2010 14:37:04 +0000 (07:37 -0700)]
s3: Fix bug 7688, rpcclient command line completion crashing
We've grown more than 100 rpcclient commands by now, so this would overwrite
the array of 100 completions. There's nicer ways to fix this problem, but 1000
rpcclient commands should be at least a bit away.
(cherry picked from commit
ec3bca61a10d8dcaa6a94046120dd414e39289b1)
Volker Lendecke [Tue, 21 Sep 2010 22:41:23 +0000 (15:41 -0700)]
s3: Remove a global variable in bugfix for bug 7665
(cherry picked from commit
cf364274cbae996fbe186b2c2792b212f189e26a)
Günther Deschner [Tue, 21 Sep 2010 04:05:37 +0000 (21:05 -0700)]
s3-libnetapi: Fix Bug #7665, memory leak in netapi connection manager.
Guenther
(cherry picked from commit
6f47a24bc55be0ea907594a748774675a105b5e3)
(cherry picked from commit
f9f54825238d4e30827dea897456ff8cf4e6730c)
Volker Lendecke [Mon, 6 Sep 2010 13:13:48 +0000 (15:13 +0200)]
s3: Fix the charset_pull routine
In the push routine we do the SVAL, so we should do the SSVAL here.
Fix bug #7531 (3.5.3 unusable on solaris 10).
(cherry picked from commit
73a7100a21a50873d09cef7a100ed75c4095863f)
Björn Jacke [Mon, 7 Jun 2010 21:06:28 +0000 (23:06 +0200)]
s3: fix build on platforms without st_blocks and st_blksize stat struct members
This fixes bug 7474.
(cherry picked from commit
18516e062c9c4fc2a61a7ef7c8b173683c02e2e8)
Jeremy Allison [Wed, 22 Sep 2010 19:26:13 +0000 (12:26 -0700)]
Fix bug #7693 - smbd changing mode of files on rename
When using "map archive", don't change the archive bit on
renames or writes with UNIX extensions turned on.
Jeremy.
(cherry picked from commit
24f9210fe1e2280e08a7b2dd2cb33e7af4c1c002)
Chere Zhou [Tue, 6 Jul 2010 00:18:35 +0000 (17:18 -0700)]
s3:smbd: Align change notify replies on 4-byte boundary
MS-CIFS section 2.2.7.4.2 states this is mandatory. WinXP clients
don't seem to care, but a Win7 client will send an immediate Close()
to the directory handle when receiving an incorrectly aligned
change notify response.
Fix bug #7662 (Change notify replies must be aligned on 4-byte boundary for
Win7.)
(cherry picked from commit
2ee2ea9fa5b839a4395895872f1ed149226dd06f)
Volker Lendecke [Mon, 10 May 2010 10:05:01 +0000 (12:05 +0200)]
libwbclient: Fix a fd-leak at dlclose-time
__attribute__((destructor)) makes winbind_close_sock() being called at
dlclose() time.
Found while testing apache on Linux with mod_auth_pam.
Other platforms will have to find a different fix. One possibility would be to
always close the socket after each operation, but this badly sucks
performance-wise.
Fix bug #7684 (fd leak in libwbclient.so).
(cherry picked from commit
f7e7fa50ec3aef60b72a34988825e314b7228c23)
Günther Deschner [Thu, 3 Jun 2010 14:30:55 +0000 (16:30 +0200)]
s3-spoolss: add and use spoolss_printerinfo2_to_setprinterinfo2().
This fixes some invalid typecasts.
Guenther
The last 3 patches address bug #7658 (fix some "dereferencing type-punned
pointer will break strict-aliasing rules" warnings).
(cherry picked from commit
1a4a8e9bfb146276174a3723e3f20897e0443542)
Günther Deschner [Mon, 10 May 2010 12:44:30 +0000 (14:44 +0200)]
s3-rpcclient: fix two more invalid typecasts in spoolss commands.
Guenther
(cherry picked from commit
83736066a3f94eaadb422016c9f22cb18bec2cd7)
(cherry picked from commit
589bb48af5708501ab47335c84a59f0923ccb20b)
Günther Deschner [Tue, 25 May 2010 10:43:00 +0000 (12:43 +0200)]
s3-net: fix a "dereferencing type-punned pointer will break strict-aliasing rules" warning.
Guenther
(cherry picked from commit
f12028a3fd5c64bc8e13996cb9a18a19ec0929e0)
(cherry picked from commit
a88f1bddbc348075c322834153040b57f5eb6ab0)
Volker Lendecke [Fri, 27 Aug 2010 12:44:16 +0000 (14:44 +0200)]
s3: Cache results of finding printer names
With hundreds of printers or on a slow machine, this can become expensive.
Problem reported and patch sponsored by DESY, Hamburg (www.desy.de)
Fix bug #7656 (Scalability problem with hundreds of printers).
(cherry picked from commit
de445e29ce944985651cbd62c8203cc9ace51a25)
Jeremy Allison [Thu, 26 Aug 2010 23:49:21 +0000 (16:49 -0700)]
Fix bug #7651 - mknod and mkfifo fails with "No such file or directory"
Ensure we check the correct stat struct once we've created the
special fix. Thanks to izh1979@gmail.com for pointing out the
bug.
Jeremy.
(cherry picked from commit
3ced147b6e0ba872b6b49a27f30e4a44695d42f3)
Günther Deschner [Mon, 23 Aug 2010 14:02:23 +0000 (16:02 +0200)]
s3-dcerpc: avoid talloc_move on schannel creds in cli_rpc_pipe_open_schannel_with_key().
Initially, the schannel creds were talloc memduped, then, during the netlogon
creds client merge (
baf7274fed2f1ae7a9e3a57160bf5471566e636c) they were first
talloc_referenced and then later (
53765c81f726a8c056cc4e57004592dd489975c9)
talloc_moved.
The issue with using talloc_move here is that users of that function in winbind
will only be able to have two schanneled connections, as the cached schannel
credentials pointer from the netlogon pipe will be set to NULL. Do a deep copy
of the struct instead.
Guenther
(cherry picked from commit
898c6123355a3a11ec17f0396c4cb3018c75c184)
(cherry picked from commit
68e83f9fedf0a0f0fa412d3ecec8ee853bf82bac)
Jeremy Allison [Mon, 23 Aug 2010 20:05:56 +0000 (13:05 -0700)]
Final part of fix for bug #7636 - winbind internal error, backtrace.
Ensure cm_get_schannel_creds() returns NTSTATUS.
Jeremy.
(cherry picked from commit
33060f67be100836d381a74bced351c6579cc58d)
(cherry picked from commit
ab96b398a5afc7e877cffd9d7c749a72916c6b5c)
Björn Jacke [Thu, 12 Aug 2010 14:18:45 +0000 (16:18 +0200)]
s3: fall back to cups-config for underlinked libs
some OpenBSD systems have underlinked cups libraries. If linking against cups
alone fails, try to link against all the cups-config --libs cruft, which we
usually don't want. (bugzila #7244)
(cherry picked from commit
616e187d68e3e7b202413a96518b31d029e9563a)
(cherry picked from commit
fd43cc698a7f03c4d6c48d21e88097cc5050ca8e)
Volker Lendecke [Sat, 21 Aug 2010 09:32:58 +0000 (11:32 +0200)]
s3: Fix bug 7635
smbclient -M not sending due to NT_STATUS_PIPE_BROKEN
(cherry picked from commit
fe4dcd44ec581afb631125b1d0bade055ca97e30)
Jeremy Allison [Thu, 29 Jul 2010 20:44:35 +0000 (13:44 -0700)]
Fix bug #7589 - ntlm_auth fails to use cached credentials.
In handling the WINBINDD_PAM_AUTH message winbindd canonicalizes a *copy*
of the mapped username, but fails to canonicalize the actual username
sent to the backend domain process. When "winbind default domain"
is set this can lead to credentials being cached with an index of
user: user, not DOMAIN\user. All other code paths that use
canonicalize_username() (WINBINDD_PAM_CHAUTHTOK, WINBINDD_PAM_LOGOFF)
correctly canonicalize the data sent to the backend. All calls
the can cause credentials to be looked up (PAM_CHAUTHTOK etc.)
correctly call canonicalize_username() to create the credential
lookup key.
Jeremy.
(cherry picked from commit
c3f2015075ff1e523536cdd242ba0ec5b26f081c)
Jeremy Allison [Fri, 13 Aug 2010 00:02:30 +0000 (17:02 -0700)]
Fix bug 7581 - Users in "admin users" in smb.conf file are unable to read/write all files when the acl_xattr vfs module is used.
Correctly check admin users in smb1_file_se_access_check().
Jeremy.
(cherry picked from commit
383477789445d42d0d7451fea770c456625f16e1)
Jim McDonough [Mon, 23 Aug 2010 09:13:06 +0000 (11:13 +0200)]
s3-printing: fix BUG 7280 - auto printers not loading with registry config
(cherry picked from commit
bb92b0e1571e4766ab20bb3eea53f9e7f9567a5f)
Jeremy Allison [Tue, 27 Jul 2010 08:54:01 +0000 (01:54 -0700)]
Fix bug 7590 - offline login fails because winbind deletes cache on every startup.
Sync lib/tdb_validate.c with the change in current master.
Change tdb_validate_open() to always use O_RDWR instead of O_RDONLY,
as (from the bug report): "db_check() will always return failure for a read-only database.
Silently, without any log output, when _tdb_lockall() fails."
Jeremy.
(cherry picked from commit
39cb903463d8a3fcabd9e148112bf5cf81744130)