From 90a474045b13e69d9a6249f1d316809ec081ed87 Mon Sep 17 00:00:00 2001 From: Jaemin Ryu Date: Fri, 22 Feb 2019 14:51:40 +0900 Subject: [PATCH] Change getters to use methodCallForce All getters of password policy require password privilege. Thus privilege check should be performed in the every method call Change-Id: Ia0fabe1c8c42319105f4b8b16e81c51cbd52bad6 Signed-off-by: Jaemin Ryu --- api/password.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/password.cpp b/api/password.cpp index b890ab3..011bfbe 100644 --- a/api/password.cpp +++ b/api/password.cpp @@ -85,7 +85,7 @@ EXPORT_API int dpm_password_get_quality(void* handle, int *quality) try { Status ret { 0 }; - ret = client.methodCall("Password::getQuality"); + ret = client.methodCallForce("Password::getQuality"); if (ret.get() < 0) { return -1; } @@ -123,7 +123,7 @@ EXPORT_API int dpm_password_get_minimum_length(void* handle, int *value) try { Status ret { 0 }; - ret = client.methodCall("Password::getMinimumLength"); + ret = client.methodCallForce("Password::getMinimumLength"); if (ret.get() < 0) { return -1; @@ -162,7 +162,7 @@ EXPORT_API int dpm_password_get_min_complex_chars(void* handle, int *value) try { Status ret { 0 }; - ret = client.methodCall("Password::getMinComplexChars"); + ret = client.methodCallForce("Password::getMinComplexChars"); if (ret.get() < 0) { return -1; } @@ -200,7 +200,7 @@ EXPORT_API int dpm_password_get_maximum_failed_attempts_for_wipe(void* handle, i try { Status ret { 0 }; - ret = client.methodCall("Password::getMaximumFailedForWipe"); + ret = client.methodCallForce("Password::getMaximumFailedForWipe"); if (ret.get() < 0) { return -1; } @@ -238,7 +238,7 @@ EXPORT_API int dpm_password_get_expires(void* handle, int *value) try { Status ret { 0 }; - ret = client.methodCall("Password::getExpires"); + ret = client.methodCallForce("Password::getExpires"); if (ret.get() < 0) { return -1; } @@ -276,7 +276,7 @@ EXPORT_API int dpm_password_get_history(void* handle, int *value) try { Status ret { 0 }; - ret = client.methodCall("Password::getHistory"); + ret = client.methodCallForce("Password::getHistory"); if (ret.get() < 0) { return -1; } @@ -361,7 +361,7 @@ EXPORT_API int dpm_password_get_max_inactivity_time_device_lock(void* handle, in try { Status ret { 0 }; - ret = client.methodCall("Password::getMaxInactivityTimeDeviceLock");; + ret = client.methodCallForce("Password::getMaxInactivityTimeDeviceLock");; if (ret.get() < 0) { return -1; } @@ -401,7 +401,7 @@ EXPORT_API int dpm_password_get_ret(void* handle, dpm_password_status_e *status) try { Status ret { 0 }; - ret = client.methodCall("Password::getStatus"); + ret = client.methodCallForce("Password::getStatus"); if (ret.get() < 0) { return -1; } @@ -438,7 +438,7 @@ EXPORT_API int dpm_password_get_pattern(void* handle, char **pattern) try { Status ret { std::string() }; - ret = client.methodCall("Password::getPattern"); + ret = client.methodCallForce("Password::getPattern"); *pattern = ::strdup(ret.get().c_str()); } catch (...) { return -1; @@ -472,7 +472,7 @@ EXPORT_API int dpm_password_get_maximum_character_occurrences(void* handle, int try { Status ret { 0 }; - ret = client.methodCall("Password::getMaximumCharacterOccurrences"); + ret = client.methodCallForce("Password::getMaximumCharacterOccurrences"); if (ret.get() < 0) { return -1; } @@ -510,7 +510,7 @@ EXPORT_API int dpm_password_get_maximum_numeric_sequence_length(void* handle, in try { Status ret { 0 }; - ret = client.methodCall("Password::getMaximumNumericSequenceLength"); + ret = client.methodCallForce("Password::getMaximumNumericSequenceLength"); if (ret.get() < 0) { return -1; } @@ -605,7 +605,7 @@ EXPORT_API int dpm_password_get_recovery(void* handle, int *enable) try { Status ret { false }; - ret = client.methodCall("Password::getRecovery"); + ret = client.methodCallForce("Password::getRecovery"); if (ret.get() < 0) { return -1; } -- 2.7.4