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

392 Commits

Author SHA1 Message Date
Andrew Bartlett
f8b06e0dab Move wbinfo over to d_printf(). Patch by Hasch@t-online.de (Juergen Hasch)
Andrew Bartlett
(This used to be commit 5710e588ce)
2002-03-01 01:13:42 +00:00
Andrew Tridgell
5046ae9a67 enable locking on the idmap database to make it safe to dump/restore
it externally while winbindd is running
(This used to be commit cd3a7466db)
2002-02-28 17:43:23 +00:00
Jeremy Allison
df43f3d410 Ensure that winbindd and smbd both use identical logic to find dc's.
Fix bug where zeroip addresses were being checked.
Jeremy.
(This used to be commit 8ed49fe0df)
2002-02-28 01:05:15 +00:00
Andrew Tridgell
276ff4df82 this allows us to support foreign SIDs in winbindd and smbd
this means "xcopy /o" has a chance of working with ACLs that contain
ACEs that use SIDs that the Samba server has no knowledge of.

It's a bit hackish, Tim, can you look at my uid.c changes?
(This used to be commit fe2db31485)
2002-02-27 23:51:25 +00:00
Tim Potter
25d8d308c8 make proto
(This used to be commit 98d3ea19b0)
2002-02-19 02:11:01 +00:00
Andrew Tridgell
ab02132b6c fixed a memory leak thanks to dleducq@arkoon.net
(This used to be commit e84c740017)
2002-02-18 11:39:36 +00:00
Andrew Bartlett
e91e0a83af Winbind cleanup.
This patch fixes the segfaults I introduced in the previous conneciton caching
patch.  It cleans up the connection cache a *lot* - in particular it adds
significant robustness to the operation.

If a the DC goes down, we no longer fail the next operation - the code checks
if the connection died during one of its own operations on the socket, and
restarts the conneciton as required.

There is still a memory leak in here somewhere - but this code also cleans up a
number of these.

Also added is the abilty to sepecify the domain of the 'get around restrict anonymous'
user that winbind uses.

Andrew Bartlett
(This used to be commit 92cbefdf27)
2002-02-15 13:28:59 +00:00
Andrew Bartlett
14e6be4975 A few small winbind updates:
Add a connection cache to the netlogon pipe.  This makes a *massive* difference
to the time-per-auth.  Also fix up *some* of the memory leaks in other
connection caches.

Add some debugging messages for the is_connected() code.  I'm thinking we
should get a client implementation of SMBecho and call it here - as it would
allow us to always know the DC is around before we start.

Down the debug level for some of the pam_winbind code - I'll probably down it
further when I'm finished debugging.

Andrew Bartlett
(This used to be commit 49d3e47666)
2002-02-11 01:29:07 +00:00
Andrew Bartlett
e32177ea9d Fix up some of the DEBUG lines in winbind_pam.c
(This used to be commit dfc8883305)
2002-02-08 06:43:55 +00:00
Tim Potter
1e94977a9b 0x is the traditional prefix for displaying hex numbers.
(This used to be commit f424b691ea)
2002-02-06 02:22:33 +00:00
Andrew Bartlett
ed389ee8dc Drastic impromvents to pam_winbind.
This adds code to do generic PAM -> NTSTATUS and NTSTATUS -> PAM error
conversions, and uses them to make the error handling in pam_winbind sane.

In particular, pam_winbind now uses PAM error codes, not silly '-1, -2 ...'
stuff, and logs the NTSTATUS error that winbind now sends over the pipe.

Added code to wbinfo to display these - makes a big difference in debugging
winbindd.

The main change here is the code to allow pam_winbind password changing to
correctly stack - This code ripped from pam_unix, and the copyright attached.
(Same as for all pam modules, including pam_winbind)

Andrew Bartlett
(This used to be commit dc1a72f896)
2002-02-05 09:40:36 +00:00
Jeremy Allison
69adbb0ce3 Fix from Michael Steffens <michael_steffens@hp.com> to make signal
processing work correctly in winbindd. This is a really good patch
that gives full select semantics to the Samba modified select.
Jeremy.
(This used to be commit 3af16ade17)
2002-01-31 23:26:12 +00:00
Andrew Tridgell
0815cd63bd reduced memory usage in winbindd with a rpc backend by using a
separate talloc context for each partial fetch
(This used to be commit 9c8a2fe4df)
2002-01-31 12:47:42 +00:00
Tim Potter
12b7f600a0 Removed unused variables.
(This used to be commit 703d06fee0)
2002-01-31 11:54:01 +00:00
Andrew Tridgell
3a1a53c88a added 'wbinfo --sequence' to show sequence numbers of all domains
(This used to be commit bcd234a3da)
2002-01-31 11:49:29 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Tim Potter
62ea16ae36 Fix for password change from Samuel Ziegler <sam@xpedion.com>
(This used to be commit 418bdd5919)
2002-01-30 03:23:40 +00:00
Tim Potter
4b9839c58a Removed silly fprintf(stderr, ...) debug.
Part of Samuel Ziegler's patch to get winbind password changing working
again in HEAD.
(This used to be commit b5540bee7b)
2002-01-30 03:14:20 +00:00
Andrew Bartlett
7b671e34f5 Some more 'winbind default domain' support patches from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

