1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

31102 Commits

Author SHA1 Message Date
Jeremy Allison
a6f402ad87 Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker.
Create widelinks_warning(int snum) to cover the message needed in make_connection.

Jeremy.
2010-02-11 15:16:23 -08:00
Kai Blin
4ff7f6ed36 s3 test: Make the netbios name test pass again 2010-02-11 23:56:36 +01:00
Jeremy Allison
02a5078f1f Final part of jumbo patch for bug #7104 - "wide links" and "unix extensions" are incompatible.
Volker pointed out that the preexec scripts get passed the conn->connectpath
as a parameter, so call canonicalize_connect_path() both *before* and after
the preexec scripts. Ignore errors on the call before the preexec scripts,
as the path may not exist until created by the preexec scripts.

Jeremy.
2010-02-11 14:45:53 -08:00
Simo Sorce
5d92d969dd Introduce lp_safe_widelinks()
This way we avoid any chance that a configuration reload may turn
back on wide links when unix extensions are enabled.
2010-02-11 16:27:17 -05:00
Jeremy Allison
94865e4dbd Fine changes to previous fix for bug #7104 - "wide links" and "unix extensions" are incompatible.
Make sure we match the previous allow widelinks behavior, in that
non-root preexec scripts can create share directories for a share
definition.

Jeremy
2010-02-11 11:00:45 -08:00
Jeremy Allison
cd18695fc2 Suplementary patch for bug #7104 - "wide links" and "unix extensions" are incompatible.
Bug reported by Ralf Zimmermann <r.zimmermann@siegnetz.de>. Reproduced by jra.

If the target directory of a share doesn't exist, but is designed to
be created by a "root preexec" script call, then the widelinks check
is done too early - thus preventing the user from connecting to the
share.

Fix is to re-arrange the order of checks in make_connection_snum()
to always do the following order of operations:

(1). Turn off wide links if unix extensions = yes.
(2). Call any root preexec scripts.
(3). Canonicalize the share path to remove any symlinks (ie. end
up with the realpath in the connection_struct).

Jeremy.
2010-02-11 10:19:33 -08:00
Günther Deschner
a16e974593 spoolss: allow to set server architecture via parametric option.
This allows to set "spoolss:architecture = 'Windows x64'" for debugging purpose.

Guenther
2010-02-11 13:29:59 +01:00
Günther Deschner
25001bbd1b s3-spoolss: implement spoolss_EnumJobs level 3.
Level 3 has been added with NT 4.0 and Windows 7 (at least 64bit version) makes
use of it in order to display queued jobs. Windows 7 will *not* fall back to
level 2 if we just return WERR_UNKNOWN_LEVEL, instead there will be no printjobs
displayed at all.

Guenther
2010-02-11 13:27:46 +01:00
Jeremy Allison
0f0229c454 Fix unused variable warning after change to new DLINK macros.
Jeremy.
2010-02-10 17:20:21 -08:00
Jeremy Allison
ed0e0a2005 Fix bad use when freeing linked list. Todd Stecher (Original author) please check !
Jeremy.
2010-02-10 16:23:33 -08:00
Andrew Tridgell
32809bd8c1 util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
This changes the meaning of the ->prev pointer in our doubly linked
lists to point at the end of the list from the front of the list. That
allows us to implement DLIST_ADD_END() and related functions in O(1)
time, which can be a huge saving in many places in Samba.

This also means that the 'type' argument to various DLIST_*() macros
is no longer needed, but I have left it in for now to keep the
patchset small, which will make it easier to revert if any problems
are found. In the future we should remove the 'type' arguments.

