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

58 Commits

Author SHA1 Message Date
Günther Deschner
3c6481d75c s3-winbindd: use fill_domain_username_talloc() in winbind.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-05-17 17:30:08 +02:00
Ralph Boehme
1ce165a733 winbindd: let normalize_name_map() call find_domain_from_name_noinit()
Let normalize_name_map fetch the domain itself with
find_domain_from_name_noinit().

This removes two calls to find_domain_from_name_noinit() in the default
configuration of "winbind normalize names = no". The domain is only need
in normalize_name_map if "winbind normalize names" is enabled.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-11-29 16:59:15 +01:00
Volker Lendecke
762fba44d7 winbind: Remove the use of "talloc_dict"
As members we only collect names, indexed by sids. This is served
well by just a simple dbwrap_rbt.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-09-30 08:01:24 +02:00
Andreas Schneider
3390d9902a s3-winbind: DON'T PANIC if we couldn't find the domain.
If we don't have a connection to a trusted domain but still try to do a
lookup we shouldn't segfault.

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep  4 18:16:06 CEST 2012 on sn-devel-104
2012-09-04 18:16:06 +02:00
Christian Ambach
fac75f04a8 s3:winbindd fix a return code check
talloc_traverse_dict will return with -1 in case of an error and
might return positive values that indicate the count of found
entries

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Aug 24 18:09:11 CEST 2011 on sn-devel-104
2011-08-24 18:09:11 +02:00
Jeremy Allison
017e0c8d95 Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1. 2011-05-04 12:12:13 -07:00
Volker Lendecke
d534a5be49 s3: Remove unused get_sam_group_entries 2009-12-21 16:27:19 +01:00
Volker Lendecke
0a130daf74 s3: Remove unused winbindd_dual_getsidaliases 2009-12-21 16:27:19 +01:00
Volker Lendecke
66bcae6064 s3: Remove an unused struct definition 2009-12-21 16:27:19 +01:00
Volker Lendecke
9568c762ac s3: Remove unused winbindd_dual_getuserdomgroups 2009-12-21 16:27:19 +01:00
Volker Lendecke
2774a02f64 s3:winbind: Convert WINBINDD_LIST_GROUPS to the new API 2009-08-29 19:53:46 +02:00
Volker Lendecke
e47491e83c s3:winbind: Convert the getgrent functions to the new API 2009-08-29 19:42:27 +02:00
Volker Lendecke
99cf696150 s3:winbind: Fix a bug found by RPC-SAMR
We need to enumerate passdb alias members

Thanks to gd for bugging me :-)
2009-08-29 10:44:13 +02:00
Volker Lendecke
ffd9d41be9 s3:winbind: Rename wbint_GroupMember to wbint_Principal 2009-08-29 10:44:12 +02:00
Volker Lendecke
1d8d3fd7c3 s3:winbind: Convert WINBINDD_GETUSERSIDS to the new API 2009-08-27 15:04:09 +02:00
Volker Lendecke
459233e630 s3:winbind: Convert WINBINDD_GETGRNAM to the new API 2009-08-16 12:39:08 +02:00
Volker Lendecke
a511a87519 s3:winbind: Convert WINBINDD_GETGRGID to the new API 2009-08-16 12:39:07 +02:00
Volker Lendecke
3f3f49d5e2 s3:winbind: Add winbindd_print_groupmem
This converts a talloc_dict retrieved from wb_group_members to the string
that the pipe protocol expects
2009-08-16 12:39:02 +02:00
Volker Lendecke
27dd290d3f s3:winbind: Make fill_grent publically available 2009-08-16 12:38:19 +02:00
Volker Lendecke
0a16265bc2 s3:winbind: Convert WINBINDD_GETGROUPS to the new API 2009-08-05 03:21:25 -04:00
Volker Lendecke
fec380818f s3:winbind: Convert WINBINDD_GETUSERDOMGROUPS to the new API 2009-08-05 03:21:25 -04:00
Volker Lendecke
592822786d s3:winbind: Convert WINBINDD_GETSIDALIASES to the new API 2009-08-05 03:21:24 -04:00
Volker Lendecke
97ba4f6efd Make winbindd_cli_state->response a pointer instead of a struct member
Same comment as in baa6084378: This is just a preparatory checkin.

Volker
2009-06-14 22:22:10 +02:00
Volker Lendecke
baa6084378 Make winbindd_cli_state->request a pointer instead of a struct member
In itself, this is pretty pointless. But in the next steps I'll convert the
winbind internal communication to wb_reqtrans which allocates the request
properly. This minimizes the later diff.

Volker
2009-06-14 11:25:44 +02:00
Volker Lendecke
a51e6ce43c Pass a talloc_ctx to pdb_enum_aliasmem 2009-06-08 21:14:10 +02:00
Günther Deschner
bc091e7847 s3-winbindd: workaround alias enumeration in expand_groups().
alias enumeration in NSS is not done properly done atm and needs to be fixed.

Guenther
2009-06-08 13:06:25 +02:00
Günther Deschner
f19c9147a5 s3-winbindd: add some debug statements while tracking down a bug.
Guenther
2009-06-06 02:00:36 +02:00
Volker Lendecke
3fa69438b9 Convert response.extra_data.data from malloc to talloc 2009-05-12 18:02:00 +02:00
Volker Lendecke
b17f9e15ef Make opt_nocache static to winbindd.c 2009-03-12 10:20:08 +01:00
Dan Sledz
3b8a57e064 s3: Implement wbcGetSidAliases
* Adds wbcGetSidAliases that calls the lookup_useraliases function.
* Updates wbinfo and winbind_util.c to call the new function.
* Also added winbind_get_groups helper function.
2009-02-11 19:39:18 -08:00
Tim Prouty
10e9e95ce8 s3 build: Fix "assignment discards qualifiers from pointer target type" warnings 2009-02-02 00:03:09 -08:00
Michael Adam
d75b3913c9 s3:winbind_group: fix "getent group" to allocate new gids.
"getent group" used to fill the idmap cache with negative
cache entries for unmapped group sids.