This patch is designed to remove the 'special cases' required for this support.

In particular this now kills off winbind_initgroups, as it appears no longer to
be required.

Andrew Bartlett
(This used to be commit f1d8d50976)
2002-01-27 12:12:22 +00:00
Andrew Bartlett
ba8c1c6e45 Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot
better.  This ensures that the RPC client code does as little 'magic' as
possible - this is up to the application/user.  (Where - for to name->sid code
- it was all along).  This leaves the change that allows the sid->name code to
return domains and usernames in seperate paramaters.

Andrew Bartlett
(This used to be commit 5dfba2cf53)
2002-01-26 11:48:42 +00:00
Andrew Bartlett
06c79a1757 Change the winbind interface to use seperate 'domain' and 'username' feilds for
the sid->uid and uid->sid conversions.

Remove some duplicate arguments from these funcitons, and update the
request/response structures for this and the 'winbind domain name' feature.

As such 'winbindd_lookup_name' now takes both a domain and username.
(This used to be commit ce1b4d4c30)
2002-01-26 09:55:38 +00:00
Andrew Bartlett
4691c931e8 Allow a winbind client to obtain the server's domain name.
(This used to be commit 85018fecfa)
2002-01-26 09:52:55 +00:00
Tim Potter
5bd34d995d Removed dodgy init of local variable.
(This used to be commit 1f7172b48e)
2002-01-25 05:28:38 +00:00
Tim Potter
d82e73ae55 Much more useful handling of backup domain controllers in winbindd. Honour
the "password server" smb.conf parameter when choosing a DC to connect to.

Due to the origin of the code in cm_get_dc_name() it wouldn't try
additional DCs if the first DC didn't work.  This would wedge winbindd if you
had "password server = foo1, foo2" and foo1 was down.
(This used to be commit fc7ed1b4a8)
2002-01-25 05:24:07 +00:00
Tim Potter
48c4877194 Call pidfile_create() as part of init sequence.
(This used to be commit fa05a7de6d)
2002-01-22 00:35:05 +00:00
Andrew Bartlett
93a8358910 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
(This used to be commit e870f0e727)
2002-01-20 01:24:59 +00:00
Jeremy Allison
95501cf1ba Fix to close winbindd_idmap on exit. Pointed out by Alexander Bokovoy.
Jeremy.
(This used to be commit 1bd96b3094)
2002-01-19 20:21:29 +00:00
Simo Sorce
7019bfe546 fixes (asprintf) from 2.2
(This used to be commit 6b123adda9)
2002-01-19 17:29:32 +00:00
Andrew Bartlett
1fb9ccc4e2 This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.

This 'corrects' that - but is not without its own problems.

As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.

The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.

I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.

As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.

(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)

Andrew Bartlett
(This used to be commit 07a21fcd23)
2002-01-18 02:37:55 +00:00
Jim McDonough
b5f5861225 Fix from 2.2. It didn't break on HEAD because it isn't being compiled. Herb?
(This used to be commit 4fcaec53de)
2002-01-15 17:58:59 +00:00
Herb Lewis
4ce7b42ee0 adding wins commands to winbindd - will check in the rest of the changes
after further testing in 2.2 branch.
(This used to be commit d5cdbc7e4f)
2002-01-15 01:42:57 +00:00
Andrew Bartlett
d76478f0a7 Initialise cli variables and try not to do a cli_shutdown() of uninitialsed
memory.

The winbind connection caching code isn't exactly a plesent beast, and there is
more work that needs to be done to nail this properly.

Andrew Bartlett
(This used to be commit dd40ce54b7)
2002-01-14 22:08:47 +00:00
Andrew Bartlett
0d1ecbbb73 I'm doing some things towards the NamedPipes game with lckl and he has asked me
to move this from being a static to matching its mate in lib/util_sock.c.

In any case, this should discorage anybody from using the 'wrong' version of
this function.  (ie the one from TNG, which needs a bit more error checking
depending on use).

Andrew Bartlett
(This used to be commit e6a3a01f79)
2002-01-13 11:13:54 +00:00
Andrew Bartlett
e895b9004e Many thanks to Alexander Bokovoy <a.bokovoy@sam-solutions.net>.
This work was sponsored by Optifacio Software Services, Inc.

Andrew Bartlett

(various e-mails announcements merged into some form of commit message below:)

This patch which adds basics of universal groups support
into Samba 3. Currently, only Winbind with RPC calls supports this, ADS
support requires additional (possibly huge) work on KRB5 PAC. However,
basic infrastructure is here.

This patch adds:

1. Storing of universal groups for particular user logged into Samba
software (smbd/ two winbind-pam methods) into netlogon_unigrp.tdb as array
of uint32 supplemental group rids keyed as DOMAIN_SID/USER_RID in tdb.

