diff options
Diffstat (limited to 'src/account/LMI_AccountProvider.c')
-rw-r--r-- | src/account/LMI_AccountProvider.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index c4a68f7..27be7e1 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -120,16 +120,22 @@ static CMPIStatus LMI_AccountEnumInstances( LMI_Account_Set_LoginShell(&la, aux_lu_get_str(lue, LU_LOGINSHELL)); last_change = aux_lu_get_long(lue, LU_SHADOWLASTCHANGE); - LMI_Account_Set_PasswordLastChange(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(last_change), false, rc)); - + if (last_change != SHADOW_VALUE_EMPTY) + { + LMI_Account_Set_PasswordLastChange(&la, + CMNewDateTimeFromBinary(_cb, DAYSTOMS(last_change), false, rc)); + } min_lifetime = aux_lu_get_long(lue, LU_SHADOWMIN); max_lifetime = aux_lu_get_long(lue, LU_SHADOWMAX); - LMI_Account_Set_PasswordPossibleChange(&la, - CMNewDateTimeFromBinary(_cb, DAYSTOMS(min_lifetime), true, rc)); + if (min_lifetime != SHADOW_VALUE_EMPTY) + { + LMI_Account_Set_PasswordPossibleChange(&la, + CMNewDateTimeFromBinary(_cb, DAYSTOMS(min_lifetime), true, rc)); + } - if (max_lifetime != 0 && max_lifetime != 99999) + if (max_lifetime != SHADOW_VALUE_EMPTY && + max_lifetime != SHADOW_MAX_DISABLED) { LMI_Account_Set_PasswordExpiration(&la, CMNewDateTimeFromBinary(_cb, DAYSTOMS(max_lifetime), true, rc)); @@ -137,7 +143,7 @@ static CMPIStatus LMI_AccountEnumInstances( LMI_Account_Set_PasswordExpirationWarning(&la, CMNewDateTimeFromBinary(_cb, DAYSTOMS(warn), true, rc)); inactive = aux_lu_get_long(lue, LU_SHADOWINACTIVE); - if (inactive != -1) + if (inactive != SHADOW_VALUE_EMPTY) { LMI_Account_Set_PasswordInactivation(&la, CMNewDateTimeFromBinary(_cb, DAYSTOMS(inactive), true, rc)); @@ -151,7 +157,7 @@ static CMPIStatus LMI_AccountEnumInstances( } expire = aux_lu_get_long(lue, LU_SHADOWEXPIRE); - if (expire != -1) + if (expire != SHADOW_VALUE_EMPTY) { LMI_Account_Set_AccountExpiration(&la, CMNewDateTimeFromBinary(_cb, DAYSTOMS(expire), false, rc)); @@ -163,7 +169,7 @@ static CMPIStatus LMI_AccountEnumInstances( last_login = aux_utmp_latest(aux_lu_get_str(lue, LU_USERNAME)); - if (last_login != -1) + if (last_login != SHADOW_VALUE_EMPTY) { LMI_Account_Set_LastLogin(&la, CMNewDateTimeFromBinary(_cb, STOMS(last_login), false, rc)); |