(jra. Move the one use of DLIST_TAIL over to the new macros).
2010-02-10 15:53:58 -08:00
Andrew Tridgell
13ac4ad521 s3-smbd: update to use new DLIST macros
(cherry picked from commit 365b408c458c848a818637d9b36a0423aeb1ba54)
2010-02-10 15:43:49 -08:00
Andrew Tridgell
aa52a0925d s3-registry: update to use new DLIST macros
(cherry picked from commit 3437713ad7e5bccafde30553a8232119fd2a9eb9)
2010-02-10 15:42:00 -08:00
Andrew Tridgell
f592d42047 s3-perfcount: update to use new DLIST macros
(cherry picked from commit a13b507f2d8be7f90c8872094cd0732926a6fcbb)
2010-02-10 15:41:22 -08:00
Andrew Tridgell
4689826e39 s3-locking: update to use DLIST_ADD_AFTER()
(cherry picked from commit 6c6df527e14514027cbcaa6deac25adf04363926)
2010-02-10 15:40:44 -08:00
Andrew Tridgell
d550621561 s3-libsmb: update libsmb to use new DLIST macros
manipulating p->prev directly is not safe any more
(cherry picked from commit 3c650ac1e3e1cdbbabecfddcd29325f20b5dcb48)
2010-02-10 15:38:48 -08:00
Andrew Tridgell
7842b391b9 s3-memcache: update memcache to use new DLIST macros
we don't need a separate lru pointer any more
(cherry picked from commit 4ffd7aca3e38728077bd80c2a65c4efbcfd216fc)
2010-02-10 15:38:31 -08:00
Andrew Tridgell
54fc99e04b s3-ldb: update the old ldb in s3 to use new DLIST macros
(cherry picked from commit a7d8bfd373392eecf4fff33d39b85e1b55ad901d)
2010-02-10 15:38:16 -08:00
Andrew Tridgell
ece7089918 s3-nmbd: update nmbd to use new DLIST_ macros
(cherry picked from commit 4d23d777bc6d4fad20d0f3084fe658635812bee9)
2010-02-10 15:36:37 -08:00
Jeremy Allison
32575ed70f Temporary changes to dlinklist to keep the implementation static whilst
uses of (list)->prev are moved over to DLIST_PREV. This will be replaced
when the final (new) version of the dlinklist.h header is added.

Jeremy.
2010-02-10 15:30:59 -08:00
Jeremy Allison
f2d7d9774e Revert "Change the default of "nmbd bind explicit broadcast" to "no""
This reverts commit 84fba3c1bc.

Now we have a "processed packet queue" in nmbd we can go back
to doing this by default.

Jeremy.
2010-02-10 12:42:27 -08:00
Jeremy Allison
c2f3ed48c5 More of the fix for bug #7118 - nmbd problems with socket address.
Add a simple "processed packet queue" cache to stop nmbd responding to
packets received on the broadcast and non-broadcast socket (which
it has opened when "nmbd bind explicit broadcast = yes").

This is a very simple packet queue - it only keeps the packets
processed during a single call to listen_for_packets() (i.e. one
select call). This means that if the delivery notification for a
packet received on both broadcast and non-broadcast addresses
is done in two different select calls, the packet will still be
processed twice. This is a very rare occurrance and we can just
live with it when it does as the protocol is stateless. If this
is ever flagged as a repeatable problem then we can add a longer
lived cache, using timeout processing to clear etc. etc. But without
storing all packets processed we can never be *sure* we've eliminated
the race condition so I'm going to go with this simple solution until
someone proves a more complex one is needed :-).

Jeremy.
2010-02-10 12:32:05 -08:00
Jeremy Allison
84fba3c1bc Change the default of "nmbd bind explicit broadcast" to "no"
until the double processing problem in bug #7118 is fixed.

Jeremy.
2010-02-10 08:39:37 -08:00
Björn Jacke
9b75650f1a s3: change ldap filter to what really was intended 2010-02-10 13:48:11 +01:00
Jeremy Allison
8ddc977c14 Fix bug #7122 - Reading a large browselist fails (server returns invalid values in subsequent SMBtrans replies)
There are two problems:

1). The server is off-by-one in the end of buffer space test.
2). The server returns 0 in the totaldata (smb_vwv1) and totalparams (smb_vwv0)
fields in the second and subsequent SMBtrans replies.

This patch fixes both.

Jeremy.
2010-02-09 15:14:38 -08:00
Jeremy Allison
a056eb85ff Missed one check on the memcpy for bug #7063.
Jeremy.
2010-02-09 14:56:12 -08:00
Jeremy Allison
539bbf8653 Second part of fix for bug 7063 - Samba 3.4.5 on ubuntu 8.04 64 bit - Core dumps.
Ensure we have no naked memcpy calls. This isn't a crash bug (it's
already checked in the data_blob_talloc_zero() above, but I want to
get into the pattern of having all memcpy's covered by safety checks.

Jeremy.
2010-02-09 14:48:15 -08:00
Jeremy Allison
9ad6f432f3 Fix off-by-one error in working out the limit of the NetServerEnum comment.
Jeremy.
2010-02-09 12:17:08 -08:00
Stefan Metzmacher
bc8242a08e s3:smbd: use StrCaseCmp() instead of strcasecmp
metze
2010-02-09 18:59:16 +01:00
Stefan Metzmacher
1686a5e7e7 s3:smbd: Fix really ugly bool vs. int bug!!!
A comparison function for qsort needs to return an 'int'!
Otherwise you'll get random results depending on the compiler
and the architecture...