2. Fetching of unversal groups for given user rid and domain sid from
netlogon_unigrp.tdb.

Since this is used in both smbd and winbindd, main code is in
source/lib/netlogon_uingrp.c. Dependencies are added to AUTH_OBJ as
UNIGRP_OBJ and WINBINDD_OBJ as UNIGRP_OBJ.

This patch has had a few versions, the final version in particular:

Many thanks to Andrew Bartlett for critics and comments, and partly
rewritten code.

New:
- updated fetching code to changed byte order macros
- moved functions to proper namespace
- optimized memory usage by reusing caller's memory context
- enhanced code to more follow Samba coding rules

Todo:
- proper universal group expiration after timeout
(This used to be commit 80c2aefbe7)
2002-01-12 23:57:10 +00:00
Andrew Tridgell
13059beb24 force the time difference in cache comparisons to be unsigned to cope
with the local machine time changing
(This used to be commit 116c0a0e3b)
2002-01-11 10:05:34 +00:00
Andrew Tridgell
35623dac54 make the winbind sequence number code more robust
when switching from rpc to ADS this now should make sense
(This used to be commit ec73d26c7f)
2002-01-11 10:02:28 +00:00
Tim Potter
da84e2a756 Always query the PDC for the list of trusted domains rather than interating
the list received at startup or we get an out of date list.  I thought
there might be some sequence number that is incremented when a trusted
domain is added or removed - perhaps there is but I just haven't found it
yet.

 - Renamed get_domain_info() to init_domain_list()

 - Made an accessor function to return the list of trusted domains rather
   than using a global so we don't have to remember to put a magic init
   function

 - The getent state can not keep a pointer to a winbind_domain structure as
   it may be freed if init_domain_list() is called again so we keep the
   domain name instead
(This used to be commit 37216c649a)
2002-01-11 05:33:45 +00:00
Tim Potter
9ee8213f9a Some memory leak fixes.
(This used to be commit da4db0373b)
2002-01-11 03:49:51 +00:00
Tim Potter
85e06cebc0 Since AB has been changing the winbind interface it's time to add the "mock
swedish" test to client calls.  This is putting a length field at the
start of a request so we can disconnect clients talking with an out of date
libnss_winbind.so rather than deadlock them.

Misc cleanups:

 - made some int values uint32
 - moved WINBIND_INTERFACE_VERSION to start of cmd list
(This used to be commit a4af65b9b9)
2002-01-10 23:45:29 +00:00
Herb Lewis
e87d94d46d merge tpots name changes into IRIX part of code. When you change the name
of a define you need to grep for the old name and change ALL places.
(This used to be commit 09e3276fb7)
2002-01-10 18:49:37 +00:00
Andrew Bartlett
7d6dd0b3a0 Return the winbind separator over the socket, so programs don't have to parse
smb.conf to get it right.

While wb_client needs its lp_load() for samba dependency reasons, it now uses
the new method both to example and test the new code.

Also add an interface version function, and return the winbind's samba version
string.

In preperation for default domains, its now up to winbindd to reject plaintext
auths that don't have a seperator, but NTLM (CRAP) auths now have two feilds,
hence need parsing.

Andrew Bartlett
(This used to be commit 2bd2a092ee)
2002-01-10 11:28:14 +00:00
Andrew Bartlett
cf00e41421 This changes the winbind protcol a bit:
It adds a 'ping' request, just to check winbind is in fact alive

It also changes winbindd_pam_auth_crap to take usernames and domain seperatly.

(backward incompatible change, needs merge to 2.2, but this is not yet released
code, so no workarounds)

Finally, it adds some debugs and fixes a few memory leaks (uses talloc to do
it).

Andrew Bartlett
(This used to be commit 6df29bfe33)
2002-01-10 10:23:54 +00:00
Tim Potter
610f530aee A big tidyup while thinking about getting trusted domains being re-read
when they are added or removed on the PDC.

 - renamed GETPWNAM_FROM_{UID,USER} constants and functions to GETPW{NAM,UID}

 - renamed GETGRNAM_FROM_{GID,GROUP} constants and functions to GETGR{NAM,GID}

 - use SIGUSR2 in winbindd for debugging/logging instead of SIGUSR1 in
   preparation for moving to smbcontrol type messages (not sure whether to
   ditch this altogether or not)

 - tidy debugging messages in top level winbind user and group routines

 - convert talloc_init() to talloc_init_named()

 - make enumerations of the domain list use the same local variable names
(This used to be commit eeb8af9c1a)
2002-01-10 06:20:03 +00:00
Jeremy Allison
ca2558ff34 Fixed typo.
Jeremy.
(This used to be commit a99e0cec1e)
2002-01-09 20:48:18 +00:00
Jeremy Allison
0a3f6b9b48 HPUX nss fix.
Jeremy.
(This used to be commit 1f12e310e5)
2002-01-09 03:38:31 +00:00
Jeremy Allison
9178f89200 Getting ready to add winbindd support for HPUX 11.
Jeremy.
(This used to be commit 012a914412)
2002-01-08 21:11:25 +00:00
Tim Potter
105e35a6e4 Don't log the password in pam_sm_authenticate() unless DEBUG_PASSWORD is
defined.  This is done with --enable-developer mode.
(This used to be commit caff5dc1d6)
2002-01-07 02:57:06 +00:00
Andrew Bartlett
2de935d89f Further rpc_client removal, this time from winbindd.
Also removed the dependency on auth_util.o, which makes things nicer.

