1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

1775 Commits

Author SHA1 Message Date
Volker Lendecke
f036368efd Fix a segfault found by metze & valgrind...
Don't overwrite past the end of a string.

Volker
-
Gerald Carter
7bc4b65b91 * fix the trustdom_cache to work when winbindd is not running.
smbd will update the trustdom_cache periodically after locking
  the timestamp key
-
Gerald Carter
11eccaef1d fix for platforms that don't have unsetenv().
we now have to check the value for _NO_WINBINDD.
"1" enables, and != "1" disables (use "0" by convention).
-
Andrew Tridgell
53bfcd478a - added LOCALE patch from vorlon@debian.org (Steve Langasek) (bug #122)
- changed --enable-developer debug to use -gstabs as it makes the
  samba binaries about 10x smaller and is still quite functional for
  samba debugging
-
Gerald Carter
f804b590f9 Here's the code to make winbindd work on a Samba DC
to handle domain trusts.  Jeremy and I talked about this
and it's going in as working code.  It keeps winbind clean
and solves the trust problem with minimal changes.

To summarize, there are 2 basic cases where the deadlock would
occur.  (1) lookuping up secondary groups for a user, and
(2) get[gr|pw]nam() calls that fall through the NSS layer because
they don't exist anywhere.

o To handle case #1, we bypass winbindd in sys_getgrouplist() unless
  the username includes the 'winbind separator'.

o Case #2 is handled by adding checks in winbindd to return failure
  if we are a DC and the domain matches our own.

This code has been tested using basic share connections, domain
logons, and with pam_winbind (both with and without 'winbind
use default domain').  The 'trustdomain' auth module should work
as well if an admin wants to manually create UNIX users for
acounts in the trusted domains.

Other misc fixes:

  * we need to fix check_ntlm_password() to be able to determine
    if an auth module is authoritative over a user (NT_STATUS_WRONG_PASSWORD,
    etc...).  I worked around my specific situation, but this needs to be
    fixed.  the winbindd auth module was causing delays.
  * fix named server mutex deadlock between trust domain auth module
    and winbindd looking up a uid
  * make sure SAM_ACCOUNT gets stored in the server_info struct for the
    _net_sam_logon() reply.

Configuration details:

The recommended method for supporting trusts is to use winbind.
The gets us around some of the server mutex issues as well.

  * set 'files winbind' for passwd: and group: in /etc/nsswitch.conf
  * create domain trusts like normal
  * join winbind on the pdc to the Samba domain using 'net rpc join'
  * add normal parameters to smb.conf for winbind
  * set 'auth method = guest sam winbind'
  * start smbd, nmbd, & winbindd

Problems that remain:

  * join a Windows 2k/XP box to a Samba domain.
  * create a 2-way trust between the Samba domain
    and an NT domain
  * logon to the windows client as a user from theh trusted
    domain
  * try to browse server in the trusted domain (or other
    workstations).  an NT client seems to work ok, but 2k
    and XP either prompt for passwords or fail with errors.

apparanently this never got tested since no one has ever been
able to logon as a trusted user to a Samba domain from a Windows
client.
-
Gerald Carter
d7f7fcda42 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
-
Andrew Bartlett
57617a0f8c Patch to move functions directly from pdb_ldap.c into lib/smbldap.c
The functions are unchanged.  Next step is to make idmap_ldap use them.

Andrew Bartlett
-
Gerald Carter
14f2cd139a * set domain->last_status = NT_STATUS_SERVER_DISABLED on an ads_connect() failure
* Fix code to use winbind_rpc methods for trusted mixed mode or NT4 domains
  ( does no one ever test this? )
* add in LDAP code to get the sequence number for rpc based seqnum update.
  ( this is needed if the DC is upgraded and samba is not reconfigured
    to use security = ads; it's not pretty but it works (from app_head) )
* fix bug that caused us to enumerate domain local groups in domains
  other than our own
-
Gerald Carter
aac01dc7bc merge of the netsamlogon caching code from APPLIANCE_HEAD
This replaces the universal group caching code (was originally
based on that code).  Only applies to the the RPC code.

One comment: domain local groups don't show up in 'getent group'
that's easy to fix.

Code has been tested against 2k domain but doesn't change anything
with respect to NT4 domains.

netsamlogon caching works pretty much like the universal group
caching code did but has had much more testing and puts winbind
mostly back in sync between branches.
-
Andrew Bartlett
f93167a7e1 This patch works towards to goal of common code shared between idmap_ldap
and pdb_ldap.

So far, it's just a function rename, so that the next patch can be a very
simple matter of copying functions, without worrying about what changed
in the process.

Also removes the 'static' pointers for the rebind procedures, replacing them
with a linked list of value/key lookups.  (Only needed on older LDAP client
libs)

Andrew Bartlett
-
Volker Lendecke
c0e35f3be8 Const fixes by metze
Volker
-
Andrew Tridgell
382b9b806b reverted locale patch put in by jht (originally from vorlon).
There are lots of things wrong with this patch, including:

1) it overrides a user chosen configuration option

2) it adds lots of complexity inside a loop when a tiny piece of code
   outside the loop would do the same thing

3) it does no error checking, and is sure to crash on some systems

