diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-11 14:23:31 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-11-11 17:18:39 +0100 |
commit | 3520d42bd9d5708bb9bad295efff23d1177cc32a (patch) | |
tree | 9db2bbb18c4f0a38b3dc0d98aa1a873a1dd7b9af /src/account | |
parent | eff6cb40a89756bb8f62200a99b830639e9b17fc (diff) | |
download | openlmi-providers-3520d42bd9d5708bb9bad295efff23d1177cc32a.tar.gz openlmi-providers-3520d42bd9d5708bb9bad295efff23d1177cc32a.tar.xz openlmi-providers-3520d42bd9d5708bb9bad295efff23d1177cc32a.zip |
account: Ignore homedir deletion failures when deleting an user
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.
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/LMI_AccountProvider.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index c022953..da7f970 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -55,7 +55,10 @@ // Return values of functions // Delete user #define USER_NOT_EXIST 4096 -#define CANNOT_DELETE_HOME 4097 +#if 0 + /* Unused */ + #define CANNOT_DELETE_HOME 4097 +#endif #define CANNOT_DELETE_USER 4098 #define CANNOT_DELETE_GROUP 4099 // Change password @@ -596,11 +599,9 @@ static CMPIrc delete_user( if (!ret) { const char *const home = lu_ent_get_first_string(lue, LU_HOMEDIRECTORY); /* If null is returned then asprintf handle it. */ - asprintf(&errormsg, - "User's homedir %s could not be deleted: %s\n", home, - lu_strerror(error)); - rc = CANNOT_DELETE_HOME; - goto clean; + warn("User's homedir %s could not be deleted: %s\n", home, lu_strerror(error)); + /* Silently succeed, remove the user despite keeping homedir aside */ + lu_error_free(&error); } } |