Modify rule capi to catch set/unsetMask exceptions 60/177160/1
authorseolheui kim <s414.kim@samsung.com>
Thu, 26 Apr 2018 04:14:16 +0000 (13:14 +0900)
committerseolheui kim <s414.kim@samsung.com>
Thu, 26 Apr 2018 04:14:16 +0000 (13:14 +0900)
Change-Id: If2a05208f6a99ebf97ce8e9dfe8b61de92204b60
Signed-off-by: seolheui kim <s414.kim@samsung.com>
lib/audit-trail/rule.cpp

index 107ea6c1e2177c76a85179e664bed5216498057d..85cd8a152a9b6ed6d7630dc36c2ca59b8c0aae22 100644 (file)
@@ -51,18 +51,24 @@ int audit_rule_add_systemcall(audit_rule_h handle, unsigned int syscall)
 {
        RET_ON_FAILURE(handle, AUDIT_TRAIL_ERROR_INVALID_PARAMETER);
 
-       GetAuditRule(handle).setMask(syscall);
+       try {
+               GetAuditRule(handle).setMask(syscall);
+               return AUDIT_TRAIL_ERROR_NONE;
+       } catch (std::exception &e) {}
 
-       return AUDIT_TRAIL_ERROR_NONE;
+       return AUDIT_TRAIL_ERROR_INVALID_PARAMETER;
 }
 
 int audit_rule_remove_systemcall(audit_rule_h handle, unsigned int syscall)
 {
        RET_ON_FAILURE(handle, AUDIT_TRAIL_ERROR_INVALID_PARAMETER);
 
-       GetAuditRule(handle).unsetMask(syscall);
+       try {
+               GetAuditRule(handle).unsetMask(syscall);
+               return AUDIT_TRAIL_ERROR_NONE;
+       } catch (std::exception &e) {}
 
-       return AUDIT_TRAIL_ERROR_NONE;
+       return AUDIT_TRAIL_ERROR_INVALID_PARAMETER;
 }
 
 int audit_rule_add_all_systemcalls(audit_rule_h handle)