summaryrefslogtreecommitdiffstats
path: root/src/account
Commit message (Collapse)AuthorAgeFilesLines
* Add AccountIndicationTestDriver, application of indication testing framework.Alois Mahdal2014-05-221-0/+38
|
* Clean up imports in commonAlois Mahdal2014-05-151-15/+6
|
* Add utility classes for indication testingAlois Mahdal2014-05-151-0/+53
|
* Move dangling functions to common.UserOpsAlois Mahdal2014-05-158-102/+138
| | | | | Since they have much in common, I am moving them under UserOps static class. This allows for better flexibility and readability.
* Include profile (un)registration in the (un)register-PROVIDER make targetsTomas Bzatek2014-05-151-1/+1
| | | | | | | | | | This is an attempt to include profile (un)registration within the (un)register-PROVIDER make target. This commit extends the cim_registration macro by an extra argument of the profile file or list of profile files. To preserve API of the CMake modules this extra argument is an variable arg in fact and does not need to be specified. Pass a list variable to specify multiple profile files.
* account: Don't expose the LMI_Account.UserPassword valueTomas Bzatek2014-05-151-14/+27
| | | | | | | | | | | | | | | According to the Simple Identity Management Profile (DSP1034) document the LMI_Account.UserPassword property should not contain the password itself, no matter how encrypted it is. It should either contain an array of zero elements when password has been set or NULL when password is missing or not configured. Another change this commit brings is a more precise behaviour of LMI_Account.ModifyInstance() method. When the UserPassword property is array of zero elements, no change regarding password is made. This case was previously treated as a request for password removal. The DSP1034 profile doesn't specify such scenario, let's treat it the same way as the GetInstance() operation.
* account: Make LMI_MemberOfGroup.CreateInstance() more robustTomas Bzatek2014-05-151-4/+19
| | | | | | Return proper error when required properties are not set. https://fedorahosted.org/openlmi/ticket/270
* account: Mark TestAccountInvalidEtc tests as dangerousTomas Bzatek2014-05-151-0/+2
| | | | | | Really dislike these messages: cp: cannot remove ‘/etc/passwd’: Permission denied
* account: use defaultdict instead of CounterRadek Novacek2014-05-131-2/+2
| | | | Counter is not present in python <= 2.6, so replace it with defaultdict.
* Move generic code to lmi.test.utilAlois Mahdal2014-05-074-218/+10
|
* Improve random_string util functionAlois Mahdal2014-05-073-7/+9
| | | | | | | | | When writing new test, I find myself constantly computing the size from desired strength and prefix length, whereas I mostly don't care about the final size at all (plus, one can usually see that from surrounding code). Providing strength simplifies use and the function code.
* indmanager: move to libsJan Synacek2014-05-061-1/+1
|
* libopenlmi: rename back to openlmicommon and get versioning rightJan Synacek2014-05-061-1/+1
|
* libopenlmi: minor fixes and improvementsJan Synacek2014-05-068-18/+18
|
* libopenlmi: reorganize and gatherJan Synacek2014-04-3020-65/+41
| | | | | | | Make naming consistent. Gather common functionality into one library and try to use it across all providers. Introduce libtool-style versioning for libraries.
* account: Add tests for invalid system filesAlois Mahdal2014-03-252-1/+570
| | | | | | Each test creates an instance it LMI_Account, then intentionally cripples one of system files related to users/groups, and performs a simple sanity test that checks if instance properties are readable.
* Account: Try to make coverity happy.Robin Hack2014-03-051-3/+5
| | | | Fix nonsense if statement in indication_common.c.
* account: Added test for race conditionsAlois Mahdal2014-02-273-0/+406
| | | | | | | | Based on bug 1061153, these tests attempt to create, modify or delete users from a number of threads. Clean up is done by reverting backup of /etc/passwd, /etc/groups, /etc/shadow and /etc/gshadow.
* Account: Race conditions fixes (like: bz#1061150)Robin Hack2014-02-135-87/+149
| | | | | | | | | This patch solves: * Avoid race conditions with shadow-utils. * Avoid race condition with libuser: uid/gid "sharing" amoung users/groups. * Fix deadlock in lock.c code. This patch introduces giant lock which is held for all write operations.
* indicationmanager: Handle EOF in inotify readRadek Novacek2014-01-211-0/+6
|
* Updated copyright yearsPeter Schiffer2014-01-1638-38/+38
| | | | Updated copyright years to include new year 2014.
* Remove trailing spacesPeter Schiffer2014-01-1613-486/+486
| | | | This patch removes trailing spaces from source files.
* account: Use lckpwdf() to protect passwd filesTomas Bzatek2014-01-145-0/+83
| | | | | | | | | Glibc provides convenient lock functions to protect passwd and shadow files. This commit makes use of them for any write operation. Read access is still unprotected for the time being for performance reasons. https://fedorahosted.org/openlmi/ticket/205
* Use re-entrant version of strerror() for thread safetyTomas Bzatek2014-01-091-1/+2
|
* tests: ensure the use of exceptions is well definedMichal Minar2014-01-081-2/+2
| | | | | | | | | | | | | | | Some tests expect that exceptions won't be thrown out of LMIShell's functions. Others prefers them and enable them globally. This causes problems when running under nosetests all provider tests at once. Tests that modified enablement of exception throws globally caused others to fail. This patch makes sure that each TestCase has defined use of exceptions. Default state is to have them disabled. If a TestCase prefers having them enabled, just one variable needs to be overriden in its body: class AccountBase(lmibase.LmiTestCase): USE_EXCEPTIONS = True
* account: Port tests to lmishell baseTomas Bzatek2014-01-036-112/+126
|
* account: Code cleanupTomas Bzatek2013-12-201-10/+1
| | | | Unused variable, unused assignment.
* account: Initialize NULL the group array to prevent bad memory accessTomas Bzatek2013-12-031-1/+2
| | | | | | | | | Found by clang analysis: Error: PW.BRANCH_PAST_INITIALIZATION: openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: branch_past_initialization: transfer of control bypasses initialization of: openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: caretline: ^ openlmi-providers-0.4.1_75_gf47c906/src/account/LMI_AccountProvider.c:324: name_at_decl_position: variable "groups" (declared at line 328)
* account: Fall back to /etc/passwd if /etc/shadow returns NULL passwordTomas Bzatek2013-12-031-4/+10
| | | | | | | | | | | | In certain cases password may be stored in /etc/passwd directly and we need to tell libuser where to pull the password from. This patch automatically falls back to /etc/passwd if there's no password found in /etc/shadow. In case password retrieval fails in both cases, the UserPassword and UserPasswordEncoding LMI_Account properties are left unset. Based on a patch by Klaus Kämpf <kkaempf@suse.de> https://bugzilla.redhat.com/show_bug.cgi?id=1031334
* account: Free private indication data after indications are stoppedTomas Bzatek2013-11-282-6/+10
| | | | | ...to prevent race of the watcher thread still using data that has been freed just a moment ago.
* account: Fix some memory leaksTomas Bzatek2013-11-213-1/+6
| | | | GValue memory management is tricky...
* indmanager: Introduce common filter checkerTomas Bzatek2013-11-154-44/+14
| | | | | | | | | | | The filter checker code was kinda duplicate across providers and no special plans have been made for it. This change makes passing a filter checker callback during indication manager creation no longer mandatory and default filter checker will be used when NULL. However, the list of acceptable classes need to be registered before first use. This change also brings greater flexibility of the filter query which may now consist of multiple limit conditions.
* account: Make filter names in tests nicerTomas Bzatek2013-11-151-5/+5
| | | | Don't create very long strings (although it's a nice stress to CIMOM).
* account: Ignore homedir deletion failures when deleting an userTomas Bzatek2013-11-111-6/+7
| | | | | | | | | | It was impossible to remove user when its home directory was unable to delete, e.g. either pointing to a bad location or inaccessible as in not being mounted, etc. Even the "force" argument didn't help. For this reason, any failure on homedir deletion is now ignored and a warning is noted in the log. The particular error return code is unused now but kept in the MOF file for compatibility, adding a note.
* account: Watch parent directory instead of files directlyTomas Bzatek2013-11-112-63/+34
| | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way the inotify watching is done. Instead of watching files directly, we watch the directory they reside in and just filter out changes in files we don't want to watch. This brings a benefit of reliable notification through file deletions and other inode number changing changes. It's also less racy as we had to recreate watches on IN_IGNORED events with possibility of missing some events. File deletions or atomic replaces were always problematic. There are some lingering issues however. The most severe is a problem of shadow files and libuser calls. At the time the event is processed further in the gather() method, shadow files may not been updated yet. This causes libuser to miss some information required for proper CIM object instance construction, potentially propagating half-baked data to the user. This could be solved by implementing a settle timeout, possibly compressing more fast-coming events into one. For the moment a simple artificial sleep has been put before returning from the watcher in good hope shadow files are updated properly. Then there's a current problem of throwing out the rest of the read buffer, losing notifications of other files if watched. This is by current design of the watcher callback and could be fixed by implementing proper event queue.
* Fix libuser require once againTomas Bzatek2013-11-061-1/+1
| | | | | | | CMake doesn't like spaces around version requirements in pkg-config checks. Unfortunately also maintains configure cache and doesn't pick the changes in CMakeLists.txt up automatically so my typo went unspotted during testing. Damn.
* Require libuser >= 0.60Tomas Bzatek2013-11-061-1/+1
| | | | | The commit aac4d3a0d1dc brought new symbols in the code without bumping libuser version req.
* Fix coverity issuesRadek Novacek2013-11-041-2/+8
|
* account: Fix libuser object cleanupTomas Bzatek2013-11-042-4/+4
| | | | | Potential double free or freeing of uninitialized memory. Fixes some asserts thrown from libuser.
* account: Start watching right upon indication subscriptionTomas Bzatek2013-11-044-41/+90
| | | | | | | | | | This is an attempt to get rid of most probable race conditions by creating inotify watches outside the watcher thread and making them persistent for the whole time the indication subscription is active. There's a certain amount of time when watching if off due to gather part of the indication manager. Leaving a watch fd open with active watches allows us to queue events that we process next time the watcher is called (once gather part is finished).
* tests: adjusted test suits for changes in lmi.testMichal Minar2013-11-041-3/+3
| | | | | Base test classes have been renamed, this patch makes small provider tests working again.
* Account: Whitespaces removed.Robin Hack2013-11-041-6/+6
| | | | Whitespaces hunting.
* Use configured ComputerSystem class name.Jan Safranek2013-11-011-1/+1
|
* Account: Added 3 changes as one.Robin Hack2013-10-313-106/+243
| | | | | | 1) Account: Use new atomic libuser api. 2) Account: Added author and license to lock.c and lock.h. 3) Account: Added group locking to LMI_AccountProvider.
* Add lmi_get_computer_system function and fix lmi_get_system_nameRadek Novacek2013-10-3121-125/+88
| | | | | | | | | | | | | | PG_ComputerSystem has different method how to get hostname than our providers. In order to create the associations to this class we need to enumerate it. The downside is that all providers must supply CMPIContext to the lmi_init function. New function lmi_get_computer_system returns CMPIObjectPath to the configured CIM_ComputerSystem subclass instance. This object should be used in all references with ComputerSystem. Function lmi_get_system_name has been altered to return same value as ComputerSystem "Name" property.
* tests: use shared base class in provider testsMichal Minar2013-10-245-179/+15
| | | | Done for: Account, Journald and LogicalFile
* Fix some compilation warnings and coverity issuesRadek Novacek2013-10-222-3/+6
|
* Rework documentation.Jan Safranek2013-10-187-772/+0
| | | | | | | | | | - Everything is in openlmi-providers/doc/admin directory. - 'make doc' automatically builds documentation of all enabled providers. - Documentation shares one 'conf.py' for sphinx. - All documentation uses the same directory structure. There is only one CMakefile.txt to generate all the docs.
* account: Fix invalid change from migration from Linux_ to PG_Radek Novacek2013-10-171-1/+1
|
* Use PG_ComputerSystem by default.Jan Safranek2013-10-094-6/+6
| | | | | | | And get rid of sblim-cmpi-base dependency. It would be nice if our tests have an option to select Linux_ComputerSystem or PG_ComputerSystem in the future...