summaryrefslogtreecommitdiff
path: root/source3/winbindd
AgeCommit message (Collapse)AuthorFilesLines
2013-01-29s3:winbindd: change getpwsid() to return a passwd struct for a group sid ↵Michael Adam1-9/+43
id-mapped with ID_TYPE_BOTH Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jan 29 23:46:19 CET 2013 on sn-devel-104
2013-01-29s3:winbindd: check the correct variable for talloc success in rpc_query_user()Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29s3:winbindd:getgrnam: also produce a group struct for a user with ID_TYPE_BOTHMichael Adam1-2/+13
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29s3:winbindd: create group structs for gids that are coming from a user sid ↵Michael Adam1-0/+49
id-mapped with ID_TYPE_BOTH This "fake" group contains exctly one member, namely the user that the sid is actually belonging to. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29s3:winbindd: factor add_wbint_Principal_to_dict() out of wb_group_members_done()Michael Adam2-17/+47
for later reuse Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29s3:winbindd: fix a cut'n'paste comment typo in wb_fill_pwentMichael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29s3:winbindd: rename winbindd_getgrnam_lookupsid_done to ↵Michael Adam1-3/+3
winbindd_getgrnam_lookupname_done That's what it is. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-22s3-winbind: fix the build of idmap_ldap.Günther Deschner1-1/+2
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jan 22 14:43:40 CET 2013 on sn-devel-104
2013-01-18winbind: Handle child requests in a tevent_fdVolker Lendecke1-105/+65
This enables the use of standard tevent_loop_once in the child, which now also uses epoll where available. Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18winbind: Introduce "struct child_handler_state"Volker Lendecke1-22/+30
This will make the next patch simpler. child_handler_state contains the information that the handler for the parent fde needs to pass to process_child_request Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18winbind: Use standard tevent_context_initVolker Lendecke3-7/+34
This makes winbind use epoll instead of poll Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-11winbind: Fix some missing NULL checksVolker Lendecke1-24/+29
Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jan 11 18:55:41 CET 2013 on sn-devel-104
2013-01-11winbind: Fix error check in unpack_tdc_domainsVolker Lendecke1-2/+5
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-02s3-idmap: Check return value of string_to_sid().Andreas Schneider1-1/+6
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
2012-12-21s3-winbind: Fix null pointer dereference in store_memory_creds().Andreas Schneider1-4/+4
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21s3-winbind: Check if we created the directories correctly.Andreas Schneider1-4/+11
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12s3: Fix a typo in a debug messageVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Dec 12 16:40:23 CET 2012 on sn-devel-104
2012-12-12winbind: Use talloc in resolve_username_to_alias().Andreas Schneider1-3/+5
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12winbind: Use talloc in resolve_alias_to_username().Andreas Schneider1-3/+5
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-07winbind: Make the code more readable in trustdom_list_done().Andreas Schneider1-15/+19
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jim McDonough <jmcd@samba.org> Autobuild-User(master): Jim McDonough <jmcd@samba.org> Autobuild-Date(master): Fri Dec 7 22:38:43 CET 2012 on sn-devel-104
2012-12-03s3:winbindd: use the new sid_check_is_for_passdb() in ↵Michael Adam1-6/+2
idmap_find_domain_with_sid() This is more correct than the original one: It also hands the wellknown and "Unix Users" and "Unix Groups" sids to passdb for id mapping. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove unused function idmap_backends_sid_to_unixid()Michael Adam2-43/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:idmap_autorid: force mapping type to ID_TYPE_BOTH for sid->unixid mappingMichael Adam1-0/+3
This is to remove problems with the same unix-id being used both as a uid and a gid. The autorid backend will map a given number to the same SID, no matter whether this is a uid or a gid. This will prime the idmap cache with mappings. The sid-to-u/gid mapping, when not going through the cache, instead checks for the type of the sid and only allows unix ids of the corresponding type. Hence the rid backend will give different results, depending on whether the cache is filled or not. This patch lets the autorid backend always create sid->id mappings of type both. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:idmap_rid: force mapping type to ID_TYPE_BOTH for sid->unixid mappingMichael Adam1-0/+2
This is to remove problems with the same unix-id being used both as a uid and a gid. The rid backend will map a given number to the same SID, no matter whether this is a uid or a gid. This will prime the idmap cache with mappings. The sid-to-u/gid mapping, when not going through the cache, instead checks for the type of the sid and only allows unix ids of the corresponding type. Hence the rid backend will give different results, depending on whether the cache is filled or not. This patch lets the rid backend always create sid->id mappings of type both. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove unused idmap_sid_to_gid()Michael Adam2-75/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove unused idmap_sid_to_uid()Michael Adam2-75/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove unused server implementation of wbint_Sid2Gid()Michael Adam1-14/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove unused server implementation of wbint_Sid2Uid()Michael Adam1-14/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: remove now unused wb_sid2uid and wb_sid2gid modulesMichael Adam3-342/+0
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: change winbindd_getgroups to use wb_sids2xids instead of wb_sid2gidMichael Adam1-5/+14
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: change wb_getgrsid to use wb_sids2xids instead of wb_sid2gidMichael Adam1-2/+17
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: change wb_fill_pwent to use wb_sids2xids instead of wb_sid2[ug]idMichael Adam1-4/+32
We can optimize this later and just do one wb_sids2xids_send/recv call. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: make idmap_find_domain() static.Michael Adam2-2/+1
idmap_find_domain_with_sid() should be used instead Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: also use idmap_passdb for own sam and builtin in ↵Michael Adam1-3/+3
wbint_Sids2UnixIDs() This is the way the singular calls work and how they should (currently) work. The two code paths need to give the same results. It is important to use the passdb backend, otherwise groups don't work. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: add idmap_find_domain_with_sid()Michael Adam2-0/+18
This will return the passdb domain if the given sid is in our sam or builtin or is the domain sid of those domains. Otherwise it returns the idmap domain that results from the idmap configuration. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: rename idmap_init_passdb_domain() -> idmap_passdb_domain()Michael Adam1-3/+3
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: use struct unixid instead of uint64 in Sids2Xids parent<->childMichael Adam2-4/+7
This implicitly also hands the type of the resulting unix-id that the idmap backend has created back to the caller. This is important for backends that would set a broader type than the requested one, e.g. rid backend returning BOTH instead of UID or GID. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: add an explanatory comment to _wbint_Sids2UnixIDs()Michael Adam1-0/+3
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: add an explanatory comment to _wbint_Sids2UnixIDs()Michael Adam1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: use wb_sids2xids instead of wb_sid2gid in winbindd_sid_to_gidMichael Adam1-2/+16
The main purpose of the change is to hand the sid into the idmap backend and handle responsiblity for handling the sid-type correctly to the idmap backend instead of failing directly when the sid is not of group type. Hence backends like rid who are sid-type agnostic, can return gids also for sids of other types. This is an important fix to make sid_to_gid behave the consistently with and without the presence of cache entries. We need to additionally filter the result for id type GID or more general (BOTH) to keep the behaviour. This is a step towards using only one codepath to id_mapping. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: use wb_sids2xids instead of wb_sid2uid in winbindd_sid_to_uidMichael Adam1-2/+16
The main purpose of the change is to hand the sid into the idmap backend and handle responsiblity for handling the sid-type correctly to the idmap backend instead of failing directly when the sid is not of type user. Hence backends like rid who are sid-type agnostic, can return uids also for sids of other types. This is an important fix to make sid_to_uid behave the consistently with and without the presence of cache entries. We need to additionally filter the result for id type UID or more general (BOTH) to keep the behaviour. This is a step towards using only one codepath to id_mapping. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: factor winbindd_sids_to_xids into external and internal partMichael Adam3-165/+284
- external part takes winbindd request/reponse structs (with sid strings) - internal part takes sid lists The new internal part implements functions wb_sids2xids_* that are moved into the new module wb_sids2xids.c. The purpose of this change is to use wb_sids2xids in winbindd_sid_to_uid and winbindd_sid_to_gid instead of the currently used wb_sid2uid and wb_sid2gid. We should just have one code path into id mapping and not several that behave differently. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: convert some spaces to tabs in winbindd_sids_to_xids_send()Michael Adam1-4/+4
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: add explaining comment winbindd_sids_to_xids_send()Michael Adam1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: factor lsa_SidType_to_id_type() out of ↵Michael Adam1-14/+25
winbindd_sids_to_xids_lookupsids_done() for readability Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd: simplify winbindd_sids_to_xids_recv() a bit.Michael Adam1-40/+25
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03s3:winbindd:util: add a comment explaining the function parse_sidlist()Michael Adam1-0/+9
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-11-30s3-winbind: use new reconnect logic in rpc_lookup_sids() also.Günther Deschner1-16/+7
Volker, please check. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30s3-winbindd: rework reconnect logic in winbindd_lookup_names().Günther Deschner1-12/+13
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30s3-winbindd: rework reconnect logic in winbindd_lookup_sids().Günther Deschner1-12/+14
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>