summaryrefslogtreecommitdiff
path: root/server/util
AgeCommit message (Collapse)AuthorFilesLines
2009-10-22User home directories managementJakub Hrozek2-0/+745
Create and populate user directories on useradd, delete them on userdel Fixes: #212
2009-10-22Delete sssd-i18n.h and put it's old contents into util.hMartin Nagy3-33/+9
Also include talloc.h, tevent.h and ldb.h as system headers in util.h.
2009-10-22Use correct talloc context in sss_names_init()Martin Nagy1-2/+2
2009-10-15enable debugging of krb5_childSumit Bose2-4/+38
2009-10-13add a replacement if ldap_control_create is missingSumit Bose2-0/+100
2009-10-06Remove unused btreemap codeStephen Gallagher2-257/+0
We have converted to using dhash in place of btreemap everywhere in the code.
2009-10-05add utility call check_and_open_readonlySumit Bose2-0/+93
Use this new utility call to ensure that the config file is safe to read from.
2009-09-25Send debug messages to logfileJakub Hrozek3-2/+66
Introduces a new option --debug-to-files which makes SSSD output its debug information to a file instead of stderr, which is still the default. Also introduces a new confdb option debug_to_files which does the same, but can be specified per-service in the config file. The logfiles are stored in /var/log/sssd by default. Changes the initscript to log to files by default.
2009-09-25Upgrade confdb to version 2Stephen Gallagher2-8/+8
This converts a great many configuration options to the new standard format.
2009-09-23Revert "Use syslog for logging error conditions in SSSD"Stephen Gallagher3-34/+17
This reverts commit 8c50bd085c0efe5fde354deee2c8118887aae29d. Amended: commit 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e also made use of the SYSLOG_ERROR() macro, so those portions of that code also needed to be reverted.
2009-09-21Use syslog for logging error conditions in SSSDJakub Hrozek3-17/+34
This is just a band-aid until ELAPI is fully functional and ready to use.
2009-09-21Provide python bindings for sysdbJakub Hrozek1-0/+8
Implement a set of python bindings for the sysdb with feature set similar to what is available in the tools. The primary consumers would be applications like system-config-users. Resolves: Ticket #102
2009-09-11Add copyright noticesJakub Hrozek4-0/+81
Fixes: #138
2009-09-10Remove unused event context argument from confdb_initStephen Gallagher1-2/+2
Because the confdb always operates synchronously, it maintains its own private event context internally. The event context argument passed to it is never used, so we'll remove it to avoid confusion.
2009-09-10Add strtoint32 and strtouint32 convenience functionsStephen Gallagher2-0/+97
2009-09-09more fixes for older libpcre versionssbose1-2/+4
- older version of libpcre only support the Python syntax (?P<name>) for named subpatterns
2009-09-08Split database in multiple filesSimo Sorce2-0/+125
The special persistent local database retains the original name. All other backends now have their own cache-NAME.ldb file.
2009-09-01check if libpcre version is above or below 7Sumit Bose1-1/+13
PCRE_DUPNAMES is a new feature of libpcre 7. It is used in sssd to make the splitting of fully qualified user names more flexible.
2009-08-28add configure check for errno_tSumit Bose1-0/+5
2009-08-11Make child processes exit when parent diesJakub Hrozek3-1/+46
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-05Fix broken ifndefsSimo Sorce1-9/+0
ifndef doesn't work for those functions that aren't already macro definitions in tevent.h like tevent_req_data. However if tevent_req_data is defined in tevent.h, all other functions are available as well. So just check for tevent_req_data and define all of them if it is not available. This should fix compiling on distros with the latsest tevent.
2009-08-05Move parsing of names and domains into util/Jakub Hrozek2-0/+134
2009-08-05Consolidate tevent helpersJakub Hrozek1-0/+25
2009-07-20Add option to add timestamps to debug outputSimo Sorce3-4/+32
use '--debug-timestamps' at the command line or set 'debug-timestamps = TRUE' in the configuration file.
2009-07-20Instrument memberof for debuggingSimo Sorce1-1/+3
Fix ldb debug to avoid printing the debug function name, it's useless.
2009-07-10add a short explanation about the used debug levelsSumit Bose1-0/+14
2009-07-02PRINT and ERROR macrosJakub Hrozek1-0/+3
2009-06-19Allow the use of custom CFLAGS on the make command lineStephen Gallagher1-0/+1
Setting CFLAGS explicitly in configure.ac means that they would be overwritten when using e.g. make CFLAGS="-O0 -g" This replaces the explicit setting of CFLAGS with an AM_CONDITIONAL to have Makefile.am set these instead. Also fixes a missing #include that was coincidentally obscured because gcc's -O2 happened to be able to locate it. Setting -O0 revealed the problem.
2009-06-17Create gettext framework for SSSD daemonStephen Gallagher2-0/+14
2009-06-11Add missing configure check for getpgrpStephen Gallagher1-1/+1
2009-06-10Turn sssd_mem_takeover into sssd_mem_attachSimo Sorce2-25/+51
The old function was not used anywhere, and this function uses better semantics, including not using void ** which gives strict aliasing problems. Also add a generic password destroy function
2009-06-08Fix invalid pointer error in ldb_debug_messagesStephen Gallagher1-2/+19
2009-06-02add utility function talloc_zfreeSimo Sorce1-0/+4
2009-05-28Suppress "rootdse" error messages.Stephen Gallagher2-0/+29
We will trap all LDB debug messages and pipe them into our internal DEBUG() function. LDB FATAL messages will still be printed by default, WARNING and TRACE functions will be at debug level 3 and 9, respectively.
2009-05-28Use PTR_2_INT for alignment calculationsSimo Sorce1-4/+5
This version should be pointer size agnostic. Should make this code safe on both 32bit and 64bit.
2009-05-26Silence warningsSimo Sorce1-0/+2
2009-05-18Fix crypt functions to not use static buffers.Simo Sorce2-320/+318
Also fix style, clarify, and simplify some logic.
2009-05-08Chdir to / when daemonizingJakub Hrozek1-0/+11
2009-05-08Use tevent for shutdown signals, remove old pidfile, make sssd single-instance.Jakub Hrozek1-1/+9
Use tevent signal handling facilities for handlong SIGTERM and SIGINT in the monitor. Remove pidfile on SIGTERM and SIGINT. Make sssd single-instance by checking if we suceeded in signaling the process in the pidfile.
2009-04-07Clean up warnings in SSSDStephen Gallagher1-12/+12
2009-03-20Enhance server_setupSimo Sorce2-0/+11
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-13Better error reporting for pidfile()Simo Sorce1-7/+11
This should help understanding what's going on if the server fails to create a pid file.
2009-03-11Fix calling setsid and resolve the sssd signal bugSimo Sorce1-11/+1
For some reason we were not testing for HAVE_SETSID in configure therefore the setsid() function was never called. This failed to set the process group after the first fork. Remove ifdef because we depend on setsid() anyway, so if it is not available on some platform it is better to fail rather then silently succeed but not have the right process group set up.
2009-03-02Do not steal memory in btreemaps.Simo Sorce1-4/+7
Just make sure that the memory passed in is either static or allocated on the same memory context that is parent of the btreemap.
2009-03-02Implement GetUserAttributes in the InfoPipeStephen Gallagher1-1/+3
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 Bose2-0/+422
2009-02-28Fix confdb issues.Simo Sorce1-9/+4
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.
2009-02-27Refactor creation of domain_map into confdbStephen Gallagher2-9/+39
The NSS provider, the Data Provider backends and the InfoPipe all need access to the domain map provided by the confdb. Instead of reimplimenting it in multiple places, it is now provided in a pair of helper functions from the confdb. confdb_get_domains() returns a domain map by reference. Always returns the most up-to-date set of domains from the confdb. confdb_get_domains_list() returns an array of strings of all the domain names. Always returns the most up-to-date set of domains from the confdb. This patch also modifies the btreemap_get_keys() function to better handle memory and report allocation failures.
2009-02-26Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce5-16/+18
dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
2009-02-24Adding support for CheckPermissions to InfoPipe.Stephen Gallagher2-0/+38
CheckPermissions will currently return unrestricted access to the root user, and no access to any other user. Once we decide on an ACL mechanism, this will be easy to change. I have also added very basic tests for the Introspect and CheckPermissions methods.