1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

237 Commits

Author SHA1 Message Date
Jeremy Allison
0fdf60f051 Finish adding strings to all talloc_init() calls.
Jeremy.
(This used to be commit 784d15761c)
2002-12-23 23:53:56 +00:00
Jeremy Allison
7f23546730 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 842e08e52a)
2002-12-20 20:23:06 +00:00
Gerald Carter
f6c4f25e43 merge of get_dc_name()-like code from APP_HEAD; better support password server = DC1 *
(This used to be commit 6b18ca9511)
2002-12-12 23:35:55 +00:00
Jeremy Allison
7dd847ba9c Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
(This used to be commit ff3a8d3728)
2002-12-11 23:54:46 +00:00
Andrew Bartlett
969b569d84 Make it clear that we might not be talking to a PDC here.
(This used to be commit 7d099e9a5b)
2002-12-01 03:11:53 +00:00
Gerald Carter
191dff2d27 [merge from APP_HEAD]
90% fix for CR 1076.  The password server parameter will no take things
like

        password server = DC1 *

which means to contact DC1 first and the go to auto lookup if it
fails.


jerry
(This used to be commit c31a17889e)
2002-11-23 14:27:56 +00:00
Andrew Bartlett
ac29d6b310 Small auth updates:
- add static remove unnneded prototype
 - move become_root() to just around pdb calls, so as to make it easier to
remove when we kill off this silly idea
 - Change auth_sam to do 'account before password' rather than 'password before
account'.  This means that we match Win2k in giving 'account disabled' instead
of 'wrong password' if the wrong password to a disabled account is used.

Andrew Bartlett
(This used to be commit e6d2debaf6)
2002-11-15 21:23:55 +00:00
Jeremy Allison
250c980119 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit 82b8f749a3)
2002-11-12 23:15:52 +00:00
Jeremy Allison
5a21d8021a Fix bug found by tpot with given password server.
Jeremy.
(This used to be commit 90ac8184a0)
2002-11-09 03:57:28 +00:00
Tim Potter
5565aa9972 Don't set global_machine_password_needs_changing if
lp_machine_password_timeout() is set to zero.
(This used to be commit 0fa87a68fe)
2002-11-08 01:34:58 +00:00
Tim Potter
ea24bb2da8 Merge of get_dc_list() api change. This was slightly more intrusive
than the version in APPLIANCE so watch out for boogs.
(This used to be commit 1e054e3db6)
2002-11-06 01:29:07 +00:00
Andrew Bartlett
0ead4ef3c2 Move to the use of the 'initialised' flag, rather than the fact the pointer is
NULL.

Andrew Bartlett
(This used to be commit 2115335857)
2002-11-04 12:36:37 +00:00
Andrew Tridgell
281284c819 make_server_info_guest() can need root for the ldapsam backend
(This used to be commit 918099f096)
2002-11-03 13:33:00 +00:00
Jeremy Allison
389a16d9d5 Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
(This used to be commit b521abd86b)
2002-10-17 17:10:29 +00:00
Andrew Bartlett
4ac9ccfde4 Nice *big* patch from metze.
The actual design change is relitivly small however:

It all goes back to jerry's 'BOOL store', added to many of the elements in a
SAM_ACCOUNT.  This ensured that smb.conf defaults did not get 'fixed' into
ldap.  This was a great win for admins, and this patch follows in the same way.

This patch extends the concept - we don't store values back into LDAP unless
they have been changed.  So if we read a value, but don't update it, or we
read a value, find it's not there and use a default, we will not update
ldap with that value.  This reduced clutter in our LDAP DB, and makes it
easier to change defaults later on.

Metze's particular problem was that when we 'write back' an unchanged value,
we would clear any muliple values in that feild.  Now he can still have his
mulitivalued 'uid' feild, without Samba changing it for *every* other
operation.

This also applies to many other attributes, and helps to eliminate a nasty
race condition.  (Time between get and set)

This patch is big, and needs more testing, but metze has tested usrmgr, and
I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly
flawed ;-).

The same system will be introduced into the SAM code shortly, but this fixes
bugs that people were coming across in production uses of Samba 3.0/HEAD, hence
it's inclusion here.

Andrew Bartlett
(This used to be commit 7f237bde21)
2002-10-12 03:38:07 +00:00
Gerald Carter
83e58265b5 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
(This used to be commit 38c9e42998)
2002-10-04 03:51:43 +00:00
Andrew Bartlett
ac625a8235 Second stab at Volker's 'make shadow passwords work' patch.
Basicly, the password and the salt must be taken from the same place in both
passwd and shadow based systems.  Taking salt from one, and password from the
other just doesn't work.

So pull them from passwd, then overwrite them if need be.

When modifying this file, watch the #ifdef hell - as vl found out, some
variables are globals - but only with #ifndef WITH_PAM, and the code jumps all
over the place with the password cracker.

Getting double-reviews of any change to this file highly advised, it is one of
our most system-specifc areas of code.

(So now I get to take the blame for this one... :-)

