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

49 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c868fe502b added name_to_sid to the backend
(This used to be commit 816e40a51a)
2001-12-03 08:17:46 +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
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
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
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
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
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
6f0b8a38ec Added some extra fields to the auth_serversupplied_info structure.
To obtain the full group membership of a user (i.e nested groups on a
win2k native mode server) it is necessary to merge this list of groups
with the groups returned by winbindd when creating an nt access token.

This breaks winbindd linking while AB and I sync up our changes to the
authentication subsystem.
(This used to be commit 4eeb7bcd78)
2001-10-31 06:20:58 +00:00
Tim Potter
e68daea2bd Fix for fussy Solaris compiler.
(This used to be commit d50005d4c1)
2001-10-21 07:01:01 +00:00
Tim Potter
e3e9c52b7a Fixed some memory leaks introduced by connection handling rewrite, as well
as one memory leak that has been there for ages!

Changed the way talloc is used in get{pw,gr}nam routines.
(This used to be commit d52cd1854f)
2001-10-19 08:22:52 +00:00
Tim Potter
52995a5f7d Converted some more functions to create and dispose of a talloc context on a
per-call basis rather than per-connection.

Had a bit more of a reformatting fest.

Still need to run it through insure and handle downed connections.
(This used to be commit 46fe5a8fb9)
2001-10-19 01:46:43 +00:00
Tim Potter
0536ceee2f Pass domain structure around in cache code rather than the domain name.
(This used to be commit c6338d7eae)
2001-10-14 08:30:30 +00:00
Tim Potter
1f48b3640f Got the rest of the group functions working. Did some reformatting (man
what was I thinking with those 4 character tabs?)

We now pass our winbindd test suite again!

Still to do:

 - talloc_ctx on a per winbindd request basis not per connection
 - clean up old crap we don't use any more
 - test against multiple BDCs (I know this isn't going to work - group/user
   handles have to be made against the same DC the domain and basic handles
   are.
 - implement network and dc failure recovery
(This used to be commit dc4ca0e0bd)
2001-10-10 23:08:13 +00:00
Tim Potter
f3f2744e9c Implemented sam group handle stuff. getent group now works.
(This used to be commit 63731d4a00)
2001-10-09 22:55:00 +00:00
Tim Potter
482a9ef278 This is the start of a bit of a rewrite of winbindd's connection handling.
I've wrapped up all the decisions about managing, making and closing
connections into a connection manager in nsswitch/winbindd_cm.c.

It's rather incomplete at the moment - only querying basic user info works
at the moment (i.e finger -m DOMAIN/user) and everything else is broken.

Jeremy, please take a look and I'll start moving across the rest of
winbindd to this new system.
(This used to be commit c369cf5af7)
2001-10-05 00:20:06 +00:00
Simo Sorce
a42efb4971 fix some possible memleaks and not tested reallocs spotted by Andreas Moroder
(This used to be commit d30939a091)
2001-10-03 21:10:29 +00:00
Simo Sorce
b50d10c2a3 move to SAFE_FREE()
(This used to be commit 03dc67788f)
2001-09-17 04:52:45 +00:00
Andrew Tridgell
7844aa868b more warning fixes on solaris
(This used to be commit c04c67fec8)
2001-09-05 08:11:17 +00:00
Andrew Tridgell
1f5203cd24 don't do pointer arithmetic on void* (some compilers can't do it)
(This used to be commit c65e8db7ae)
2001-09-04 20:34:02 +00:00
Andrew Tridgell
19fea3242c the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f7)
2001-09-04 07:13:01 +00:00
Gerald Carter
4f168fd114 merge from 2.2
(This used to be commit 3e8ccb4202)
2001-08-30 00:47:21 +00:00
Gerald Carter
dfe2d64676 merge from APPLIANCE_TNG
(This used to be commit aff66993e4)
2001-08-30 00:13:55 +00:00
Andrew Tridgell
b031af348c converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e33)
2001-08-27 19:46:22 +00:00
Jeremy Allison
ca66a07781 More Realloc fixes.
Jeremy.
(This used to be commit b4fa49fe13)
2001-08-18 19:57:48 +00:00
Simo Sorce
2e783a4707 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b4)
2001-08-12 17:30:01 +00:00
Tim Potter
3475c25714 Misc fixes to get winbindd working. We can now do a 'getent passwd'
and 'getent group' and have most things working.
(This used to be commit a7728bfa52)
2001-05-08 03:52:07 +00:00
Tim Potter
c504e240a8 OK so I couldn't be as clever as I wanted to be with winbindd_glue.c
so all the glue functions are prefixed with wb_ to avoid conflicts with
the old rpc_client stuff which is still a dependency of smbd/nmbd.
(This used to be commit 873e672b90)
2001-05-07 06:04:22 +00:00
Tim Potter
a36f9250e7 Preliminary merge of winbind into HEAD. Note that this compiles and links
but I haven't actually run it yet so it probably doesn't work.  (-:
(This used to be commit 59f95416b6)
2001-05-07 04:32:40 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Andrew Tridgell
7738941ccf use "winbind separator" in tng as well
(This used to be commit 0189af5442)
2000-05-12 06:27:34 +00:00
Andrew Tridgell
32cb0660d2 brought the winbindd code into head
this does not yet compile, but I'm working on that.
(This used to be commit 3fb862531a)
2000-05-09 11:43:00 +00:00