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

803 Commits

Author SHA1 Message Date
Gerald Carter
19b8f496f8 fix more compiler warning after the latest static rampage
(This used to be commit 4f97988dd6)
2004-02-10 03:51:19 +00:00
Andrew Bartlett
f1429b0edc Add more static...
Andrew Bartlett
(This used to be commit 203ce01836)
2004-02-08 11:28:51 +00:00
Andrew Bartlett
0f1dcf9839 nsswitch/winbindd_util.c:
add static

smbd/uid.c:
	remove unused function

Andrew Bartlett
(This used to be commit ab25af0e18)
2004-02-08 11:26:46 +00:00
Andrew Bartlett
d198c55877 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
(This used to be commit fcdc5efb1e)
2004-02-08 08:38:42 +00:00
Gerald Carter
c254d4a57d return NSS_SUCCESS if we have found the max number of gids possible on Solaris; patch from John Klinger <john.klinger@lmco.com>
(This used to be commit 28c2a74c85)
2004-02-04 17:22:36 +00:00
Jeremy Allison
dac4fd693e A few fixes from "L. Lucius" <ib@digicron.com>. Don't use int when it's
really a size_t.
Jeremy.
(This used to be commit 2da24613ed)
2004-02-02 21:14:55 +00:00
Andrew Tridgell
a2b533c9f9 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.
(This used to be commit d62cb9454e)
2004-01-29 06:14:13 +00:00
Richard Sharpe
a01dfa47de Remove an unused parameter from reload_services_file.
(This used to be commit 0032c3f46a)
2004-01-29 00:10:40 +00:00
Andrew Bartlett
784b05c489 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
(This used to be commit 2a2b1f0c87)
2004-01-26 08:45:02 +00:00
Volker Lendecke
9038e9e2c3 Fix typo
(This used to be commit 09a3001423)
2004-01-23 12:57:29 +00:00
Volker Lendecke
fadc012803 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
(This used to be commit da5944129f)
2004-01-16 13:11:01 +00:00
Volker Lendecke
56c23c527b And another memory corruption in winbind. Arg 3 of safe_strcpy does not
include the terminating 0.

Volker
(This used to be commit 945c780764)
2004-01-15 15:36:01 +00:00
Volker Lendecke
617d7c0bcd Fix a segfault in winbindd. Calling getusersids with a SID that results in 0
groups winbind ended up freeing an uninitialised pointer.

