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

803 Commits

Author SHA1 Message Date
Gerald Carter
4f97988dd6 fix more compiler warning after the latest static rampage -
Andrew Bartlett
203ce01836 Add more static...
Andrew Bartlett
-
Andrew Bartlett
ab25af0e18 nsswitch/winbindd_util.c:
add static

smbd/uid.c:
	remove unused function

Andrew Bartlett
-
Andrew Bartlett
fcdc5efb1e Make more functions static, and remove duplication in the use of functions
in lib/smbpasswd.c that were exact duplicates of functions in passdb/passdb.c

(These should perhaps be pulled back out to smbpasswd.c, but that can occour
later).

Andrew Bartlett
-
Gerald Carter
28c2a74c85 return NSS_SUCCESS if we have found the max number of gids possible on Solaris; patch from John Klinger <john.klinger@lmco.com> -
Jeremy Allison
2da24613ed A few fixes from "L. Lucius" <ib@digicron.com>. Don't use int when it's
really a size_t.
Jeremy.
-
Andrew Tridgell
d62cb9454e completely rewrote the AIX UESS backend (UESS is the AIX equivalent of
NSS). This time I think I've actually got it right. I wrote a fairly
good test suite for UESS modules (similar to nsstest.c) that allowed
me to explore how the modules supplied with AIX actually work.

This new module also incorporates authentication features, so you
don't need a PAM module at all. Just install this UESS module and
authentication will "just work". It also handles password change, so
/usr/bin/passwd can be used to change windows password.
-
Richard Sharpe
0032c3f46a Remove an unused parameter from reload_services_file. -
Andrew Bartlett
2a2b1f0c87 This adds client-side support for the unicode/SAMR password change scheme.
As well as avoiding DOS charset issues, this scheme returns useful error
codes, that we can map back via the pam interface.

This patch also cleans up the interfaces used for password buffers, to
avoid duplication of code.

Andrew Bartlett
-
Volker Lendecke
09a3001423 Fix typo -
Volker Lendecke
da5944129f Commit sid<->[ug]id extensions to libnss_winbind.so on Linux, as well as a
factored-out nss_winbind.[ch]. I took tridge's public domain license comment
for the nss_winbind.[ch].

This is probably not the last word on that extension, but as it is quite
non-intrusive to the main samba code, I would like to give it a start.

Volker
-
Volker Lendecke
945c780764 And another memory corruption in winbind. Arg 3 of safe_strcpy does not
include the terminating 0.

Volker
-
Volker Lendecke
cd89288e21 Fix a segfault in winbindd. Calling getusersids with a SID that results in 0
groups winbind ended up freeing an uninitialised pointer.