Don't pass domain name unconditionally to idmap_sid_to_gid().
idmap_sid_to_gid() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".

Note that it is _wrong_ to directly call the idmap_sid_to_gid()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_gid request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.

Michael
2009-02-02 00:53:05 +01:00
todd stecher
989ad44d32 Memory leaks and other fixes found by Coverity 2009-01-21 17:13:03 -08:00
Michael Adam
0f38bd9072 s3:winbindd: fix horrible mis-indentation of toplvl braces in getgrsid_sid2gid_recv
to make code more readble

Michael
2008-12-04 14:00:44 +01:00
Michael Adam
db59cbfba8 s3:winbindd: don't open a new dc connection in winbindd_getgrnam (main winbindd)
This is just to find the corresponding domain struct.
Actual connection is handled by the domain child.

Michael
2008-12-04 13:39:05 +01:00
Steven Danneman
9a7900fb38 Whitespace and >80 column cleanups. 2008-11-18 13:02:20 -08:00
Michael Adam
17218df567 [s3]winbindd: speed up fill_grent_mem (i.e. winbindd_getgrent) a lot.
With large groups, getgrent ran into timeouts because after each
single user that was added to the expanded group list, the list
was sorted and made unique.

Now the list is sorted just once after all members have been added.

Michael
2008-11-02 22:29:17 +01:00
Michael Adam
4432967532 [s3]winbindd_group: don't list the domain twice when expanding internal aliases
Before this, "getent group builtin\\administrators" expanded
domain group members in the form DOMAIN\domain\user.

Michael
2008-09-23 10:00:26 +02:00
Michael Adam
4205fab500 [s3]winbindd_group: sanely handle NULL domain in add_member().
Michael
2008-09-23 10:00:26 +02:00
Gerald (Jerry) Carter
544cd1b4b9 winbindd: Update the calls to ws_name_XX() to reflect API changes.
* Ensures that all points an which a name is received or returned
  to/from a client passes through the name aliases layer (users
  and groups).
2008-09-16 10:27:59 -07:00
Simo Sorce
f25863e04c Fix for bug 5571
Make sure that usernames are parsed using the correct separator.
Otherwise group memeberships in winbind may be result broken.
(This used to be commit 20b9c0aa7b)
2008-09-11 09:51:39 -04:00
Volker Lendecke
340ab6a256 idmap rewrite
(This used to be commit 30a180f2fc)
2008-08-12 11:28:29 +02:00
Simo Sorce
4be7a83a2c Clean up winbindd_group.c too
(This used to be commit 50a347f550)
2008-07-06 12:55:07 -04:00
Jeremy Allison
4aaa3a0fac Fix from Atte Peltomki - atte.peltomaki@f-secure.com to correctly check
error code in winbindd group expansion.
Jeremy.
(This used to be commit e321377174)
2008-06-30 09:20:05 -07:00
Jeremy Allison
120c09b125 From Steve Danneman @ Isilon.
Attached is the companion patch to
(037b9689d9), which
made handling of WINBINDD_LIST_GROUPS asynchronous.

Because most all of the list_groups code was reusable, I abstracted it,
and implemented both list_groups and list_users on top of it.

On my large test domain a "wbinfo -u" call went from 70 seconds to 30
seconds with this patch.  Plus, the parent process is no longer blocked
from receiving new requests during that time.

Steven Danneman | Software Development Engineer
Isilon Systems    P +1-206-315-7500     F +1-206-315-7501
www.isilon.com
(This used to be commit 5188f28611)
2008-06-26 14:02:39 -07:00
Volker Lendecke
1a1fc2f814 Fix two c++ warnings
(This used to be commit 3b1dae7c31)
2008-05-25 13:53:45 +02:00
Steven Danneman
96653e1ff7 Make WINBINDD_LIST_GROUPS handler asynchronous.
Previously WINBINDD_LIST_GROUPS requests (ex: wbinfo -g) were handled by the
winbindd parent process in a sequential fashion.  This patch, delegates the work
to the winbindd children so that the request is handled much faster in large
domain topologies, and doesn't block the parent from receiving new requests.

The core group enumeration and conversion that was handled in
winbindd_list_groups() has been moved into winbindd_dual_list_groups() to be
done by the child.

The parent winbindd_list_groups() simply calls each of the children
asynchronously.

listgroups_recv() aggregates the final group list that will be returned to the
client and tracks how many of the children have returned their lists.

The domain name of the child is passed back through the callbacks to be used in
debugging messages.

There are also several fixes to typos in various comments.
(This used to be commit 037b9689d9)
2008-05-22 13:55:57 -05:00
Volker Lendecke
9ffcc7966f Fix wbinfo --group-info if the winbind separator set to non \
In getgrsid_lookupsid_recv() we use parse_domain_user which itself looks at
lp_winbind_separator(). Thus when building up that group name we should better
use it as well.
(This used to be commit 5df75578ef)
2008-04-22 15:42:09 +02:00
Michael Adam
bc5f19cb28 winbindd: fix break out early condition in fill_grent_mem().
if (!&new_glist) would always be skipped, if (new_glist == NULL) is
what must have been meant...

Michael
(This used to be commit c1b60cdecf)
2008-04-07 16:38:14 +02:00
Günther Deschner
4ce88f719e Don't let winbind getgroups crash when we have no gids in the token.
Guenther
(This used to be commit 6a576cfe9b)
2008-03-29 00:47:42 +01:00