Volker
(This used to be commit cd89288e21)
2004-01-15 15:00:44 +00:00
Gerald Carter
919c261a49 BUG 936: fix bind credentials for schannel binds in smbd (and add a comment to winbindd_cm about this
(This used to be commit 5134c6bcbc)
2004-01-15 06:55:10 +00:00
Gerald Carter
2624dd0313 Fix initgroups() call nss_winbind on solaris; patch from John Klinger <john.klinger@lmco.com>
(This used to be commit 40b7d863dc)
2004-01-14 21:22:30 +00:00
Gerald Carter
fe48d1c800 * 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.
(This used to be commit 1ed2e52153)
2004-01-14 16:25:39 +00:00
Andrew Bartlett
ade34c9ade Remove duplicate comment.
Andrew Bartlett
(This used to be commit b0b2010461)
2004-01-14 01:17:21 +00:00
Gerald Carter
31a3842644 fixing compile problems due to my recent ads.h changes
(This used to be commit d7b6298b9e)
2004-01-12 14:26:50 +00:00
Stefan Metzmacher
86450924a0 update copyright to -2004
metze
(This used to be commit 12d6bc3bd0)
2004-01-11 13:23:50 +00:00
Jelmer Vernooij
75117a357a Use StrCaseCmp, not strcasecmp. Should fix winbind build on IRIX
(This used to be commit 65b01f67d5)
2004-01-08 22:53:37 +00:00
Gerald Carter
6c39789e6f fix segfault when sid_ptr == 0 in DsEnumDomainTrusts() reply
(This used to be commit ba9dc0d9fd)
2004-01-08 22:21:29 +00:00
Gerald Carter
4fe1c0cd13 fix a seg fault caused by abartlet's last checkin; there's no way this could have been tested against an NT4 DC
(This used to be commit 8e8a351cab)
2004-01-08 19:56:40 +00:00
Andrew Bartlett
04d310b4d0 use SAFE_FREE(), not free().
Andrew Bartlett
(This used to be commit 595dee6607)
2004-01-08 08:41:26 +00:00
Andrew Bartlett
7d068355aa 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
(This used to be commit 7c34de8096)
2004-01-08 08:19:18 +00:00
Andrew Bartlett
88d8644ef7 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
(This used to be commit 2e6eaad9ce)
2004-01-08 02:15:46 +00:00
Andrew Bartlett
0e12b88274 The correct test for 'is our primary domain' is domain->primary
(This used to be commit 703f101136)
2004-01-08 00:55:13 +00:00
Andrew Bartlett
125e7e8e25 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
(This used to be commit 6a9bbd1da3)
2004-01-07 23:46:47 +00:00
Andrew Bartlett
43a4e1dbf9 Don't duplicate pulling the 'IPC' username from secrets.tdb, instead
just use one function for both places.

Andrew Bartlett
(This used to be commit 85da181e8a)
2004-01-07 10:11:24 +00:00
Gerald Carter
d86628d062 remove unused seek_file(); don't hardcode '\' when printing the auth-user
(This used to be commit fac5e05ca1)
2004-01-06 19:57:14 +00:00
Andrew Bartlett
1fa073b55b Ensure that for wbinfo --set-auth-user, we actually use the domain.
Andrew Bartlett
(This used to be commit 93a5d8079a)
2004-01-06 00:32:24 +00:00
Volker Lendecke
7e2bebae60 Fix warning
Volker
(This used to be commit 541e6998a0)
2004-01-05 16:58:37 +00:00
Andrew Bartlett
ad390f9336 shorten some more lines.
(This used to be commit 7e5855dfd2)
2004-01-05 12:21:04 +00:00
Andrew Bartlett
c88d6d87ef Grumble... grumble... fix the build...
(This used to be commit 687aececa6)
2004-01-05 05:07:59 +00:00
Andrew Bartlett
db44ffd3ac Show the sid type in name->sid translatons in a way that can be easily
understood by humans.

Andrew Bartlett
(This used to be commit 3d91b0a006)
2004-01-05 04:26:35 +00:00
Andrew Bartlett
a7f8c26d24 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
(This used to be commit 32397c8b01)
2004-01-05 04:10:28 +00:00
Andrew Bartlett
430eb9ad45 Add const.
(This used to be commit aacb817e89)
2004-01-05 02:16:51 +00:00
Andrew Bartlett
614c18d24b 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
(This used to be commit 06c3f15aa1)
2004-01-05 02:04:37 +00:00
Andrew Bartlett
685e0cbeb8 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
(This used to be commit 131bb928f1)
2004-01-05 01:48:21 +00:00
Andrew Bartlett
b0682de709 We can't possilby get 'ok' here, as the if statement above just checked for it.
(This used to be commit cf44549694)
2004-01-05 00:15:34 +00:00
Volker Lendecke
fd35232584 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
(This used to be commit 3ce6c9f273)
2004-01-04 11:51:31 +00:00
Volker Lendecke
d01733eb32 And yet another const
Volker
(This used to be commit dafa4d202b)
2004-01-03 20:20:59 +00:00
Andrew Bartlett
fd346ce0c9 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
(This used to be commit 903263a1bd)
2004-01-02 11:39:07 +00:00
Andrew Bartlett
ffedf5a1aa Having no members of a group is a perfectly valid (if unusual) situation.
Andrew Bartlett
(This used to be commit 3f6d0cd3a8)
2004-01-02 05:33:14 +00:00
Volker Lendecke
9f662094af After talking with abartlet remove the fix for bug 707 again.
Volker
(This used to be commit 0c8ee04c78)
2004-01-01 21:10:35 +00:00
Volker Lendecke
31ff56fd3e 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
(This used to be commit 9d8235bf41)
2004-01-01 20:30:50 +00:00
Andrew Bartlett
5d55674b52 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
(This used to be commit 6a8cc7f012)
2003-12-31 08:45:03 +00:00
Andrew Bartlett
b34401b48a Forgot to commit this for the 'get our primary domain' change.
(This used to be commit 6f3cd9e2af)
2003-12-31 08:42:22 +00:00
Andrew Bartlett
e6de276ff4 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
(This used to be commit cc050e0137)
2003-12-31 05:26:29 +00:00
Andrew Bartlett
5eee23cc64 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
(This used to be commit 494781f628)
2003-12-31 00:31:43 +00:00
Andrew Bartlett
bcd0e51e28 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
(This used to be commit 3225f262b1)
2003-12-30 22:27:33 +00:00