If you want this functionality then try something like this at the end
of charset_name():

#ifdef HAVE_NL_LANGINFO
	if (strcasecmp(ret, "LOCALE") == 0) {
		const char *ln = nl_langinfo(CODESET);
		if (ln) {
			DEBUG(5,("Substituting charset '%s' for LOCALE\n", ln));
			return ln;
		}
	}
#endif

then users can set 'display charset = LOCALE' to get the locale based
charset. You could even make that the default for systems that have
nl_langinfo().
-
John Terpstra
1e445fb422 Patch from vorlon@debian.org, see bugzilal #122
Samba should preferentially use the locale information from the native system,
and only fall back on 'display charset' if this is unavailable or unsupported.
-
Tim Potter
986eae40f7 Rename some uuid functions so as not to conflict with system
versions.  Fixes bug #154.
-
Andrew Tridgell
0ce6eddad8 applied patch from bug#140
this fixes a timestamp problem with 64 bit machines
-
Gerald Carter
1665926281 * break out more common code used between pdb_ldap and idmap_ldap
* remove 'winbind uid' and 'winbind gid' parameters (replaced
  by current idmap parameter)
* create the sambaUnixIdPool entries automatically in the 'ldap
  idmap suffix'
* add new 'ldap idmap suffix' and 'ldap group suffix' parametrer
* "idmap backend = ldap" now accepts 'ldap:ldap://server/' format
  (parameters are passed to idmap init() function
-
Jeremy Allison
8aa5f7a65c Fix for valgrind - when doing a srvstr_push we must zero fill
any extra bytes, not clobber region them - otherwise valgrind
thinks they are invalid on send() or write().
Jeremy.
-
Jelmer Vernooij
d3c02b40c4 Use filedes as first argument to fsetxattr, not the undefined variable 'path' :-) -
Andrew Tridgell
791a4cc7cf - the 8.3 name in BOTH_DIRECTORY_INFO is supposed to be always unicode
(to match win2003 behaviour)

- added the STR_TERMINATE_ASCII flag from samba4 so we can get the
  string termination right for the case where it is supposed to be
  non-terminated for UCS2 and terminated when ASCII
-
Jeremy Allison
4885314074 Get ready for EA code... Add Linux interface.
Jeremy.
-
Gerald Carter
8241758544 working draft of the idmap_ldap code.
Includes sambaUnixIdPool objectclass

Still needs cleaning up wrt to name space.
More changes to come, but at least we now have a
a working distributed winbindd solution.
-
Jelmer Vernooij
b45a67e7a9 Remove module_path_get_name() - it's not used anywhere anymore and was a bad idea anyway. -
Jelmer Vernooij
2aad573625 Get the events API right. Patch from metze with some minor modifications. -
Tim Potter
cdbe47a5d5 Fixed unused variable warning. -
Alexander Bokovoy
3786695c72 Evolve quotas configure check more. Patch from Stefan (metze) Metzemacher. Now we are defaulting to --with-quotas=no but anyway trying to test them in configure. This is done to get information about as much quota API variations as possible -- when --with-quotas=no this does not affect build but provides us with more detailed information on build farm. -
Gerald Carter
998586e652 *****LDAP schema changes*****
New objectclass named sambaSamAccount which uses attribute
prefaced with the phrase 'samba' to prevent future name clashes.