Finally, this kills off the NECESSARY_BECAUSE_SAMBA_DEPENDENCIES_ARE_SO_BROKEN_OBJ
makefile variable - becouse Samba dependencies are starting to be sane again!

Andrew Bartlett
(This used to be commit 4609edcac3)
2002-01-01 04:50:45 +00:00
Jeremy Allison
bb81e23e17 When running interactive we want to set our own process group for
signal management.
Jeremy.
(This used to be commit fffae94dd5)
2001-12-30 01:46:38 +00:00
Herb Lewis
480b5c8158 merge Jeremy's gcc3 warning fix from 2.2
(This used to be commit 52e9d2c383)
2001-12-22 01:15:58 +00:00
Herb Lewis
e674581416 merge IRIX winbind support from Samba 2.2 branch
(This used to be commit 20c5f042e3)
2001-12-22 00:51:32 +00:00
Tim Potter
2bfeee924c Append to log.winbindd instead of overwriting it so we are consistent with
smbd/nmbd behaviour.
(This used to be commit 54d2765615)
2001-12-21 02:23:38 +00:00
Andrew Tridgell
401c7495ea added ads_domain_sid() function
(This used to be commit ff002a458a)
2001-12-20 23:35:14 +00:00
Jeremy Allison
9ed10f83d7 Removed global debugf. Replaced with lp_set_logfile(name).
Fixed winbindd to finally stop leaving log. file droppings :-).
Jeremy.
(This used to be commit 0bea6cf79a)
2001-12-20 22:27:05 +00:00
Jeremy Allison
6ac6af60cb Setup global_myworkgroup. Needed for secrets fetch code.
Jeremy.
(This used to be commit 057e91c1c3)
2001-12-20 18:37:43 +00:00
Andrew Tridgell
6c7e9dfb29 net ads password and net ads chostpass commands from Remus Koos
(This used to be commit 412e79c448)
2001-12-20 03:54:52 +00:00
Andrew Tridgell
15aad7f33d use "ads server" option if set for primary domain
(This used to be commit 1bf5c1a46f)
2001-12-19 13:33:08 +00:00
Andrew Tridgell
a04aec58d3 add support for mixtures of ADS/NT4 domains, as long as the primary
domain is ADS
(This used to be commit e97b40e094)
2001-12-19 12:38:52 +00:00
Andrew Tridgell
1f31ace6cb much better ADS error handling system
(This used to be commit 05a90a2884)
2001-12-19 12:21:12 +00:00
Andrew Tridgell
9126a40e2c added trusted realm support to ADS authentication
the method used for checking if a domain is a trusted domain is very
crude, we should really call a backend fn of some sort. For now I'm
using winbindd to do the dirty work.
(This used to be commit adf44a9bd0)
2001-12-19 09:53:30 +00:00
Andrew Tridgell
a062e58d9e - added initial support for trusted domains in winbindd_ads
- gss error code patch from a.bokovoy@sam-solutions.net
- better sid dumping in ads_dump
- fixed help in wbinfo
(This used to be commit ee1c3e1f04)
2001-12-19 08:44:23 +00:00
Andrew Tridgell
08bf73c326 fixed handling of empty or dead domain in wbinfo -g
(This used to be commit 2c54cfbc47)
2001-12-18 06:22:15 +00:00
Jeremy Allison
43e325d991 Added the group enum code from 2.2
Jeremy.
(This used to be commit 59e01a22c5)
2001-12-14 21:51:09 +00:00
Andrew Tridgell
3a1cd6f427 make sure we find NSS_STATUS struct
(This used to be commit 7db718d44a)
2001-12-13 11:58:38 +00:00
Herb Lewis
ed7caa2ecf allow IRIX to build nsswitch/libnss_wins.so
(This used to be commit 564bfd7728)
2001-12-12 16:08:32 +00:00
Herb Lewis
e4553718bb add *.po32 to ignore list
(This used to be commit fe0db4c55f)
2001-12-12 16:04:37 +00:00
Tim Potter
6526a42558 Oops, the -a option disappeared.
(This used to be commit 6194f874bb)
2001-12-11 23:27:45 +00:00
Herb Lewis
b9f2c47956 sync with 2.2
added multiple include protection
added IRIX defines
(This used to be commit b9dbb38bf2)
2001-12-11 20:20:30 +00:00
Jim McDonough
d9c3ef8450 Replace backslash with winbind separator before calling parse_domain_user(). Winbind separators other than backslash didn't work.
(This used to be commit 6688781331)
2001-12-11 19:27:40 +00:00
Herb Lewis
ee4d682115 fix for IRIX compilers
(This used to be commit b110f57e49)
2001-12-11 18:08:48 +00:00
Andrew Tridgell
d86b7f9dc3 handle systems without setenv()
(This used to be commit 8709065246)
2001-12-11 06:17:01 +00:00
Tim Potter
6cc5e2edc1 Modify winbindd to use authenticated user info from secrets.tdb when making
IPC$ connections to domain controllers.
(This used to be commit 1217ef28a6)
2001-12-11 05:19:15 +00:00
Tim Potter
f4dfa9b6b2 Converted wbinfo to use popt instead of getopt - popt is very nice!
Added a --set-auth-user function to set a username and password that can be
used by winbindd when making connections to domain controllers.  This is
necessary when restrictions have been placed on anonymous connections
either through the RestrictAnonymous registry setting, or the win2k Local
Security Policy -> Security Settings -> Local Policies -> Security Options
-> Additional restrictions for anonymous connections.  (phew)

