diff options
author | Jan Synacek <jsynacek@redhat.com> | 2014-04-29 08:33:13 +0200 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2014-04-30 15:54:14 +0200 |
commit | 55f63d29f5d2b4e82979d71386df58394e87ef5a (patch) | |
tree | 34227f5696df9b3a85c5999d2fd48f50be82681f /src/account | |
parent | dab89c6afb2a2b339ebadea3d47e841cd749b5ef (diff) | |
download | openlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.tar.gz openlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.tar.xz openlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.zip |
libopenlmi: reorganize and gather
Make naming consistent. Gather common functionality into one library and
try to use it across all providers.
Introduce libtool-style versioning for libraries.
Diffstat (limited to 'src/account')
20 files changed, 41 insertions, 65 deletions
diff --git a/src/account/CMakeLists.txt b/src/account/CMakeLists.txt index 83ca474..09a4322 100644 --- a/src/account/CMakeLists.txt +++ b/src/account/CMakeLists.txt @@ -46,7 +46,7 @@ pkg_check_modules(LIBUSER REQUIRED libuser>=0.60) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS} ${LIBUSER_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/src/indmanager) -target_link_libraries(${LIBRARY_NAME} openlmicommon ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES} ${LIBUSER_LIBRARIES} openlmiindmanager) +target_link_libraries(${LIBRARY_NAME} openlmi ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES} ${LIBUSER_LIBRARIES} openlmiindmanager) # Create registration file cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF} share/openlmi-providers) diff --git a/src/account/LMI_AccountCapabilitiesProvider.c b/src/account/LMI_AccountCapabilitiesProvider.c index d304257..0aea405 100644 --- a/src/account/LMI_AccountCapabilitiesProvider.c +++ b/src/account/LMI_AccountCapabilitiesProvider.c @@ -24,7 +24,6 @@ #include "LMI_EnabledAccountCapabilities.h" #include "macros.h" -#include "globals.h" #include "aux_lu.h" #include "account_globals.h" @@ -80,7 +79,7 @@ static CMPIStatus LMI_AccountCapabilitiesEnumInstances( LMI_EnabledAccountCapabilitiesRef_Init(&leacref, _cb, nameSpace); LMI_EnabledAccountCapabilitiesRef_Set_InstanceID(&leacref, - ORGID":"LEACNAME); + LMI_ORGID":"LEACNAME); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) diff --git a/src/account/LMI_AccountManagementCapabilitiesProvider.c b/src/account/LMI_AccountManagementCapabilitiesProvider.c index 3909603..42b74ac 100644 --- a/src/account/LMI_AccountManagementCapabilitiesProvider.c +++ b/src/account/LMI_AccountManagementCapabilitiesProvider.c @@ -24,7 +24,6 @@ #include <stdbool.h> #include "macros.h" -#include "globals.h" #include "account_globals.h" #define NAME LAMCNAME @@ -68,7 +67,7 @@ static CMPIStatus LMI_AccountManagementCapabilitiesEnumInstances( LMI_AccountManagementCapabilities_Init(&lamc, _cb, KNameSpace(cop)); LMI_AccountManagementCapabilities_Set_ElementNameEditSupported( &lamc, false); - LMI_AccountManagementCapabilities_Set_InstanceID(&lamc, ORGID":"LAMCNAME); + LMI_AccountManagementCapabilities_Set_InstanceID(&lamc, LMI_ORGID":"LAMCNAME); LMI_AccountManagementCapabilities_Set_ElementName(&lamc, NAME); LMI_AccountManagementCapabilities_Init_OperationsSupported(&lamc, 3); diff --git a/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c b/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c index efece85..84a0921 100644 --- a/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c +++ b/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c @@ -25,7 +25,6 @@ #include "macros.h" #include "account_globals.h" -#include "globals.h" static const CMPIBroker* _cb; @@ -76,7 +75,7 @@ static CMPIStatus LMI_AccountManagementServiceCapabilitiesEnumInstances( LMI_AccountManagementCapabilitiesRef_Init(&lamcref, _cb, nameSpace); LMI_AccountManagementCapabilitiesRef_Set_InstanceID(&lamcref, - ORGID":"LAMCNAME); + LMI_ORGID":"LAMCNAME); LMI_AccountManagementServiceCapabilities_Init(&lamsc, _cb, nameSpace); LMI_AccountManagementServiceCapabilities_Set_ManagedElement(&lamsc, diff --git a/src/account/LMI_AccountManagementServiceProvider.c b/src/account/LMI_AccountManagementServiceProvider.c index 21473ea..e0e6f89 100644 --- a/src/account/LMI_AccountManagementServiceProvider.c +++ b/src/account/LMI_AccountManagementServiceProvider.c @@ -27,7 +27,6 @@ #include "LMI_Group.h" #include "macros.h" -#include "globals.h" #include "aux_lu.h" #include "account_globals.h" @@ -57,7 +56,7 @@ static void LMI_AccountManagementServiceInitialize(const CMPIContext *ctx) { lmi_init(provider_name, _cb, ctx, provider_config_defaults); if (init_lock_pools() == 0) { - error("Unable to initialize lock pool."); + lmi_error("Unable to initialize lock pool."); exit (1); } } @@ -285,7 +284,7 @@ KUint32 LMI_AccountManagementService_CreateGroup( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); @@ -341,7 +340,7 @@ KUint32 LMI_AccountManagementService_CreateGroup( /* Output created group identity */ KRefA_Init(Identities, cb, 1); LMI_IdentityRef_Init(&Identityref, cb, nameSpace); - asprintf(&instanceid, ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); + asprintf(&instanceid, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&Identityref, instanceid); free(instanceid); IdentityOP = LMI_IdentityRef_ToObjectPath(&Identityref, NULL); @@ -429,7 +428,7 @@ KUint32 LMI_AccountManagementService_CreateAccount( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); @@ -591,7 +590,7 @@ output: /* Identity of Account */ LMI_IdentityRef_Init(&Identityref, cb, nameSpace); - asprintf(&instanceid, ORGID":UID:%ld", + asprintf(&instanceid, LMI_ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&Identityref, instanceid); free(instanceid); @@ -599,7 +598,7 @@ output: KRefA_Set(Identities, 0, IdentityOP); /* Identity of Group */ - asprintf(&instanceid, ORGID":GID:%ld", + asprintf(&instanceid, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&Identityref, instanceid); free(instanceid); diff --git a/src/account/LMI_AccountOnSystemProvider.c b/src/account/LMI_AccountOnSystemProvider.c index 8bcd835..9c5960b 100644 --- a/src/account/LMI_AccountOnSystemProvider.c +++ b/src/account/LMI_AccountOnSystemProvider.c @@ -31,7 +31,6 @@ #include "aux_lu.h" #include "macros.h" #include "account_globals.h" -#include "globals.h" static const CMPIBroker* _cb; diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index ca9758a..fcfde9e 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -49,7 +49,6 @@ #include "aux_lu.h" #include "macros.h" -#include "globals.h" #include "lock.h" #include "account_globals.h" @@ -72,7 +71,7 @@ static void LMI_AccountInitialize(const CMPIContext *ctx) { lmi_init(provider_name, _cb, ctx, provider_config_defaults); if (init_lock_pools() == 0) { - error("Unable to initialize lock pool."); + lmi_error("Unable to initialize lock pool."); exit (1); } } @@ -155,7 +154,7 @@ static CMPIStatus LMI_AccountEnumInstances( if (last_change != SHADOW_VALUE_EMPTY) { LMI_Account_Set_PasswordLastChange(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(last_change), false, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(last_change), false, rc)); } min_lifetime = aux_lu_get_long(lue, LU_SHADOWMIN); max_lifetime = aux_lu_get_long(lue, LU_SHADOWMAX); @@ -163,22 +162,22 @@ static CMPIStatus LMI_AccountEnumInstances( if (min_lifetime != SHADOW_VALUE_EMPTY) { LMI_Account_Set_PasswordPossibleChange(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(min_lifetime), true, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(min_lifetime), true, rc)); } if (max_lifetime != SHADOW_VALUE_EMPTY && max_lifetime != SHADOW_MAX_DISABLED) { LMI_Account_Set_PasswordExpiration(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(max_lifetime), true, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(max_lifetime), true, rc)); warn = aux_lu_get_long(lue, LU_SHADOWWARNING); LMI_Account_Set_PasswordExpirationWarning(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(warn), true, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(warn), true, rc)); inactive = aux_lu_get_long(lue, LU_SHADOWINACTIVE); if (inactive != SHADOW_VALUE_EMPTY) { LMI_Account_Set_PasswordInactivation(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(inactive), true, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(inactive), true, rc)); } } else @@ -192,7 +191,7 @@ static CMPIStatus LMI_AccountEnumInstances( if (expire != SHADOW_VALUE_EMPTY) { LMI_Account_Set_AccountExpiration(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(expire), false, rc)); + CMNewDateTimeFromBinary(_cb, LMI_DAYS_TO_MS(expire), false, rc)); } else { @@ -204,7 +203,7 @@ static CMPIStatus LMI_AccountEnumInstances( if (last_login != SHADOW_VALUE_EMPTY) { LMI_Account_Set_LastLogin(&la, - CMNewDateTimeFromBinary(_cb, STOMS(last_login), false, rc)); + CMNewDateTimeFromBinary(_cb, LMI_SECS_TO_MS(last_login), false, rc)); } password = aux_lu_get_str(lue, LU_SHADOWPASSWORD); @@ -307,7 +306,7 @@ static CMPIStatus LMI_AccountModifyInstance( get_giant_lock(); pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) @@ -384,7 +383,7 @@ static CMPIStatus LMI_AccountModifyInstance( {\ (VAR).interval = CMIsInterval(\ CMGetProperty(ci, (NAME), NULL).value.dateTime, NULL); \ - (VAR).value = MSTODAYS(CMGetBinaryFormat(\ + (VAR).value = LMI_MS_TO_DAYS(CMGetBinaryFormat(\ CMGetProperty(ci, (NAME), NULL).value.dateTime, NULL));\ }\ @@ -552,7 +551,7 @@ static CMPIrc delete_user( get_giant_lock(); pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) { @@ -590,7 +589,7 @@ 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. */ - warn("User's homedir %s could not be deleted: %s\n", home, lu_strerror(error)); + lmi_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); } @@ -766,7 +765,7 @@ KUint32 LMI_Account_ChangePassword( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); diff --git a/src/account/LMI_AccountSettingDataProvider.c b/src/account/LMI_AccountSettingDataProvider.c index e132a03..f5703f8 100644 --- a/src/account/LMI_AccountSettingDataProvider.c +++ b/src/account/LMI_AccountSettingDataProvider.c @@ -23,7 +23,6 @@ #include "macros.h" #include "account_globals.h" -#include "globals.h" #include <libuser/config.h> #include <libuser/user.h> diff --git a/src/account/LMI_AssignedAccountIdentityProvider.c b/src/account/LMI_AssignedAccountIdentityProvider.c index 1810455..80a8915 100644 --- a/src/account/LMI_AssignedAccountIdentityProvider.c +++ b/src/account/LMI_AssignedAccountIdentityProvider.c @@ -26,7 +26,6 @@ #include "aux_lu.h" #include "macros.h" #include "account_globals.h" -#include "globals.h" #include <libuser/entity.h> #include <libuser/user.h> @@ -89,7 +88,7 @@ static CMPIStatus LMI_AssignedAccountIdentityEnumInstances( lue = g_ptr_array_index(accounts, i); LMI_IdentityRef_Init(&liref, _cb, nameSpace); - asprintf(&uid, ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); + asprintf(&uid, LMI_ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&liref, uid); free(uid); diff --git a/src/account/LMI_AssignedGroupIdentityProvider.c b/src/account/LMI_AssignedGroupIdentityProvider.c index 2950dc0..57ab263 100644 --- a/src/account/LMI_AssignedGroupIdentityProvider.c +++ b/src/account/LMI_AssignedGroupIdentityProvider.c @@ -26,7 +26,6 @@ #include "aux_lu.h" #include "macros.h" #include "account_globals.h" -#include "globals.h" #include <libuser/entity.h> #include <libuser/user.h> @@ -92,7 +91,7 @@ static CMPIStatus LMI_AssignedGroupIdentityEnumInstances( LMI_GroupRef_Set_Name(&lgref, aux_lu_get_str(lue, LU_GROUPNAME)); LMI_IdentityRef_Init(&liref, _cb, nameSpace); - asprintf(&gid, ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); + asprintf(&gid, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&liref, gid); free(gid); diff --git a/src/account/LMI_EnabledAccountCapabilitiesProvider.c b/src/account/LMI_EnabledAccountCapabilitiesProvider.c index 319e926..c7b5221 100644 --- a/src/account/LMI_EnabledAccountCapabilitiesProvider.c +++ b/src/account/LMI_EnabledAccountCapabilitiesProvider.c @@ -23,7 +23,6 @@ #include "macros.h" #include "account_globals.h" -#include "globals.h" #include <stdbool.h> @@ -64,7 +63,7 @@ static CMPIStatus LMI_EnabledAccountCapabilitiesEnumInstances( const char *nameSpace = KNameSpace(cop); LMI_EnabledAccountCapabilities_Init(&leac, _cb, nameSpace); - LMI_EnabledAccountCapabilities_Set_InstanceID(&leac, ORGID":"LEACNAME); + LMI_EnabledAccountCapabilities_Set_InstanceID(&leac, LMI_ORGID":"LEACNAME); LMI_EnabledAccountCapabilities_Set_ElementName(&leac, LEACNAME); LMI_EnabledAccountCapabilities_Init_RequestedStatesSupported(&leac, 0); LMI_EnabledAccountCapabilities_Set_ElementNameEditSupported(&leac, diff --git a/src/account/LMI_GroupProvider.c b/src/account/LMI_GroupProvider.c index 20d93b5..7367358 100644 --- a/src/account/LMI_GroupProvider.c +++ b/src/account/LMI_GroupProvider.c @@ -31,7 +31,6 @@ #include "aux_lu.h" #include "macros.h" #include "account_globals.h" -#include "globals.h" #include "lock.h" @@ -46,7 +45,7 @@ static void LMI_GroupInitialize(const CMPIContext *ctx) { lmi_init(provider_name, _cb, ctx, provider_config_defaults); if (init_lock_pools() == 0) { - error("Unable to initialize lock pool."); + lmi_error("Unable to initialize lock pool."); exit (1); } @@ -103,7 +102,7 @@ static CMPIStatus LMI_GroupEnumInstances( LMI_Group_Set_Name(&lg, aux_lu_get_str(lue, LU_GROUPNAME)); LMI_Group_Set_ElementName(&lg, aux_lu_get_str(lue, LU_GROUPNAME)); LMI_Group_Set_CommonName(&lg, aux_lu_get_str(lue, LU_GROUPNAME)); - asprintf(&instanceid, ORGID":GID:%ld", + asprintf(&instanceid, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_Group_Set_InstanceID(&lg, instanceid); free(instanceid); @@ -175,7 +174,7 @@ static CMPIrc delete_group( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) { diff --git a/src/account/LMI_HostedAccountManagementServiceProvider.c b/src/account/LMI_HostedAccountManagementServiceProvider.c index 5d7b391..89fdcf3 100644 --- a/src/account/LMI_HostedAccountManagementServiceProvider.c +++ b/src/account/LMI_HostedAccountManagementServiceProvider.c @@ -25,7 +25,6 @@ #include "macros.h" #include "account_globals.h" -#include "globals.h" static const CMPIBroker* _cb; diff --git a/src/account/LMI_IdentityProvider.c b/src/account/LMI_IdentityProvider.c index b86bff0..eb361ce 100644 --- a/src/account/LMI_IdentityProvider.c +++ b/src/account/LMI_IdentityProvider.c @@ -26,7 +26,6 @@ #include <libuser/user.h> #include "macros.h" -#include "globals.h" #include "aux_lu.h" #include "account_globals.h" @@ -87,7 +86,7 @@ static CMPIStatus LMI_IdentityEnumInstances( LMI_Identity_Init(&li, _cb, nameSpace); /* Need to convert long int UID to the string */ - asprintf(&instanceid, ORGID":UID:%ld", + asprintf(&instanceid, LMI_ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); LMI_Identity_Set_InstanceID(&li, instanceid); free(instanceid); @@ -109,7 +108,7 @@ static CMPIStatus LMI_IdentityEnumInstances( LMI_Identity_Init(&li, _cb, nameSpace); /* Need to convert long int UID to the string */ - asprintf(&instanceid, ORGID":GID:%ld", + asprintf(&instanceid, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_Identity_Set_InstanceID(&li, instanceid); free(instanceid); @@ -181,7 +180,7 @@ static CMPIStatus LMI_IdentityDeleteInstance( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) diff --git a/src/account/LMI_MemberOfGroupProvider.c b/src/account/LMI_MemberOfGroupProvider.c index 8751597..4928f4d 100644 --- a/src/account/LMI_MemberOfGroupProvider.c +++ b/src/account/LMI_MemberOfGroupProvider.c @@ -28,7 +28,6 @@ #include "aux_lu.h" #include "macros.h" #include "account_globals.h" -#include "globals.h" #include <libuser/entity.h> #include <libuser/user.h> @@ -104,7 +103,7 @@ static CMPIStatus LMI_MemberOfGroupEnumInstances( lu_user_lookup_name(luc, g_value_get_string(g_value_array_get_nth(accounts, j)), luea, &error); - asprintf(&uid, ORGID":UID:%ld", + asprintf(&uid, LMI_ORGID":UID:%ld", aux_lu_get_long(luea, LU_UIDNUMBER)); LMI_IdentityRef_Init(&liref, _cb, nameSpace); LMI_IdentityRef_Set_InstanceID(&liref, uid); @@ -193,7 +192,7 @@ static CMPIStatus LMI_MemberOfGroupCreateInstance( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) { @@ -291,7 +290,7 @@ static CMPIStatus LMI_MemberOfGroupDeleteInstance( pwdlockres = lckpwdf(); if (pwdlockres != 0) - warn("Cannot acquire passwd file lock\n"); + lmi_warn("Cannot acquire passwd file lock\n"); luc = lu_start(NULL, 0, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) { diff --git a/src/account/LMI_OwningGroupProvider.c b/src/account/LMI_OwningGroupProvider.c index 2fef2c8..0974aef 100644 --- a/src/account/LMI_OwningGroupProvider.c +++ b/src/account/LMI_OwningGroupProvider.c @@ -24,7 +24,6 @@ #include "LMI_Group.h" #include "macros.h" -#include "globals.h" #include "aux_lu.h" #include "account_globals.h" diff --git a/src/account/LMI_ServiceAffectsIdentityProvider.c b/src/account/LMI_ServiceAffectsIdentityProvider.c index 5eccab4..5d302a2 100644 --- a/src/account/LMI_ServiceAffectsIdentityProvider.c +++ b/src/account/LMI_ServiceAffectsIdentityProvider.c @@ -24,7 +24,6 @@ #include "LMI_Identity.h" #include "macros.h" -#include "globals.h" #include "aux_lu.h" #include "account_globals.h" @@ -100,7 +99,7 @@ static CMPIStatus LMI_ServiceAffectsIdentityEnumInstances( lue = g_ptr_array_index(accounts, i); LMI_IdentityRef_Init(&liref, _cb, nameSpace); - asprintf(&id, ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); + asprintf(&id, LMI_ORGID":UID:%ld", aux_lu_get_long(lue, LU_UIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&liref, id); free(id); @@ -127,7 +126,7 @@ static CMPIStatus LMI_ServiceAffectsIdentityEnumInstances( lue = g_ptr_array_index(accounts, i); LMI_IdentityRef_Init(&liref, _cb, nameSpace); - asprintf(&id, ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); + asprintf(&id, LMI_ORGID":GID:%ld", aux_lu_get_long(lue, LU_GIDNUMBER)); LMI_IdentityRef_Set_InstanceID(&liref, id); free(id); diff --git a/src/account/indication_common.c b/src/account/indication_common.c index d9629b4..e64e02b 100644 --- a/src/account/indication_common.c +++ b/src/account/indication_common.c @@ -32,7 +32,6 @@ #include <errno.h> #include "indication_common.h" -#include <globals.h> #define EVENT_SIZE (sizeof(struct inotify_event)) #define BUF_LEN (10 * EVENT_SIZE + NAME_MAX + 1) @@ -104,7 +103,7 @@ void watcher_destroy(AccountIndication *ind) bool watcher(AccountIndication *ind, void **data) { struct timespec curr_pwd, curr_grp; - char errbuf[STRERROR_BUF_LEN]; + char errbuf[BUFLEN]; if (ind->inotify_fd < 0) return false; @@ -113,7 +112,7 @@ bool watcher(AccountIndication *ind, void **data) do { const int len = read(ind->inotify_fd, buffer, BUF_LEN); if (len < 0) { - warn("account watcher: error reading from inotify fd: %s", strerror_r(errno, errbuf, sizeof(errbuf))); + lmi_warn("account watcher: error reading from inotify fd: %s", strerror_r(errno, errbuf, sizeof(errbuf))); watcher_destroy(ind); watcher_init(ind); return false; @@ -129,7 +128,7 @@ bool watcher(AccountIndication *ind, void **data) while (i + (ssize_t) EVENT_SIZE < len) { struct inotify_event *event = (struct inotify_event *) &buffer[i]; if (i + (ssize_t) EVENT_SIZE + event->len > len) { - error("Unable to create watcher, inotify initialization failed"); + lmi_error("Unable to create watcher, inotify initialization failed"); watcher_destroy(ind); watcher_init(ind); return false; diff --git a/src/account/indication_common.h b/src/account/indication_common.h index 14e41ff..dd3ee01 100644 --- a/src/account/indication_common.h +++ b/src/account/indication_common.h @@ -21,6 +21,7 @@ #include "LMI_Account.h" #include "LMI_Group.h" #include "LMI_Identity.h" +#include "openlmi.h" typedef struct { int wd; diff --git a/src/account/macros.h b/src/account/macros.h index bd11e0b..dfa64e5 100644 --- a/src/account/macros.h +++ b/src/account/macros.h @@ -26,14 +26,6 @@ #define LAMCNAME "OpenLMI Linux Users Account Management Capabilities" #define LEACNAME "OpenLMI Linux Account Capabilities" -/* Organization ID. Used for InstaceIDs */ -#define ORGID "LMI" - -/* convert days to microseconds */ -#define DAYSTOMS(days) ((days) * 86400000000) -#define MSTODAYS(ms) ((ms) / 86400000000) -#define STOMS(s) ((s) * 1000000) - /* This will identify empty values in shadow file */ #define SHADOW_VALUE_EMPTY -1 |