Andrew Bartlett
(This used to be commit f39f167900)
2002-09-28 13:29:51 +00:00
Andrew Bartlett
465d93b1c6 Back our volker's patch as was breaking the build.
Volker, I would like to understand what you are trying to do here...

I'll trust that it's broken (this code is certainly not well tested) but I do
want to keep a close eye on the fixes...

Andrew Bartlett
(This used to be commit 4b72f84cf9)
2002-09-27 23:56:20 +00:00
Volker Lendecke
086dcdca76 Sorry to touch such an internal function. But I was quite surprised that
'security = user', 'encrypt passwords = no' did not work anymore.
This is on quite a standard SuSE 7.3, ./configure.developer --with-tdbsam.
I can provide a config.log / config.h on demand.

Please re-check for consequences, I don't really oversee that file.

Thanks,

Volker
(This used to be commit ba754b57dd)
2002-09-27 16:20:09 +00:00
Andrew Bartlett
2bd2b243fc Move to common user token debugging, and ensure we always print both the
NT_TOKEN and the unix credentials - as we incresingly use the NT stuff we want
to make it easy to check they don't get out of wack.

Andrew Bartlett
(This used to be commit a3882a1925)
2002-09-25 09:34:43 +00:00
Andrew Tridgell
b33681fc0b Add clock skew handling to our kerberos code. This allows us to cope with
the DC being out of sync with the local machine.
(This used to be commit 0d28d76947)
2002-09-17 12:12:50 +00:00
Tim Potter
3cc83a8739 Don't display debugs of the nt user token twice.
(This used to be commit 2011a38f3b)
2002-09-15 23:42:59 +00:00
Tim Potter
f3008f5463 Merge of 'other_sids' patch from appliance.
(This used to be commit 7decd4b3a9)
2002-09-15 23:40:55 +00:00
Andrew Bartlett
789d51b42c This is the 'easy' parts of the trusted domains patch n+3 patch from
Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>

It includes a conversion of make_user_info*() to NTSTATUS and some minor
changes to other files.

It also picks up on a nasty segfault that can occour in some security=domain
cases.

Andrew Bartlett
(This used to be commit d1e1fc3e4b)
2002-09-06 13:37:11 +00:00
Herb Lewis
39e21d4ef2 off by one in writing to malloced array. this fixes smbd crash I saw at
the CIFS conference - finally got purify working
(This used to be commit cf9bb66aa9)
2002-08-30 18:56:46 +00:00
Jean-François Micouleau
cfb5e91178 added cli_net_auth_3 client code.
changed cli_nt_setup_creds() to call cli_net_auth_2 or cli_net_auth_3 based on a switch.
pass also the negociation flags all the way.
all the places calling cli_nt_setup_creds() are still using cli_net_aut2(), it's just for future use and for rpcclient.

in the future we will be able to call auth_2 or auth_3 as we want.

	J.F.
(This used to be commit 4d38caca40)
2002-08-30 10:46:59 +00:00
Andrew Bartlett
bd11a63c53 We don't need the RTLD_GLOBAL.
(This used to be commit 0d562b81bf)
2002-08-29 17:36:44 +00:00
Andrew Bartlett
2560c73026 Updates!
- Don't print an uninitialised buffer in service.c
- Change some charcnv.c functions to take smb_ucs2_t ** instead of void **
- Update NTLMv2 code to use dynamic buffers
- Update experimental SMB signing code - still more work to do
- Move sys_getgrouplist() to SAFE_FREE() and do a DEBUG() on initgroups()
  failure.

Andrew Bartlett
(This used to be commit de1964f7fa)
2002-08-26 03:08:37 +00:00
Andrew Bartlett
9c7742727a Try to support non-root-mode systems without getgrouplist().
Andrew Bartlett
(This used to be commit 17096315a0)
2002-08-26 00:43:06 +00:00
Tim Potter
3276da4314 Spelling fixes.
(This used to be commit 24fa84bda4)
2002-08-22 09:48:06 +00:00
Andrew Bartlett
07dbe5af57 Cope with non-unix accounts - we just won't get the groups for those users.
Andrew Bartlett
(This used to be commit 7cad781455)
2002-08-21 11:34:05 +00:00
Andrew Bartlett
8674440d81 Based orginally by work by Kai, this patch moves our NT_TOKEN generation into
our authenticaion code - removing some of the duplication from the current
code.

This also gets us *much* closer to supporting a real SAM backend, becouse the
SAM can give us the right info then.

This also changes our service.c code, so that we do a VUID (rather than uid)
cache on the connection struct, and do full NT ACL/NT_TOKEN checks (or cached
equivilant) on every packet, for the same r or rw mode the whole share was open
for.