Two new keys are set in secrets.tdb: SECRETS/AUTH_USER and
SECRETS/AUTH_PASSWORD which hold the username and plaintext password of the
user to connect as.

To reset these values, run wbinfo --set-auth-user ""
(This used to be commit 507003522b)
2001-12-11 05:18:36 +00:00
Andrew Tridgell
d033e53300 removed the start_ndx parameter from group enumeration
I tried testing this by lowering the buffer size in
cli_samr_enum_dom_groups() but that didn't work - I think this needs
more looking into
(This used to be commit 34328e3031)
2001-12-11 01:04:13 +00:00
Andrew Tridgell
abeb0f50ea got rid of start_ndx from query_user_list()
(This used to be commit 1c909afe76)
2001-12-11 00:03:58 +00:00
Andrew Tridgell
273deacb32 robustness fixes and moved ccache location into winbindd_ads code
(This used to be commit 24aa09ff3d)
2001-12-10 22:10:16 +00:00
Martin Pool
769a9dbb00 Make proto
(This used to be commit 83ab28a7e5)
2001-12-10 08:36:42 +00:00
Andrew Tridgell
6b36fa3a8a use objectCategory instead of objectClass for faster searching
(This used to be commit 4d3b827e5a)
2001-12-10 06:21:44 +00:00
Tim Potter
31f036b5b3 Merge of memory leak fixes from APPLIANCE_TNG.
(This used to be commit b198de92d2)
2001-12-10 06:21:18 +00:00
Andrew Tridgell
2bbc91978b winbindd backends can now be marked "consistent" or "inconsistent"
consistent backends (like ADS) always give correct primary group
info, so we can play cache tricks to speed things up a lot

inconsistent backends (like MSRPC) need to fetch stuff more often
(This used to be commit 217c39f232)
2001-12-10 06:05:21 +00:00
Andrew Tridgell
a23800be19 shrank the winbindd_cache.tdb somewhat
on my system it now uses 132k for 308 users
(This used to be commit 2b396f9172)
2001-12-10 05:20:55 +00:00
Andrew Tridgell
7f3373649a added some comments
(This used to be commit 34589d5a47)
2001-12-10 02:30:18 +00:00
Andrew Tridgell
f3918919d2 moved the domain sid lookup and enumeration of trusted domains into
the backends

at startup, loop until we get the domain sid for our primary domain,
trying every 10 seconds. This makes winbindd handle a room-wide power
failure better
(This used to be commit 7c60ae5937)
2001-12-10 02:25:19 +00:00
Andrew Tridgell
dd0b65a91c added some comments
(This used to be commit 5ab2c8b821)
2001-12-10 01:05:50 +00:00
Andrew Tridgell
e051c2c430 make sid_binstring available without HAVE_ADS
(This used to be commit 4a6d297686)
2001-12-10 00:39:01 +00:00
Andrew Tridgell
4ad81e7714 explicitly encode NULL strings in the cache
(This used to be commit 77c1376456)
2001-12-10 00:07:51 +00:00
Andrew Tridgell
cb1195fdef removed a debug line
(This used to be commit ec4c90fd7f)
2001-12-10 00:00:44 +00:00
Andrew Tridgell
31842f5d01 completely new winbindd cache infrastructure
this one looks like just another winbind backend, and has the
following properties:

- does -ve and +ve cacheing of all queries

- can be disabled with -n switch to winbindd

- stores all records packed, so even huge domains are not a problem
for a complete cache

- handles the server being down

- uses sequence numbers for all entries

