1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

13886 Commits

Author SHA1 Message Date
Gerald Carter
6237fae9b8 applying fix for group map conversion (patch from Kristyan Osborne) -
Gerald Carter
2f7051e2bc fix compile problem with nisplussam -
Volker Lendecke
0f3822c8e7 Different fix for memleak just committed. This belongs into
tdb_search_list_free.

Volker
-
Volker Lendecke
0f8933ae77 Fix two memory leaks. tdb_search_keys allocates space for the key
strings.

Running 'net cache list' or secrets_get_trusted_domains through
valgrind gives a *huge* amount of invalid reads of one byte beyond the
indicated string length in libc's strncpy. Annoying...

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

Volker
-
Volker Lendecke
9d317fb533 Don't set a mapping that is already there.
Volker
-
Andrew Bartlett
6babc35ef9 Grr, the order of these arguments matters -
Andrew Bartlett
dcdbd530a6 Make smbpasswd use the higher log level for the second run - this should
help us debug failures in smbpasswd.

Andrew Bartlett
-
Gerald Carter
fd24183ec3 fix typos in log messages and comments. -
Gerald Carter
90470366ea * revert change to get_global_sam_name()
* add get_default_sam_name() to be used by make_user_info_map()
* add comments describing get_*_sam_name()
-
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
-
Jeremy Allison
dbbd8dd155 Fixed the latest complaint from jcmd :-). We were storing -1 for the
CREATOR_OWNER/CREATOR_GROUP uid/gid entries in the SAMBA_PAI attribute.
Creator Owner and Creator group now show up as inherited correctly (I
think :-). Jim please test.
Jeremy.
-
Jeremy Allison
1714eb6bef Merge of Volkers patch to make the logic clearer (with my mod).
Jeremy.
-
Jeremy Allison
ba112bb3fd Fix missing ret = found by Volker.
Jeremy.
-
Gerald Carter
e1d6094d06 * cleanup more DC name resolution issues in check_*domain_security()
* is_trusted_domain() is broken without winbind.  Still working on this.
* get_global_sam_name() should return the workgroup name unless we
  are a standalone server (verified by volker)
* Get_Pwnam() should always fall back to the username (minus domain name)
  even if it is not our workgroup so that TRUSTEDOMAIN\user can logon
  if 'user' exists in the local list of accounts (on domain members w/o
  winbind)

Tested using Samba PDC with trusts (running winbindd) and a Samba 3.0
domain member not running winbindd.

notes: make_user_info_map() is slightly broken now due to the
fact that is_trusted_domain() only works with winbindd.  disabled
checks temporarily until I can sort this out.
-
Jeremy Allison
492a96e992 Valgrind found a bug (subtracting a pointer from a length rather than the
length of what the pointer points to).
Jeremy.
-
Jeremy Allison
fa23a4158e Finally ! Fixed the ACL ordering bug reported by jcmd. I realised we were
not sorting returned ACE's correctly w.r.t. W2K - implemented the correct
algorithm.
Jeremy.
-
Gerald Carter
80df684b72 removing old code -
Gerald Carter
52166faee7 * rename samstrict auth method to sam
* rename original sam auth method to sam_ignoredomain
* remove samstrict_dc auth method (now covered by 'sam')
* fix wbinfo -a '...' and getent passwd bugs when running
  winbindd on a samba PDC (reported by Volker)
-
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).
-
Volker Lendecke
21d330af10 Add the 'guest' passdb backend automatically if
guest account != ""

Volker
-
Tim Potter
b401e78b6e Yet more shadow variable warnings. -
Tim Potter
10c51bbef8 Fix more shadow variable warnings. -
Tim Potter
5ffb8e0920 Fix shadow variable warnings. -
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
77a5b1032f add check for NT_STATUS_NOT_IMPLEMENTED in auth check so that
map to guest = bad user works again when "trustdomain" is listed
as last auth method.

Also clean up some more DC location calls.
-
Gerald Carter
303fdc516c cleaning up after the s/in_addr/ip_service/ switch for the get_dc_list() patch -
Jeremy Allison
8f830c509a Some const correctness. Stop tdb being used as a remote backend. If an
idmap backend is specified cause smbd to ask winbindd (use winbindd if
you want a consistant remote backend solution).
Should work well enough for next beta now...
Jeremy.
-
Jeremy Allison
5b998cdc1d Add include guards around idmap.h, change ID_NOMAP to ID_QUERY_ONLY
and ID_CACHE to ID_CACHE_SAVE. Added locking around tdb writes & deletes
for multi-process access.
Jeremy.
-
Jeremy Allison
030b35ca0f As has been pointed out, ordering here doesn't matter so use normal
add.
Jeremy.
-
Jelmer Vernooij
b9b46d43c7 Remove the MODULES_CLEAN variable. It's no longer necessary since
object files for modules are in .po files, while object files for
static use are in .o files. Pointed out by metze.

This reduces the number of files that have to be recompiled after the Makefile
changes. Preventing unnecessary recompiling of the other few is high
on my todo list.
-
Jelmer Vernooij
13b81d0d92 Move up intialisation of logging, so we catch errors in handling 'preload modules' -
Alexander Bokovoy
0413385feb Document name resolve order suggested settings for security=ads as mentioned by Jerry -
Gerald Carter
3e9e4bb7d1 cleaning up more build issues. Tested
"--with-ads=no --with-ldap=yes" and "--with-ads=yes && make everything"
-
Jeremy Allison
a304bc5ff1 Fix immediate bug where the idmap can't tell the difference between an entry
not being present (and so allocate another) and an entry that is present but
of the wrong type. This code still has major problems...
Jeremy.
-
Jelmer Vernooij
ffaddd8202 Add netlogon debug registry key info -
Gerald Carter
42133092a4 fix linking of some things that are not built by default -
Gerald Carter
2d192e0431 ifdef out some functions that are not used when HAVE_ADS is not defined -
Gerald Carter
a59ea1d6d3 fix build on non-ldap platforms -
Jeremy Allison
dd9251e6f5 Ensure idmap backends are added in the correct order (DLIST_ADD puts
things at the *front* of the list). Add more debug. Still broken.. :-(.
Jeremy.
-
Gerald Carter
2a76101a3a * fix typos in a few debug statements
* check negative connection cache before ads_try_connect()
  in ads_find_dc()
-
Gerald Carter
ef978bd851 forgot one file -
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
-
Tim Potter
5ba121ac9d Metze assures me that this will fix Heimdal et al.
I think the lesson to take away here is that refactoring configure.in
is a hazardous task and should only be attempted if you have a lot
of time and patience!
-
Volker Lendecke
fdcfefd7f1 Fix a warning in a DEBUG
Clean up the init a little bit, less nested if-statements.

Agreed upon with Simo.

Volker
-
Simo Sorce
e154e50fed Tought I already done.
Set back 3.0 to use only winbindd_idmap.tdb as idmap database as told on
samba-technical.
Tested and working so far.
-
Tim Potter
7690a722f9 Only append to KRB5_LIBS when doing AC_CHECK_LIB for libkrb5.
I think we are done with MIT Kerberos for the moment.  The Heimdal detection
looks like it has been broken for ages so it's next on the list.
-
Tim Potter
4ddfab4a57 Don't trash the values of CFLAGS and LIBS while engaged in Kerberos
detection.  On Solaris 9 extra libraries -lber and -lresolv are
required for Kerberos tests.  We used to have an extra check for
-lresolv only but I think the correct solution is not to forget about it
in the first place.

This should fix bug #125 although I don't have access to a
system to test it out on.
-