metze
2010-02-09 18:59:15 +01:00
Stefan Metzmacher
e0472c59c8 s3:selftest: make selftest requires bash for now
So force bash until we removed the dependency to bash.

metze
2010-02-09 12:58:29 +01:00
Stefan Metzmacher
4dc2be2264 s3:passdb: only use gid_to_sid() result if the result is a group of our local sam
Otherwise retry with pdb_gid_to_sid().

metze
2010-02-09 12:57:01 +01:00
Björn Jacke
fb0c032097 s3: fix some wrong newlines in de translation strings 2010-02-09 10:11:33 +01:00
Björn Jacke
d1c7d7d21a vfs_catia: fix return type warnings 2010-02-09 10:11:29 +01:00
Jeremy Allison
3f2415c9bf Make "nmbd bind explicit broadcast" on by default.
Fix a comment typo.

Jeremy.
2010-02-08 14:35:02 -08:00
Jeremy Allison
e425162933 Fix bug #6876 for acl_tdb module.
As pointed out by bj@sernet.de, the rmdir module initializer was
duplicated. Fix this properly.

Jeremy.
2010-02-08 11:04:38 -08:00
Stefan Metzmacher
9b5198dd44 s3:libsmb: fix NetServerEnum3 rap calls.
metze
2010-02-08 18:47:41 +01:00
Stefan Metzmacher
30eec0656c s3:smbd: implement api_RNetServerEnum3
This is needed to support large browse lists.

metze
2010-02-08 18:47:41 +01:00
Stefan Metzmacher
495ac46166 s3:smbd: add/improve some DEBUG messages in api_RNetServerEnum2()
metze
2010-02-08 18:46:57 +01:00
Stefan Metzmacher
dc58672c65 s3:smbd: rename api_RNetServerEnum => api_RNetServerEnum2
metze
2010-02-08 18:35:12 +01:00
Stefan Metzmacher
0140bc389d s3:nmbd: change "nmbd:bind explicit broadcast" into "nmbd bind explicit broadcast"
metze
2010-02-08 18:35:11 +01:00
Stefan Metzmacher
30a1bc3650 s3:nmbd: also listen explicit on the subnet broadcast addresses
And send replies always via the unicast address of the subnet.

This behavior is off by default (as before)
and can be enabled with "nmbd:bind explicit broadcast = yes".

metze
2010-02-08 18:35:10 +01:00
Günther Deschner
89c089d993 s3-net: fix net ads dns usage calls.
Bjoern, please check.

Guenther
2010-02-08 11:55:52 +01:00
Stefan Metzmacher
6753fb1cf6 s3:pdb_ldap: don't search for the users primary group, if we already know it
metze
2010-02-08 11:23:25 +01:00
Stefan Metzmacher
49ace81e19 s3:pdb_ldap: optimize ldapsam_alias_memberships() and cache ldap searches.
ldapsam_alias_memberships() does the same LDAP search twice, triggered
via add_aliases() from create_local_nt_token().

This happens when no domain aliases are used.

metze
2010-02-08 11:23:24 +01:00
Stefan Metzmacher
25038fa85f s3:pdb_ldap: try to build the full unix_pw structure with ldapsam:trusted support
And also store the gid_to_sid mappings in the idmap_cache.

metze
2010-02-08 11:23:24 +01:00
Stefan Metzmacher
e10d086956 s3:passdb: speed up pdb_get_group_sid()
Use the cached version gid_to_sid() instead
of pdb_gid_to_sid().

And also avoid the expensive lookup_sid() call
for wellkown domain groups.

metze
2010-02-08 11:23:23 +01:00
Volker Lendecke
b99046fed1 s3: Make pdb_copy_sam_account also copy the group sid
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-08 11:23:23 +01:00
Stefan Metzmacher
779821df8e s3: shortcut gid_to_sid when "ldapsam:trusted = yes"
The normal gid_to_sid behaviour is to call sys_getgrgid()
to get the name for the given gid and then call the
getsamgrnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the gid_to_sid
operation to one simple search for the gidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

metze
2010-02-08 11:23:17 +01:00
Bo Yang
9fed9011ff s3: Don't invalidate cache for uninitialized domains.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-09 17:06:14 +08:00