From cd9f6206d5a93ac87924677d9f0bd8f2a200a36d Mon Sep 17 00:00:00 2001 From: hu-jixiang1 Date: Fri, 25 Mar 2022 14:45:55 +0800 Subject: [PATCH] =?UTF-8?q?Openharmony3.1.5.5=20Hi3516DV300=20L1=20Lite?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=E4=B8=8A?= =?UTF-8?q?=E5=BA=93=5F1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu-jixiang1 Change-Id: I294239553fb2196d047468cafed23117166eb9e8 --- .../capability/src/ActsCapability.cpp | 26 +++++++++---------- .../capability/src/ActsCapabilityTest.cpp | 12 ++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/security_lite/permission_posix/capability/src/ActsCapability.cpp b/security_lite/permission_posix/capability/src/ActsCapability.cpp index 6ff60e1e2..018ffba68 100644 --- a/security_lite/permission_posix/capability/src/ActsCapability.cpp +++ b/security_lite/permission_posix/capability/src/ActsCapability.cpp @@ -56,7 +56,7 @@ int CapInit() int DropCAPCHOWN() { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPCHOWN memset_s failed"); @@ -85,7 +85,7 @@ int DropCAPCHOWN() int DropCAPDACOVERRIDE() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPDACOVERRIDE memset_s failed"); @@ -114,7 +114,7 @@ int DropCAPDACOVERRIDE() int DropCAPDACREADSEARCH() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPDACREADSEARCH memset_s failed"); @@ -143,7 +143,7 @@ int DropCAPDACREADSEARCH() int DropCAPDACOVERRIDEAndREADSEARCH() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPDACOVERRIDEAndREADSEARCH memset_s failed"); @@ -175,7 +175,7 @@ int DropCAPDACOVERRIDEAndREADSEARCH() int DropCAPFOWNER() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPFOWNER memset_s failed"); @@ -204,7 +204,7 @@ int DropCAPFOWNER() int DropCAPKILL() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPKILL memset_s failed"); @@ -233,7 +233,7 @@ int DropCAPKILL() int DropCAPSETGID() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPSETGID memset_s failed"); @@ -243,7 +243,7 @@ int DropCAPSETGID() capheader.pid = 0; struct __user_cap_data_struct capdata[CAP_NUM] = { { 0 }, { 0 } }; result = memset_s(capdata, CAP_NUM * sizeof(struct __user_cap_data_struct), - 0xff, CAP_NUM * sizeof(struct __user_cap_data_struct); + 0xff, CAP_NUM * sizeof(struct __user_cap_data_struct)); if (result != EOK) { LOG("DropCAPSETGID memset_s failed"); return FALSE; @@ -262,7 +262,7 @@ int DropCAPSETGID() int DropCAPSETUID() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPSETUID memset_s failed"); @@ -291,7 +291,7 @@ int DropCAPSETUID() int DropCAPSETPCAP() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPSETPCAP memset_s failed"); @@ -320,7 +320,7 @@ int DropCAPSETPCAP() int DropCAPSYSNICE() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPSYSNICE memset_s failed"); @@ -349,7 +349,7 @@ int DropCAPSYSNICE() int DropCAPSYSTIME() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropCAPSYSTIME memset_s failed"); @@ -378,7 +378,7 @@ int DropCAPSYSTIME() int DropAllCAP() { struct __user_cap_header_struct capheader = { 0, 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("DropAllCAP memset_s failed"); diff --git a/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp b/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp index b96b245c7..21ec355d3 100644 --- a/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp +++ b/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp @@ -258,7 +258,7 @@ static int AddCapUnauthorized(int num) static int CapgetWithAllCap(int num) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); @@ -291,7 +291,7 @@ static int CapgetWithAllCap(int num) static int CapgetWithNoCap(int num) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); @@ -324,7 +324,7 @@ static int CapgetWithNoCap(int num) static int CapgetOnlySETPCAP(int num) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); @@ -401,7 +401,7 @@ static int CapsetWithoutSETPCAP() static int CapsetWithVersion(pid_t pid, unsigned int version) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); @@ -428,7 +428,7 @@ static int CapsetWithVersion(pid_t pid, unsigned int version) static int CapgetWithVersion(pid_t pid, unsigned int version) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); @@ -455,7 +455,7 @@ static int CapgetWithVersion(pid_t pid, unsigned int version) static int CapgetWithCaps(pid_t pid, unsigned int caps) { struct __user_cap_header_struct capheader = { 0 }; - error_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), + errno_t result = memset_s(&capheader, sizeof(struct __user_cap_header_struct), 0, sizeof(struct __user_cap_header_struct)); if (result != EOK) { LOG("CapgetWithAllCap memset_s failed"); -- GitLab