This fixes a lot of problems with winbindd. Serving from cache is now
*very* fast.
(This used to be commit fddb4f4c04)
2001-12-09 23:59:42 +00:00
Andrew Tridgell
0b33cb1a7b - use accountype not accountcontrol
- better debug code
(This used to be commit 01f63b9c92)
2001-12-09 06:10:02 +00:00
Andrew Tridgell
b6c618467d fixed type passed to ads_search
(This used to be commit 0ff30848f3)
2001-12-09 00:46:37 +00:00
Andrew Tridgell
5d378a280f added internal sasl/gssapi code. This means we are no longer dependent on cyrus-sasl which makes the code much less fragile. Also added code to auto-determine the server name or realm
(This used to be commit 435fdf276a)
2001-12-08 11:18:56 +00:00
Tim Potter
839bcee0b4 Fixed typo in fix for typo in debug. (-:
(This used to be commit 7c64e5f148)
2001-12-06 04:23:06 +00:00
Andrew Tridgell
a87b9bf561 fixed a memory leak
(This used to be commit 45c328800e)
2001-12-05 10:43:43 +00:00
Andrew Tridgell
9421ad4a7a added a REALLY gross hack into kerberos_kinit_password so that
winbindd can do a kinit
this will be removed once we have code that gets a tgt
and puts it in a place where cyrus-sasl can see it
(This used to be commit 7d94f1b736)
2001-12-05 09:46:53 +00:00
Andrew Tridgell
addea9645d moved the sequence number fetch into the backend, and fetch the
sequence number via ldap when using ads
(This used to be commit 9a084f0bb9)
2001-12-05 07:52:44 +00:00
Andrew Tridgell
5329af6e11 don't double free ldap message lists
(This used to be commit f64612b89b)
2001-12-05 07:36:35 +00:00
Andrew Tridgell
cb01c8e192 fixed another leak - memory usage now seems to be quite small
(This used to be commit a45e396859)
2001-12-05 07:11:26 +00:00
Andrew Tridgell
a313351e94 added very basic ads connection cacheing
(This used to be commit 7de670cd15)
2001-12-05 07:05:53 +00:00
Andrew Tridgell
faa0f63774 plugged most of the memory leaks
(This used to be commit 60b5d4432a)
2001-12-05 06:16:33 +00:00
Andrew Tridgell
ca61334c76 added the last winbindd/ads backend function
winbindd is now fully functional with a native mode w2k server

now for the memory leaks and speed ...
(This used to be commit fad564c177)
2001-12-05 05:35:45 +00:00
Andrew Tridgell
3278f563b9 finally worked out how to do ldap lookups by binary blobs, so I can
now do searches on SID. This allows me to do a true ldap sid_to_name()
function

one one function to go!
(This used to be commit 7d44aa3915)
2001-12-05 04:48:51 +00:00
Jeremy Allison
f8abe6eba4 Fixed parse_domain_user to be bool.
Jeremy.
(This used to be commit 9563de2ef8)
2001-12-05 04:17:39 +00:00
Jeremy Allison
4d3ec230b4 Correct message on wbinfo fail to open config file.
Jeremy.
(This used to be commit 9b7182a9da)
2001-12-04 21:30:52 +00:00
Andrew Tridgell
7b64e61e68 added lookup_groups() to the ads backend
winbindd/ADS can now do initgroups()
(This used to be commit 43edeaca9f)
2001-12-04 12:10:05 +00:00
Andrew Tridgell
1d66a6beba moved lookup_usergroups() into the backend structure
(This used to be commit 689f45d207)
2001-12-04 06:46:53 +00:00
Andrew Tridgell
8e8ce079b8 added a query_user backend
fixed a winbindd crash when the group membership can't be looked up
(This used to be commit 088f4cc5be)
2001-12-04 06:17:39 +00:00
Andrew Tridgell
fc85a60962 changed query_dispinfo to query_user_list
(This used to be commit 80010d80f9)
2001-12-03 11:32:55 +00:00
Andrew Tridgell
6f907af4e7 put sid_to_name behind the winbindd backend interface
I spent quite a while trying to work out how to make this call
via ldap and failed. I then found that MS servers seem use rpc
for sid_to_name, and it works even when in native mode, I ended
up just implementing it via rpc
(This used to be commit 789833b44e)
2001-12-03 11:11:14 +00:00
Andrew Tridgell
c868fe502b added name_to_sid to the backend
(This used to be commit 816e40a51a)
2001-12-03 08:17:46 +00:00
Andrew Tridgell
2285b99cb1 added a basic ADS backend to winbind. More work needed, but at
least basic operations work
(This used to be commit 88241cab98)
2001-12-03 06:04:18 +00:00
Andrew Tridgell
37749cbb04 fixed the nsswitch initgroups code
added a nsstest test program that directly tests all the nss
interfaces using dlopen()
(This used to be commit aee19090d3)
2001-12-03 03:53:57 +00:00
Andrew Tridgell
78169af90a split winbindd_enum_dom_groups into the new backend structure
also created winbindd_rpc.c which contains the functions that
have been converted to the new structure. There will soon be
a winbindd_ads.c for the ldap backend
(This used to be commit e4ccc602ba)
2001-12-03 01:23:42 +00:00
Andrew Tridgell
de744cb970 The beginnings of alternative backends for winbindd
This just splits off the dispinfo call behind a methods structure.
I'll split off a few more functions soon, then we will be ready for
LDAP replacement methods
(This used to be commit 0216b0fca1)
2001-12-01 12:31:43 +00:00
Tim Potter
ff27a326f1 I think the lookup_pdc_name() should be called lookup_dc_name() and the
name_status_find() call here should look up a #1c name instead of #1d.
This fixes some bugs currently with BDC authentication in winbindd and in
smbd as you can't query the #1d name with the ip address of a BDC.

Who is Uncle Tom Cobbley anyway?
(This used to be commit 4215048f7b)
2001-11-29 05:50:32 +00:00
Tim Potter
7ca15c1485 Some reformatting.
M-x tabify
(This used to be commit 6446d2acd5)
2001-11-27 23:48:44 +00:00
Jeremy Allison
b89fccabdd Added negative caching to group lookups.
Jeremy.
(This used to be commit fceba7dea5)
2001-11-27 22:39:57 +00:00
Jeremy Allison
e2adbd4568 Added negative caching to the user pw lookup by name and by uid.
Jeremy.
(This used to be commit 4013ae87a1)
2001-11-27 20:57:14 +00:00
Jeremy Allison
064b3e7da7 nsswitch/winbindd_group.c nsswitch/winbindd_user.c: formatting fixups.
smbd/open.c: Fix "delete on close" for directories.
Jeremy.
(This used to be commit 014b0973a3)
2001-11-27 06:28:06 +00:00
Andrew Tridgell
3d9f2aa388 don't die with a FPE if there are no DCs
(This used to be commit b599947348)
2001-11-26 09:28:27 +00:00
Tim Potter
64dd6c3412 Another merge from appliance-head: in [ug]id_to_sid don't call the
winbind function if the id is obviously going to be local.  Cleanup
of winbind [ug]id parameter handling.
(This used to be commit 4ab9ca31a0)
2001-11-26 04:27:51 +00:00
Tim Potter
585d0efbc6 Got medieval on another pointless extern. Removed extern struct ipzero
and replaced with two functions:

	void zero_ip(struct in_adder *ip);
	BOOL is_zero_ip(struct in_addr ip);
(This used to be commit 778f5f77a6)
2001-11-26 03:11:44 +00:00
Tim Potter
19b9f9fbae Removed bogus SAFE_FREE() call of talloced return data from
winbindd_lookup_usergroups()
(This used to be commit dd2048c418)
2001-11-26 01:20:57 +00:00
Tim Potter
26ef1afa2e Fixed some indentation.
(This used to be commit 1dd462844a)
2001-11-26 00:58:43 +00:00
Andrew Bartlett
d0a2faf78d This is another rather major change to the samba authenticaion
subystem.

The particular aim is to modularized the interface - so that we
can have arbitrary password back-ends.

This code adds one such back-end, a 'winbind' module to authenticate
against the winbind_auth_crap functionality.  While fully-functional
this code is mainly useful as a demonstration, because we don't get
back the info3 as we would for direct ntdomain authentication.

This commit introduced the new 'auth methods' parameter, in the
spirit of the 'auth order' discussed on the lists.  It is renamed
because not all the methods may be consulted, even if previous
methods fail - they may not have a suitable challenge for example.

Also, we have a 'local' authentication method, for old-style
'unix if plaintext, sam if encrypted' authentication and a
'guest' module to handle guest logins in a single place.

While this current design is not ideal, I feel that it does
provide a better infrastructure than the current design, and can
be built upon.

The following parameters have changed:
 - use rhosts =

  This has been replaced by the 'rhosts' authentication method,
 and can be specified like 'auth methods = guest rhosts'

 - hosts equiv =

  This needs both this parameter and an 'auth methods' entry
  to be effective.  (auth methods = guest hostsequiv ....)

 - plaintext to smbpasswd =

  This is replaced by specifying 'sam' rather than 'local'
  in the auth methods.

The security = parameter is unchanged, and now provides defaults
for the 'auth methods' parameter.

The available auth methods are:

guest
rhosts
hostsequiv
sam (passdb direct hash access)
unix (PAM, crypt() etc)
local (the combination of the above, based on encryption)
smbserver (old security=server)
ntdomain (old security=domain)
winbind (use winbind to cache DC connections)


Assistance in testing, or the production of new and interesting
authentication modules is always appreciated.

Andrew Bartlett
(This used to be commit 8d31eae52a)
2001-11-24 12:12:38 +00:00
Jeremy Allison
d05bbf0422 Fixed delete on close bug. Added core dump code to winbindd.
Jeremy.
(This used to be commit a58d0f91f9)
2001-11-23 11:18:20 +00:00
Jeremy Allison
d2e279ecf2 Set type to NOTUSED if lookup fail.
Jeremy.
(This used to be commit 20a4167599)
2001-11-23 09:04:09 +00:00
Tim Potter
3400a3a3ed Got rid of that stupid parse_domain_user() warning when compiling
winbindd.
(This used to be commit 72060a6f5a)
2001-11-23 04:37:41 +00:00
Martin Pool
946374e8af Finish 1.45 by removing redundant sid->string conversion in
winbindd_lookup_sid_by_name.  Also if the lookup fails then clobber
the output parameters rather than leaving them looking potentially
valid.

Add doxygen.
(This used to be commit 61dba52a54)
2001-11-23 03:54:07 +00:00
Martin Pool
a833fbebcd I think you were passing the name of the SID, rather than the DOM_SID
pointer itself.  (Whatever that is.... ;-)
(This used to be commit 1393c7c4ed)
2001-11-23 03:33:22 +00:00
Tim Potter
79b34d1b11 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
(This used to be commit 8fc772c9e5)
2001-11-23 00:52:29 +00:00
Tim Potter
5788899a48 Fixed check machine account function.
(This used to be commit 8f01a8b078)
2001-11-23 00:14:04 +00:00
Jeremy Allison
1db30a338c Got positive and negative name caching working correctly with lookupname/lookupsid.
There was a bug in cli_lsa_lookup_name/lookup_sid where NT_STATUS_NONE_MAPPED was
being mapped to NT_STATUS_OK, and also the *wrong* number of entries mapped
was being returned. The correct field is mapped_count, *NOT* num_entries.
Jeremy.
(This used to be commit 9f8c644abc)
2001-11-22 08:31:50 +00:00
Jeremy Allison
609cdbfe37 Fixed +ve caching. Still problems with -ve caching.
Jeremy.
(This used to be commit 7883a2288a)
2001-11-22 07:48:57 +00:00
Jeremy Allison
a81e3902bc Fixed caching of lookupname/lookupsid. Error in check of success !
Jeremy.
(This used to be commit d039d4fa50)
2001-11-22 07:32:48 +00:00
Jeremy Allison
ee58402ac4 Added debugs to track down sequence lookup problems.
Jeremy.
(This used to be commit d3f5d5a4ac)
2001-11-22 07:24:07 +00:00
Jeremy Allison
f146325e7d W2K doesn't seem to respond to *#0 names in node status. Ensure name
lookup uses password server parameter when looking for PDCs.
Jeremy.
(This used to be commit 54c968913d)
2001-11-21 23:00:59 +00:00
Jeremy Allison
16ceec46d6 Added transparent +ve caching for lookupname/lookupsid. -ve caching can
be easily added (a one liner) once we know the correct error codes returned
by a W2K DC.
All other winbindd calls should go through a similar transparent caching layer
(and will soon).
Jeremy.
(This used to be commit b16bb21d37)
2001-11-21 09:59:15 +00:00
Jeremy Allison
efa52853f6 Preparing to implement +ve and -ve caching for lookupname/lookupsid calls.
Jeremy.
(This used to be commit 1f6cc536b2)
2001-11-21 08:36:43 +00:00
Tim Potter
15c6ab0f2d Merge from 2.2.
(This used to be commit ebd46aebf9)
2001-11-19 05:23:59 +00:00
Martin Pool
f741f65673 Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
(This used to be commit 79ec88f0da)
2001-11-19 02:49:53 +00:00
Jeremy Allison
8220662c13 Tidyup formatting a bit (spaces->tabs) whilst reading new code to understand
connection caching. Getting ready for back-merge to 2.2.3.
Jeremy.
(This used to be commit 5e8df83ba9)
2001-11-15 19:40:00 +00:00
Tim Potter
c32b4b6161 Caching user, group and domain sam handles was a stupid idea.
Now we just keep a record of the open pipes.
(This used to be commit 77c287e946)
2001-11-15 06:55:56 +00:00
Tim Potter
1539c2f34b Jeremy, I'm not sure what you were trying to do with the process activity
loop in winbindd but it didn't work.
(This used to be commit 3ac32af838)
2001-11-15 06:53:47 +00:00
Tim Potter
c5ceae9dc9 Added free_domain_info() function.
Get list of trusted domains if we haven't fetched them yet.
(This used to be commit ed16aa88a4)
2001-11-15 03:34:27 +00:00
Tim Potter
6121a6c9e4 Added free_domain_info() function.
(This used to be commit 1a9a361591)
2001-11-15 03:33:56 +00:00
Tim Potter
69a6bf3edd Cache positive and negative name domain controller lookups.
Cache negative connection attempt lookups.

Fixed loginc bug in connection_ok()
(This used to be commit e07bcfcccd)
2001-11-15 03:33:12 +00:00
Tim Potter
2fbd75210b Get list of trusted domains if we haven't fetched them yet.
(This used to be commit 1876632100)
2001-11-15 03:29:00 +00:00
Tim Potter
0d252203a7 Fixed display of uninitialised buffer in debug.
Get list of trusted domains if we haven't fetched them yet.
(This used to be commit a7ef2d20b1)
2001-11-15 03:28:24 +00:00
Tim Potter
17ce9c5281 Bit of a cleanup of signal handling code.
Ignore the SIGUSR1 signal before we install a handler for it as glibc (?)
seems to just print out "User defined signal 1" and exit if no handler
is installed.
(This used to be commit 1212591095)
2001-11-15 03:23:15 +00:00
Jeremy Allison
5302dc1218 Fix detection of RedHat 7.2.
Remove unused old file.
Test 42 byte reply to SMBntcreate (W2K does this).
Jeremy.
(This used to be commit a55a63a4ca)
2001-11-15 01:18:10 +00:00