summaryrefslogtreecommitdiff
path: root/server/db
AgeCommit message (Collapse)AuthorFilesLines
2009-03-18Fix segfault error caused by a double freeSimo Sorce1-178/+118
In delete_callback we were freeing rep after having called return_done() This caused a double free becuse rep is already freed as child of the request when return_done calles the callback. To avoid future errors like this convert return_error and return_done into functions and make them always be the last call of the function and call them as part of the function return.
2009-03-10Fix returning user with missing optional attributes.Simo Sorce2-9/+15
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-10If a domain is MPG enabled return users a groupsSimo Sorce2-15/+73
Turn user entries to Magic Private Groups when groups are quesried.
2009-03-10Fix bugs in functions dealing with groupsSimo Sorce1-0/+6
Fix infinite loop within initgr functions. Fix min length check copy&paste error, was filtering valid groups if the name was short enough and the group had no members.
2009-03-09Always pass sss_domain_info to sysdb functions.Simo Sorce2-57/+35
2009-03-09Move MPG checks within sysdb.Simo Sorce2-22/+199
This allows to perform checks and modifications in one transaction. Uses configuration stored in confdb to determins if a domain uses MPGs.
2009-03-09Do not duplicate attribute names macros.Simo Sorce1-21/+18
Also shorten names oh other user attributes.
2009-03-09Implement SetGroupGID in the InfoPipeStephen Gallagher2-0/+72
2009-03-06Implement CreateUser in InfoPipeStephen Gallagher2-2/+2
Changed the order of the arguments to CreateUser in the Introspection XML to match the other functions (domain belongs second on the list) A few other minor fixes as well: Fixed a typo in SYSDB_GETCACHED_FILTER and sysdb_transaction_end(). Added missing error handling in infp_do_user_set_uid().
2009-03-06Remove obsolete commentSimo Sorce1-3/+0
2009-03-06Add userspace tools to manipulate accounts.Simo Sorce1-0/+2
The first functional command is sss_useradd (Name is temporary, while looking for a better one)
2009-03-06Fix reporting non-default users.Simo Sorce1-0/+4
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 Sorce4-56/+52
Also unify SYSDB_PW_NAME and SYSDB_GR_NAME in SYSDB_NAME and make it "name"
2009-03-05Implement GetCachedUsers in the InfoPipeStephen Gallagher2-1/+9
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-05Add functions to add regular users and groupsSimo Sorce2-15/+299
Calulates next id automatically if uid/gid are not specified. Fixes to sysdb_get_next_available_id. Add tests to create users and groups through the new functions.
2009-03-04Add internal min/max/next id management fucntionsSimo Sorce3-14/+290
Retrieve minID and maxID from domain configuration so that lower and upper bounds can be set per domain. Add function that keeps track of the next available id, increments and returns it on requests, avoiding collisions with existing ids.
2009-03-04Improve sysdbSimo Sorce4-33/+87
Add comments in header files to better explain interfaces and intended usage. Expose function to convert from ldb errors to errnos. Add sysdb_attrs helper to add a long integer as a value.
2009-03-03Provide sysdb_set_user_attr() functions.Simo Sorce4-3/+155
Provide also helper functions to build struct sysdb_attrs. Also fix sysdb_get_user_attr() to have a consistent interface as all other functions.
2009-03-02Unify pwd_search and user_searchSimo Sorce1-35/+11
2009-03-02Implement GetUserAttributes in the InfoPipeStephen Gallagher2-0/+92
This patch adds support for requesting user data in the sysdb via the InfoPipe. It currently has support for reading defined entries of integral, floating-point or string types. Tasks remaining: 1) Implement call to the provider when cache is out of date 2) Support byte arrays for userpic and similar I modified sysdb_search_ctx in sysdb_search.c to accept an array of attributes to pass into the LDB search. I also made one additional related fix: the btreemap now sorts in the correct order. Previously I had accidentally transposed the two values for sorting, so the map would always have been in exact reverse order.
2009-03-02first version of LOCAL pam backendSumit Bose1-0/+1
2009-02-28Expose some more functions needed by the testsSimo Sorce3-1/+114
2009-02-28Convert sync calls in sysdb to async, transaction dependent, calls.Simo Sorce7-962/+1041
2009-02-26Serialize access to sysdb and also exposes ldb transactions.Simo Sorce6-750/+1008
This is necessary because in ldb only 1 transaction per context is possible and all operations (or new transactions) are nested within it. Will revisit this later when ldb will addresses the problem.
2009-02-26Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce2-16/+16
dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
2009-02-20Reorganize sysdb a bit,Simo Sorce4-966/+1087
rename _posix_ function into _legacy_ Add support for the posix legacy mode where memberships are stored in memberUId and not in member/memberof pairs. Do not build sysdb as a library
2009-02-20Completely rework the nss interface to be able to use 2Simo Sorce1-2/+2
types of domains: modern and legacy modern uses member/meberof, legacy uses memberUid for group memberships. Rework the proxy backend to use the legacy style as that's the format the data comes in (trying to convert would require too many transformations and increased the number of queries). Add support for fetching groups in nss. Add support for enumerating users and groups (requires to enable enumeration in config) both in nss and in the proxy provider. Remove confdb_get_domain_basedn() and substitute with generic calls in the nss init function. Store a domain structure in the btree not the basedn so that we can add enumeration flags. Also make sure NSS understand how to make multiple calls on enumerations, also make passing the domian parameter always mandatory, passing in domain=* is not valid anymore. This work fixes also a few memory, degfault, and logic bugs found while testing all nss functions (there are still some to fix that are less critical and much harder to find yet).
2009-02-17Fix another transaction mis-handlingSimo Sorce1-22/+20
2009-02-16ldb_msg_* functions do not reliably set errno on error, do not realy on that.Simo Sorce1-34/+34
This was causing some functions to not cancel a transaction as they should have, leaving it pending indefintely. It in turn meant that no other process could see what was "stored" in the db as transactions are not fluched to the db until "committed". Took me quite a while and a lot of confusion to catch why I was seeing "ghost entries" in some processes and not seeing the entry in others .. As a defensive programming measure make sure we commit OR cancel in the same spot and that we always go thorugh it.
2009-02-13Object not found on delete is not really an error.Simo Sorce1-10/+10
2009-02-13Always pass teh database path explicitly, so that test cases can useSimo Sorce3-29/+192
throw away databases Check version and init main db if empty
2009-02-13Fix add member, remove one to many lines in the previous tidyupSimo Sorce1-0/+6
2009-02-12- make all functions supposed to get input in posix formatSimo Sorce2-215/+217
use the same namespace (sysdb_posix_) - no need to explicitly start a transaction if only one operation is performed using a synchronous interface - split _add_remove_ functions into separate functions, don't let ldap madness creep into out interfaces
2009-02-12Added sysdb_remove_group_posix and sysdb_remove_group_posix_by_gidStephen Gallagher2-3/+140
Fixed a few small bugs in sysdb_[store|remove]_account_posix. The string "uid=" needed to be replaced with SYSDB_PW_NAME, and the search scope in sysdb_remove_account_posix_by_uid needed to be LDB_SCOPE_ONELEVEL, not LDB_SCOPE_BASE. Added associated unit tests. Modified the unit test structure so that it is called as a single suite, rather than a User and Group suite, since there is too much overlap.
2009-02-12Add support for removing members from groups. Updated convenience functions ↵Stephen Gallagher2-41/+87
for adding/removing user accounts and POSIX groups to the groups. Also modified the add/remove member functions to be a single interface taking a flag for add or removal, since the code only differs by one LDB flag. Added associated unit tests.
2009-02-12Add sysdb_add_group_to_posix_group, refactored sysdb_add_acct_to_posix_group ↵Stephen Gallagher2-75/+81
to now use sysdb_add_member_to_posix_group along with sysdb_add_member_to_posix_group. Added new unit tests to sysdb-tests.c for groups of groups.
2009-02-12Adding sysdb_add_acct_to_posix_group and associated unit testsStephen Gallagher2-6/+183
2009-02-12Adding sysdb_store_group_posix with unit testStephen Gallagher2-6/+177
2009-01-12Regroup database rleated functions under db andSimo Sorce2-0/+1273
rename everything with the sysdb suffix.