Andrew Bartlett
(This used to be commit d8122cee05)
2002-08-20 01:54:28 +00:00
Jelmer Vernooij
64456bf3c0 fix typo auth/auth_server.c
remove unused 'max packet' and 'packet size' options
(This used to be commit 6a787a695d)
2002-08-19 18:06:07 +00:00
Andrew Bartlett
dd5615c042 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
(This used to be commit f393de2310)
2002-08-11 02:30:35 +00:00
Andrew Tridgell
ab9ff0fa73 This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
(This used to be commit e358d7b24c)
2002-08-05 02:47:46 +00:00
Andrew Bartlett
640e1dd446 Let everybody enjoy my new toy - make it the default!
Authenticaions will now attempt to use winbind, and only fall back to
'ntdomain' (the old security=domain) code if that fails (for any reason,
including wrong password).

I'll fix up the authenticaion code to better handle the different types of
failures in the near future.

Andrew Bartlett
(This used to be commit 78f0d4337b)
2002-07-31 12:17:32 +00:00
Andrew Bartlett
2d67a683b7 Winbind updates!
This updates the 'winbind' authentication module and winbind's 'PAM' (actually
netlogon) code to allow smbd to cache connections to the DC.

This is particulary relevent when we need mutex locks already - there is no
parallelism to be gained anyway.

The winbind code authenticates the user, and if successful, passes back the
'info3' struct describing the user.  smbd then interprets that in exactly the
same way as an 'ntdomain' logon.

Also, add parinoia to winbind about null termination.

Andrew Bartlett
(This used to be commit 167f122b67)
2002-07-31 12:05:30 +00:00
Andrew Tridgell
81b69dc79c the ads_connect() here doesn't need to actually succeed, as its only
needed to find the DC IP. Just don't check its return value!
(This used to be commit ab144cd8af)
2002-07-31 02:00:30 +00:00
Jim McDonough
d0fe79b9ee Fix the build for now..
Tridge, please look at this.  Did you mean to take out the last parm?
(This used to be commit f70886df94)
2002-07-30 17:38:27 +00:00
Andrew Tridgell
55c978d85e net ads info now reports the IP of the LDAP server as well as its name - very useful in scripts
(This used to be commit fc0d5479b5)
2002-07-30 15:34:10 +00:00
Andrew Tridgell
2edcc96c11 a couple more minor tweaks. This now allows us to operate in ADS mode
without any 'realm =' or 'ads server =' options at all, as long as DNS
is working right.
(This used to be commit d3fecdd042)
2002-07-30 13:27:42 +00:00
Andrew Tridgell
0bd3a76f67 2nd try at a fix for netbiosless connections to a ADS DC. This also
make the code a fair bit cleaner as it splits up the ADS and RPC
cases, which really are very different.
(This used to be commit 5a11c432af)
2002-07-30 12:42:41 +00:00
Andrew Tridgell
da44215ebb removed a gratuitous standard_sub_basic() on the 'password server'
field. This has got to be pointless.
(This used to be commit fd02adab54)
2002-07-30 11:30:13 +00:00
Andrew Tridgell
2b975fda87 - if we are in ADS mode then avoid an expensive netbios lookup to find
the servers netbios name when we don't need it. This also fixes ADS
  mode when the DC has netbios disabled.

- if the password server is specified as an IP then actually use that
  IP, don't do a lookup for the servers name :)
(This used to be commit 72042e94ef)
2002-07-30 11:21:42 +00:00
Simo Sorce
a4ec4acd61 found nasty bug in intl/lang_tdb.c tdb structure was not tested to not be null before close
this one fixes swat not working with browsers that set more then one language.

along the way implemented language priority in web/neg_lang.c with bubble sort

also changet str_list_make to be able to use a different separator string

Simo.
(This used to be commit 69765e4faa)
2002-07-28 18:10:39 +00:00
Tim Potter
0357388636 Renamed all the new_cli_netlogon_* functions to cli_netlogon_*
as they're no longer new!
(This used to be commit 277f6bbb9a)
2002-07-21 00:49:16 +00:00
Andrew Bartlett
ea9d3057e9 Try to fix up warnings - particularly on the IRIX 64 bit compiler (which had a
distinction between uchar and char).

Lots of const etc.

Andrew Bartlett
(This used to be commit 8196ee908e)
2002-07-20 11:58:06 +00:00
Andrew Bartlett
129b3966c0 Add support for a weird behaviour apparently used by Win9X pass-through
authentication - we can have an NT hash in the LM hash feild.

(I need to double-check this fix with tpot, who discovered it).

Also remove silly casts back and forth between uchar and char.

Andrew Bartlett
(This used to be commit 07e2b36311)
2002-07-20 06:55:05 +00:00
Andrew Bartlett
5e0cffda3e NT_STATUS_UNSUCCESSFUL just gets clients confused - move to NO_LOGON_SERVERS
becouse thats what Win2k gives when the PDC is down.

Some of these might better go to other errors, but the Win2k text message for
'unsuccessful' is not particularly useful.  (A device attached to the system is
not functioning...)

Andrew Bartlett
(This used to be commit 656f1d68e8)
2002-07-20 04:55:42 +00:00
Andrew Bartlett
71b04673bb Make it clear that the debug comment is the same as the command being tested
for failure.

Andrew Bartlett
(This used to be commit 6e22f39df8)
2002-07-09 13:12:27 +00:00