Change in functionality of the 'ldap filter' parameter.  This always
defaults to "(uid=%u)" now and is and'd with the approriate objectclass
depending on whether you are using ldapsam_compat or ldapsam

conversion script for migrating from sambaAccount to
sambaSamAccount will come next.
-
Tim Potter
4836c0c0fc Move some #ifdefs and function prototypes around to avoid a compiler
warning when we have a working version of snprintf()
-
Simo Sorce
0e58085978 And finally IDMAP in 3_0
We really need idmap_ldap to have a good solution with ldapsam, porting
it from the prvious code is beeing made, the code is really simple to do
so I am confident it is not a problem to commit this code in.

Not committing it would have been worst.
I really would have been able to finish also the group code, maybe we can
put it into a followin release after 3.0.0 even if it may be an upgrade
problem.

The code has been tested and seem to work right, more testing is needed for
corner cases.

Currently winbind pdc (working only for users and not for groups) is
disabled as I was not able to make a complete group code replacement that
works somewhat in a week (I have a complete patch, but there are bugs)

Simo.
-
Alexander Bokovoy
4bf022ce9e Add NT quota support. Patch from Stefan (metze) Metzemacher
1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab
2. Disabled by default and when requested, will be probed and enabled only on Linux where it works
3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far
Documentation to follow
-
Andrew Bartlett
c61e5e3877 When checking if a SID is in a domain, make sure that indeed the user RID is
one element longer than the domain sid.

Andrew Bartlett
-
Gerald Carter
83bb84f131 fixed bug #75; add check for non-zero destlen -
Tim Potter
05a684b3be Another attempt at undoing my bogus patch 1.55.2.19 -
Tim Potter
42d0414ed2 Whoops - that wasn't a whitespace syncup after all. -
Jelmer Vernooij
2f631769f8 Remove unused variables -
Jelmer Vernooij
3033a63cef Patch from metze to add exit and interval events. Useful for modules -
Tim Potter
4fccc1f16d Fixed typo introduced in reverted patch from version 1.12.4.5 -
Andrew Bartlett
ce4ff4cc8e Add a comment about the use of string functions in the modules code, and
add \n to the end of the non-dlopen case DEBUGs.

Andrew Bartlett
-
Paul Green
10bf65d335 Refactor existing sock_exec() and socketpair_tcp() functions into their own
source file. I will be making changes to sock_exec to work on VOS, which
has a blocking connect() call, but first I want to get it in its own source
file so that it can be called from a test program.
-
cvs2svn Import User
7347331053 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Paul Green
2dd18ca0cf Refactor existing sock_exec() and socketpair_tcp() functions into their own
source file. I will be making changes to sock_exec to work on VOS, which
has a blocking connect() call, but first I want to get it in its own source
file so that it can be called from a test program.
-
Jelmer Vernooij
f4576757d1 Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications.
-
Jelmer Vernooij
bc4b51bcb2 Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications.
-
Tim Potter
7fd7af121e Whitespace syncup. -
Tim Potter
40d370bec6 Two character tabs - I don't think so. -
Gerald Carter
920958a392 round three of CIDR fixes; spotted by Tomoki AONO -
Gerald Carter
554026b208 round three of CIDR fixes; spotted by Tomoki AONO -
Jelmer Vernooij
d29407d41e Complain about duplicate charsets at debug level 0 instead of 2 -
Jelmer Vernooij
871cad7e9a Get rid of module_path_get_name() and use the find backend function
to find duplicates
-
Jelmer Vernooij
9f9bdd97db Get rid of module_path_get_name() -
Jelmer Vernooij
69ec6be90f Check for absolute paths by only checking the first character of the module name.
Don't use strchr_m, which caused race conditions.
-