Volker
-
Gerald Carter
5134c6bcbc BUG 936: fix bind credentials for schannel binds in smbd (and add a comment to winbindd_cm about this -
Gerald Carter
40b7d863dc Fix initgroups() call nss_winbind on solaris; patch from John Klinger <john.klinger@lmco.com> -
Gerald Carter
1ed2e52153 * Revert to using rpc for mixed mode AD domains.
The reason for this are:
  (a) the set_dc_type_and_flags() cannot tell the different
      between connecting to an NT4 domain and an NT4 BDC
      of a mixed mode domain.
  (b) the connection management for the rpc backend only
      provides on named pipe per cli_state.  So it is possible
      to connect to an NT4 BDC for netlogon and an AD mixed mode
      DC for lsarpc.  RPC is the lowest common demonimator here.
  (c) Issue with the sequence number value between the
      highestCommittedUSN LDAP attribute and the seq_num returned
      via RPC.


We will revisit this later, but the changes need to make this
work right now are too broad and risky.
-
Andrew Bartlett
b0b2010461 Remove duplicate comment.
Andrew Bartlett
-
Gerald Carter
d7b6298b9e fixing compile problems due to my recent ads.h changes -
Stefan Metzmacher
12d6bc3bd0 update copyright to -2004
metze
-
Jelmer Vernooij
65b01f67d5 Use StrCaseCmp, not strcasecmp. Should fix winbind build on IRIX -
Gerald Carter
ba9dc0d9fd fix segfault when sid_ptr == 0 in DsEnumDomainTrusts() reply -
Gerald Carter
8e8a351cab fix a seg fault caused by abartlet's last checkin; there's no way this could have been tested against an NT4 DC -
Andrew Bartlett
595dee6607 use SAFE_FREE(), not free().
Andrew Bartlett
-
Andrew Bartlett
7c34de8096 This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
-
Andrew Bartlett
2e6eaad9ce Move more of winbind to use 'find_our_domain()' rather than the dangerous
find_domain_from_name(lp_workgroup()).

(as find_domain_from_name() can change the data in lp_workgroup())

Andrew Bartlett
-
Andrew Bartlett
703f101136 The correct test for 'is our primary domain' is domain->primary -
Andrew Bartlett
6a9bbd1da3 Machines are people too!
While machine accounts cannot use an NTLM login (NT4 style), they are
otherwise full and valid members of the domain, and expect to be able to
use kerberos to connect to CIFS servers.

This means that the LocalSystem account, used by various services, can
perform things like backups, without the admin needing to enter further
passwords.

This particular issue (bug 722) has started to come up a lot on the lists.

I have only enabled it for winbindd-based systems, as the macros use use
to call the 'add user script' will strip the $ from the username for
security reasons.

Andrew Bartlett
-
Andrew Bartlett
85da181e8a Don't duplicate pulling the 'IPC' username from secrets.tdb, instead
just use one function for both places.

Andrew Bartlett
-
Gerald Carter
fac5e05ca1 remove unused seek_file(); don't hardcode '\' when printing the auth-user -
Andrew Bartlett
93a5d8079a Ensure that for wbinfo --set-auth-user, we actually use the domain.
Andrew Bartlett
-
Volker Lendecke
541e6998a0 Fix warning
Volker
-
Andrew Bartlett
7e5855dfd2 shorten some more lines. -
Andrew Bartlett
687aececa6 Grumble... grumble... fix the build... -
Andrew Bartlett
3d91b0a006 Show the sid type in name->sid translatons in a way that can be easily
understood by humans.

Andrew Bartlett
-
Andrew Bartlett
32397c8b01 Change our Domain controller lookup routines to more carefully seperate
DNS names (realms) from NetBIOS domain names.

Until now, we would experience delays as we broadcast lookups for DNS names
onto the local network segments.

Now if DNS comes back negative, we fall straight back to looking up the
short name.

Andrew Bartlett
-
Andrew Bartlett
aacb817e89 Add const. -
Andrew Bartlett
06c3f15aa1 rpc_client/cli_lsarpc.c:
rpc_parse/parse_lsa.c:
nsswitch/winbindd_rpc.c:
nsswitch/winbindd.h:
 - Add const

libads/ads_ldap.c:
 - Cleanup function for use

nsswitch/winbindd_ads.c:
 - Use new utility function ads_sid_to_dn
 - Don't search for 'dn=', rather call the ads_search_retry_dn()

nsswitch/winbindd_ads.c:
include/rpc_ds.h:
rpc_client/cli_ds.c:
 - Fixup braindamage in cli_ds_enum_domain_trusts():
    - This function was returning a UNISTR2 up to the caller, and
      was doing nasty (invalid, per valgrind) things with memcpy()
    - Create a new structure that represents this informaiton in a useful way
      and use talloc.

Andrew Bartlett
-
Andrew Bartlett
131bb928f1 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

VL rewrote most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

I rewrote that patch, to ensure that we can keep an eye on the USN
(sequence number) of the entry - this allows us to ensure the read was
atomic.

In particular, the range retrieval is now generic, for strings.  It
could easily be made generic for any attribute type, if need be.

Andrew Bartlett
-
Andrew Bartlett
cf44549694 We can't possilby get 'ok' here, as the if statement above just checked for it. -
Volker Lendecke
3ce6c9f273 Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no
additional parameter.

Jerry: This is a change in behaviour, but I think it is necessary.

Volker
-
Volker Lendecke
dafa4d202b And yet another const
Volker
-
Andrew Bartlett
903263a1bd Under certain error conditions (a talloc() failure above) this would cause
a double-free(), and the resultant malloc heap corruption.

This may be one of our lurking winbind segfaults.

Andrew Bartlett
-
Andrew Bartlett
3f6d0cd3a8 Having no members of a group is a perfectly valid (if unusual) situation.
Andrew Bartlett
-
Volker Lendecke
0c8ee04c78 After talking with abartlet remove the fix for bug 707 again.
Volker
-
Volker Lendecke
9d8235bf41 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

I've rewritten most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

Andrew, you told me that you would like to see a check whether the AD sequence
number is the same before and after the retrieval to achieve atomicity. This
would be trivial to add, but I'm not sure that we want this, as this adds two
roundtrips to every membership query. We can not know before the first query
whether we get additional range values, and at that point it's too late to ask
for the USN.

Tested with a group of 4000 members along with lots of small groups.

Volker
-
Andrew Bartlett
6a8cc7f012 Changes to our PAM code to cope with the fact that we can't handle some
domains (in particular, the domain of the current machine, if it is not a PDC)

By changing the error codes, we now return values that PAM can correctly
use for better stacking of PAM modules - in particular of the password change
module.

This allows pam_winbind to co-exist with other pam modules for password changes.

Andrew Bartlett
-
Andrew Bartlett
6f3cd9e2af Forgot to commit this for the 'get our primary domain' change. -
Andrew Bartlett
cc050e0137 Jerry rightly complained that we can't assume that the first domain is
our primary domain - new domains are added to the front of the list. :-(

Use a much more reliable 'flag test' instead.  (note:  changes winbind structures, make clean).

Andrew Bartlett
-
Andrew Bartlett
494781f628 auth/auth_util.c:
- Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

Andrew Bartlett
-
Andrew Bartlett
3225f262b1 Get the DOMAIN\username around the right way (I had username\domain...)
Push the unix username into utf8 for it's trip across the socket.

Andrew Bartlett
-