summaryrefslogtreecommitdiff
path: root/server/responder/nss
AgeCommit message (Collapse)AuthorFilesLines
2009-08-31Turn enumeration into a boolean valueSimo Sorce2-8/+4
2009-08-27Fix group replies when using member/memberofSimo Sorce1-191/+139
Also remove legacy memberuid support
2009-08-21fix handling of filtersUsers in groupsSumit Bose3-31/+44
- with the boolean option filterUsersInGroups it can be controlled wether filtered users appear in groups or not. - fixed an error which prevented the display of groups with filtered members - removed some tab indents
2009-08-17Fix reconnection codeSimo Sorce1-16/+24
Remove redundant reconnection code that was interfeering with the sbus reconnection code. Consolidate include files for sbus relates operations. Make pamsrv code similar to nsssrv code.
2009-08-14Refactor responder_dp.cStephen Gallagher1-20/+20
Many of the functions in responder_dp.c were originally NSS- specific and were moved there from the NSS responder code. Since they are now generic to any responder, rename them to sss_dp_*
2009-08-11Change the why DP clients identifySimo Sorce3-85/+15
Mirrors what we have done with the monitor.
2009-08-11Change services identification mechanismSimo Sorce1-74/+5
Let services identify themselves voiluntarily as the first operation instead of polling from the monitor. Also consolidate some common functions and make them available as monitor helpers.
2009-08-11Make child processes exit when parent diesJakub Hrozek1-0/+6
The child processes call prctl() and when their parent process is killed, they are sent SIGTERM using prctl. This is currently Linux-specific, for non-Linuxes, a similar effect is achieved by catching a set of common termination signals and sending SIGTERM to the process group.
2009-08-11Make socket paths a compile-time optionStephen Gallagher1-1/+0
Previously, we had hardcoded the paths for the NSS, PAM and private PAM sockets to /var/lib/sss/pipes. With this patch, we will specify the sockets with --with-pipe-path.
2009-08-10Simplify interfaces initializationSimo Sorce3-23/+30
Make as much as possible static, and remove use of talloc_reference and allocation/deallocation of memory when not necessary. Fix also responder use of rctx->conn, was mistakenly used for both monitor and dp connections.
2009-08-10Cosmetic changesSimo Sorce2-17/+17
Rationalize and rename connection names in preparatoin for merging of server and connection structures.
2009-08-10Remove redundant memory contextsSimo Sorce1-3/+3
Simplify code by removing stuff that is never used or redundant.
2009-07-20Implement resInit for monitor, NSS, PAM, DP and the backendsStephen Gallagher1-0/+20
2009-05-28Fix user enumeration bugSimo Sorce1-4/+0
The previous patch to fix an enumeration bug found with group enumeration inadvertently introduced a bug with user enumeration. Yeah, almost funny!
2009-05-27Fix enumerations (bug #42)Simo Sorce1-12/+76
If a backend had all its results filtered in fill_pwent or fill_grent then we would return an empty result, which means "end of results" to the client. Now we return ENOENT and let callers decide what to do. Also make sure we do not grow packets unless we are going to fill them as that's a recipe for killing the client as the size passed to sss_packet_grow is used to determine the size of the final packet.
2009-05-26Silence warningsSimo Sorce2-4/+8
2009-05-26Do not fire up backend search when the data provider is localJakub Hrozek1-14/+14
2009-05-15added more flexible handling of client protocolSumit Bose1-0/+10
- allow different protocol versions for PAM and NSS - support more than one protocol version in the responder
2009-05-06Fix some more return paths using uninitalized retSimo Sorce1-3/+3
2009-04-29Fix use of uninitialized return variableSimo Sorce1-5/+5
2009-04-17Force user check and discover user's domainSimo Sorce2-278/+0
Force a user lookup against the users domain provider. If a user domain is not specified search though all non fully qualifying domains. Perform authentication against the corrent domain auth backend, based on the user's domain found in the lookup if one was not specified. Also move the NSS-DP functions in COMMON-DP as they are reused by the PAM responder too now.
2009-04-16Fix by_id enumeration with multiple domainsSimo Sorce1-0/+10
We need to stop parsing domains as soon as a caaandidate is found and let the callback search additional domains if the id is not found. Should fix ticket #21
2009-04-14Add common function to retrieve comma sep. listsSimo Sorce1-11/+13
Also convert all places where we were using custom code to parse config arguments. And fix a copy&paste error in nss_get_config
2009-04-14Make reconnection to the Data Provider a global settingStephen Gallagher1-5/+2
Previously, every DP client was allowed to set its own "retries" option. This option was ambiguous, and useless. All DP clients will now use a global option set in the services config called "reconnection_retries"
2009-04-14Add reconnection code between the NSS responder and the Data providerStephen Gallagher1-1/+52
2009-04-13Fix a couple of segfaults and timeout checksSimo Sorce1-30/+13
2009-04-13Fix segfaults when passing an unknown domainSimo Sorce1-9/+20
Also setting dctx->domain to NULL is a recipe for segfaults :-) Assign dctx->domain only when dom actually holds a domain pointer.
2009-04-09Serialize requests vs backends.Simo Sorce1-544/+702
This way we do not waste resources starting searching for users/groups in multiple backends when the first one has the answer. Also prevents possible race conditions where a user named the same way is found in multiple backends and the wrong one is returned.
2009-04-08Change the way we retrieve domainsSimo Sorce2-177/+87
To be able to correctly filter out duplicate names when multiple non-fully qualified domains are in use we need to be able to specify the domains order. This is now accomplished by the configuration paramets 'domains' in the config/domains entry. 'domains' is a comma separated list of domain names. This paramter allows also to have disbaled domains in the configuration without requiring to completely delete them. The domains list is now kept in a linked list of sss_domain_info objects. The first domain is also the "default" domain.
2009-04-07Clean up warnings in SSSDStephen Gallagher1-8/+8
2009-04-07Unify name parsing and reposnder headersSimo Sorce3-149/+146
Use common sss_parse_name function in all responders Simplify responder headers by combining common,cmd,dp in one header and add name parse structure as part of the common responder context.
2009-04-01Add way to use files as a proxy backend fro LOCALSimo Sorce1-28/+91
Makes LOCAL a normal backend removing some special handling. Fix/Add id range filtering and name filtering Filters uid=0 and gid=0 in the proxy backend as 0 is invalid within sysdb and was causing getxxent calls to fail completely. Fix nss_ncache_check_xxx calls to avoid dirtying the 'ret' variable and causing some unwanted failures. Change sysdb to always return the uid number when searching member entries so that id range filtering can be perfomed also in group searhes (does not work with legacy backends)
2009-04-01Add a more flexible way to parse and filter names.Simo Sorce5-280/+885
A new nss_parse_name function uses pcre to parse names, this makes it possible, in future, to make the filter user configurable. Add a new filter mechanism to filter out users that uses the negative cache by setting a permanet negative entry. Rework the entry points where the negative cache is checked for.
2009-03-27Fix potential segfault if dp_ctx is still NULL.Simo Sorce1-0/+9
May happen at startup if, for some reason dp is very slow to start and we receive a request before a reconnection is rescheduled in the responder dp reconnection code. This shouldn't happen normally so make it clear with a debug statement.
2009-03-27Make nsssrv use the common responder functionsSimo Sorce4-687/+200
Make nss_ctx a private pointer of the common resp_ctx Use sss_process_init and remove all duplicate functions from nsssrv.c
2009-03-27Fix uninitailized pointer and cut&paste errorSimo Sorce1-1/+5
The structure we copy the domain pointerr on is not zero when allocated. We need to zero it ourselves or we get segfaults later on. A cut&paste error caused us to call the wrong getpw function.
2009-03-24Fix buildSimo Sorce2-1/+4
forgot to commit a few changes
2009-03-20Retrieve some options from confdbSimo Sorce3-11/+46
This fixes some old 'Fixme's :)
2009-03-20Enhance server_setupSimo Sorce2-1/+3
Now it can load from scratch default configuration that is valid for all daemons. First thing, make it possible for each daemon/provider to set its own debug level in its configuration entry.
2009-03-18Fix getgrent and getpwent callsSimo Sorce1-2/+6
When I converted from using just the domain name to passing down the info structure I goofed how to test if we were willing to attach the local domain to the user/group names or not.
2009-03-13Implement Negative cache for NSSSimo Sorce5-3/+570
As for positive caches, negative caches are implement for all queries except enumerations. Also set the correct requires in sssd.spec as we now depend directly on tdb as well.
2009-03-10Fix returning user with missing optional attributes.Simo Sorce1-5/+8
Gecos, homedir and shell are optional, fix the responder not to refuse to return the user completely if they are missing, replace an empty homedir with "/". Also fix fullname vs gecos, and always return gecos for NSS data. On user creation set gecos to the same value as the user Full Name, to help populate the gecos field with data that makes sense.
2009-03-10Treat uids and gids as 32 bit numbers not 64Simo Sorce1-23/+21
In the nss communication protocol we were treating uids and gids as 64 bit values, but uids and gids are really u32 values, change the protocol to reflect the real size.
2009-03-09Always pass sss_domain_info to sysdb functions.Simo Sorce1-27/+15
2009-03-09use fixed paths to sockets to make sure clients and server are using the sameSumit Bose2-1/+6
2009-03-06Fix reporting non-default users.Simo Sorce2-301/+314
We need to add the domain when users are not part of the default domain, otherwise name conflicts may happen.
2009-03-05Remove _PW_ and _GR_ from SYSDB_ definesSimo Sorce1-10/+10
Also unify SYSDB_PW_NAME and SYSDB_GR_NAME in SYSDB_NAME and make it "name"
2009-03-05Implement GetCachedUsers in the InfoPipeStephen Gallagher1-2/+2
This function allows a caller to retrieve a list of users who have logged in on the system, specifying an optional minimum last login time to trim the list. I modified sysdb_enumpwent to accept an optional search argument. GetCachedUsers takes advantage of this argument to limit the search by the last login time. I also found and fixed a few additional low-memory conditions around D-BUS message replies.
2009-03-04Add enumeration backout period.Simo Sorce3-2/+39
If an enumeration has been requested recently enough, force the nss responder to read from the cache and not go out to each backend and do slow network operations. This greatly improves performances if enumerations are used often. Currently the balcout period is harcoded to 2 min, we will need to make it a configurable option.
2009-02-28Fix confdb issues.Simo Sorce1-5/+5
Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead.