syslog-ng source
file-perms.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Balabit
3  * Copyright (c) 2012 Balazs Scheidler <bazsi@balabit.hu>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * As an additional exemption you are allowed to compile & link against the
20  * OpenSSL libraries as published by the OpenSSL project. See the file
21  * COPYING for details.
22  *
23  */
24 
25 #ifndef FILE_PERMS_H_INCLUDED
26 #define FILE_PERMS_H_INCLUDED
27 
28 #include "syslog-ng.h"
29 
30 typedef struct _FilePermOptions
31 {
32  gint file_uid;
33  gint file_gid;
34  gint file_perm;
35  gint dir_uid;
36  gint dir_gid;
37  gint dir_perm;
39 
40 void file_perm_options_set_file_uid(FilePermOptions *s, const gchar *file_uid);
42 void file_perm_options_set_file_gid(FilePermOptions *s, const gchar *file_gid);
44 void file_perm_options_set_file_perm(FilePermOptions *s, gint file_perm);
46 void file_perm_options_set_dir_uid(FilePermOptions *s, const gchar *dir_uid);
48 void file_perm_options_set_dir_gid(FilePermOptions *s, const gchar *dir_gid);
50 void file_perm_options_set_dir_perm(FilePermOptions *s, gint dir_perm);
52 
57 
58 gboolean file_perm_options_apply_file(const FilePermOptions *self, const gchar *name);
59 gboolean file_perm_options_apply_symlink(const FilePermOptions *self, const gchar *name);
60 gboolean file_perm_options_apply_dir(const FilePermOptions *self, const gchar *name);
61 gboolean file_perm_options_apply_fd(const FilePermOptions *self, gint fd);
62 gboolean file_perm_options_create_containing_directory(const FilePermOptions *self, const gchar *name);
63 
64 #endif
const gchar * name
Definition: debugger.c:265
void file_perm_options_set_file_gid(FilePermOptions *s, const gchar *file_gid)
Definition: file-perms.c:56
void file_perm_options_defaults(FilePermOptions *self)
Definition: file-perms.c:131
void file_perm_options_inherit_from(FilePermOptions *self, const FilePermOptions *from)
Definition: file-perms.c:149
void file_perm_options_dont_change_dir_perm(FilePermOptions *s)
Definition: file-perms.c:125
void file_perm_options_set_dir_perm(FilePermOptions *s, gint dir_perm)
Definition: file-perms.c:119
gboolean file_perm_options_apply_fd(const FilePermOptions *self, gint fd)
Definition: file-perms.c:228
void file_perm_options_dont_change_file_gid(FilePermOptions *s)
Definition: file-perms.c:67
void file_perm_options_dont_change_dir_gid(FilePermOptions *s)
Definition: file-perms.c:113
void file_perm_options_dont_change_file_uid(FilePermOptions *s)
Definition: file-perms.c:50
void file_perm_options_inherit_dont_change(FilePermOptions *self)
Definition: file-perms.c:166
gboolean file_perm_options_apply_symlink(const FilePermOptions *self, const gchar *name)
Definition: file-perms.c:198
void file_perm_options_set_file_uid(FilePermOptions *s, const gchar *file_uid)
Definition: file-perms.c:39
gboolean file_perm_options_create_containing_directory(const FilePermOptions *self, const gchar *name)
Definition: file-perms.c:252
void file_perm_options_dont_change_dir_uid(FilePermOptions *s)
Definition: file-perms.c:96
gboolean file_perm_options_apply_dir(const FilePermOptions *self, const gchar *name)
Definition: file-perms.c:212
void file_perm_options_set_file_perm(FilePermOptions *s, gint file_perm)
Definition: file-perms.c:73
void file_perm_options_dont_change_file_perm(FilePermOptions *s)
Definition: file-perms.c:79
void file_perm_options_set_dir_gid(FilePermOptions *s, const gchar *dir_gid)
Definition: file-perms.c:102
void file_perm_options_global_defaults(FilePermOptions *self)
Definition: file-perms.c:140
gboolean file_perm_options_apply_file(const FilePermOptions *self, const gchar *name)
Definition: file-perms.c:182
void file_perm_options_set_dir_uid(FilePermOptions *s, const gchar *dir_uid)
Definition: file-perms.c:85
Definition: file-perms.h:31
gint dir_uid
Definition: file-perms.h:35
gint file_uid
Definition: file-perms.h:32
gint dir_perm
Definition: file-perms.h:37
gint file_gid
Definition: file-perms.h:33
gint file_perm
Definition: file-perms.h:34
gint dir_gid
Definition: file-perms.h:36