1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
From 6a4234339518e8be293aacee4aeef6aaa38d7e69 Mon Sep 17 00:00:00 2001
From: "beiling.xie" <xiekunxun@huawei.com>
Date: Wed, 14 Sep 2022 00:12:20 +0800
Subject: [PATCH] support deviceauth for openeuler
Signed-off-by: beiling.xie <xiekunxun@huawei.com>
---
deps_adapter/BUILD.gn | 3 ++-
deps_adapter/os_adapter/interfaces/linux/hc_log.h | 8 ++++----
services/BUILD.gn | 2 +-
.../src/permission_adapter/permission_adapter.cpp | 11 +++++++----
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/deps_adapter/BUILD.gn b/deps_adapter/BUILD.gn
index 28df2d9..906b8ca 100644
--- a/deps_adapter/BUILD.gn
+++ b/deps_adapter/BUILD.gn
@@ -118,10 +118,11 @@ if (defined(ohos_lite)) {
cflags = [ "-DHILOG_ENABLE" ]
deps = [
"//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk",
- "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
+ "//depend:syspara",
"//third_party/cJSON:cjson_static",
"//third_party/openssl:libcrypto_static",
"//utils/native/base:utils",
+ "//third_party/bounds_checking_function:libsec_shared",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
}
diff --git a/deps_adapter/os_adapter/interfaces/linux/hc_log.h b/deps_adapter/os_adapter/interfaces/linux/hc_log.h
index 7cfd649..f881d1e 100644
--- a/deps_adapter/os_adapter/interfaces/linux/hc_log.h
+++ b/deps_adapter/os_adapter/interfaces/linux/hc_log.h
@@ -44,10 +44,10 @@ void DevAuthLogPrint(DevAuthLogLevel level, const char *funName, const char *fmt
#define LOGW(fmt, ...) (DevAuthLogPrint(DEV_AUTH_LOG_LEVEL_WARN, __FUNCTION__, fmt, ##__VA_ARGS__))
#define LOGE(fmt, ...) (DevAuthLogPrint(DEV_AUTH_LOG_LEVEL_ERROR, __FUNCTION__, fmt, ##__VA_ARGS__))
-#define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf)
-#define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf)
-#define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf)
-#define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf)
+#define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, LOG_DOMAIN, "[DEVAUTH]", "%s", buf)
+#define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, LOG_DOMAIN, "[DEVAUTH]", "%s", buf)
+#define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, LOG_DOMAIN, "[DEVAUTH]", "%s", buf)
+#define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, LOG_DOMAIN, "[DEVAUTH]", "%s", buf)
#else
diff --git a/services/BUILD.gn b/services/BUILD.gn
index bb15b89..b2cdb17 100644
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -159,10 +159,10 @@ if (defined(ohos_lite)) {
"${deps_adapter_path}:${hal_module_name}",
"//third_party/cJSON:cjson_static",
"//utils/native/base:utils",
+ "//foundation/communication/dsoftbus/sdk:softbus_client"
]
external_deps = [
- "dsoftbus_standard:softbus_client",
"hiviewdfx_hilog_native:libhilog",
]
if (support_jsapi) {
diff --git a/services/frameworks/src/permission_adapter/permission_adapter.cpp b/services/frameworks/src/permission_adapter/permission_adapter.cpp
index dcdb912..6f4f8a3 100644
--- a/services/frameworks/src/permission_adapter/permission_adapter.cpp
+++ b/services/frameworks/src/permission_adapter/permission_adapter.cpp
@@ -15,17 +15,18 @@
#include "permission_adapter.h"
-#include "accesstoken_kit.h"
+//#include "accesstoken_kit.h"
#include "ipc_skeleton.h"
#include "device_auth_defines.h"
#include "hc_log.h"
-using namespace OHOS;
-using namespace OHOS::Security::AccessToken;
+//using namespace OHOS;
+//using namespace OHOS::Security::AccessToken;
int32_t CheckPermission(void)
{
+#if 0
AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID();
ATokenTypeEnum tokenType = AccessTokenKit::GetTokenType(tokenId);
if (tokenType == TOKEN_NATIVE) {
@@ -45,4 +46,6 @@ int32_t CheckPermission(void)
LOGE("Invalid token type: %d", tokenType);
return HC_ERROR;
}
-}
\ No newline at end of file
+#endif
+ return HC_SUCCESS;
+}
--
2.25.1
|