4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
11 * Nikita Kalyazin <n.kalyazin@samsung.com>
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
27 * - Samsung RnD Institute Russia
32 #include <sys/smack.h>
33 #include <attr/xattr.h>
36 #define SELF_LABEL_FILE "/proc/self/attr/current"
37 #define SMACK_LABEL_LEN 255
39 void fd_setup_attributes(int fd)
41 fsetxattr(fd, "security.SMACK64IPIN", "*", 1, 0);
42 fsetxattr(fd, "security.SMACK64IPOUT", "*", 1, 0);
45 void set_label_for_all(const char *path)
47 smack_lsetlabel(path, "*", SMACK_LABEL_ACCESS);