2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file fs_label_manager.h
18 * @author Marcin Niesluchowski (m.niesluchow@samsung.com)
20 * @brief Class for environment operations on file system.
22 #ifndef _FS_LABEL_MANAGER_H_
23 #define _FS_LABEL_MANAGER_H_
26 #include <sys/smack.h>
31 FsLabelManager() = delete;
32 FsLabelManager(const std::string &path, const std::string &label);
33 FsLabelManager(const FsLabelManager &second) = delete;
34 FsLabelManager& operator=(FsLabelManager &second) = delete;
36 virtual ~FsLabelManager();
38 void createFile(const std::string &relativePath);
39 void createLink(const std::string &relativeLinkPath, const std::string &relativeRealPath);
41 void testSmackSetLabel(const std::string &relativePath,
43 enum smack_label_type labelType);
44 void testSmackLSetLabel(const std::string &relativePath,
46 enum smack_label_type labelType);
47 void testSmackFSetLabel(const std::string &relativePath,
49 enum smack_label_type labelType);
51 void testSmackGetLabel(const std::string &relativePath,
53 enum smack_label_type labelType);
54 void testSmackLGetLabel(const std::string &relativePath,
56 enum smack_label_type labelType);
57 void testSmackFGetLabel(const std::string &relativePath,
59 enum smack_label_type labelType);
61 void testSmackClearLabels(const std::string &relativePath);
64 void checkLabel(const std::string &path,
66 enum smack_label_type labelType);
67 void checkLinkLabel(const std::string &path,
69 enum smack_label_type labelType);
75 #endif // _FS_LABEL_MANAGER_H_