mirror of
https://gitee.com/openharmony/third_party_e2fsprogs
synced 2024-11-23 09:59:49 +00:00
commit
102c7c5dd9
@ -3,7 +3,7 @@ new file mode 100644
|
||||
index 00000000..422e0d52
|
||||
--- /dev/null
|
||||
+++ b/contrib/android/dac_config.cpp
|
||||
@@ -0,0 +1,240 @@
|
||||
@@ -0,0 +1,246 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
@ -29,6 +29,7 @@ index 00000000..422e0d52
|
||||
+#include <unordered_map>
|
||||
+#include <vector>
|
||||
+#include <linux/capability.h>
|
||||
+#include <limits.h>
|
||||
+
|
||||
+using namespace std;
|
||||
+
|
||||
@ -154,7 +155,12 @@ index 00000000..422e0d52
|
||||
+extern "C" {
|
||||
+ int LoadDacConfig(const char* fn)
|
||||
+ {
|
||||
+ ifstream readFile(fn);
|
||||
+ char resolvedPath[PATH_MAX] = {'\0'};
|
||||
+ char *canonicalPath = realpath(fn, resolvedPath);
|
||||
+ if (canonicalPath == nullptr) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ ifstream readFile(canonicalPath);
|
||||
+ if (readFile.fail()) {
|
||||
+ return -1;
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user