diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-10-15 03:37:56 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-10-15 03:37:56 +0000 |
commit | 154bbc462a9c1b5533a06afbac2b24abb17380af (patch) | |
tree | 557e9a99e953ab8b16acbb369411c922427cc418 | |
parent | 8caab423142a1f2527292d12d88efac8562364bd (diff) |
Bug 556334 – Warning when building without selinux support
2008-10-14 Matthias Clasen <mclasen@redhat.com>
Bug 556334 – Warning when building without selinux support
* glocalfileinfo.c: Avoid compiler warnings when selinux is
disabled. Patch by Pascal Terjan
svn path=/trunk/; revision=7601
-rw-r--r-- | gio/ChangeLog | 7 | ||||
-rw-r--r-- | gio/glocalfileinfo.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/gio/ChangeLog b/gio/ChangeLog index c655bbfb8..719e97df7 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,5 +1,12 @@ 2008-10-14 Matthias Clasen <mclasen@redhat.com> + Bug 556334 – Warning when building without selinux support + + * glocalfileinfo.c: Avoid compiler warnings when selinux is + disabled. Patch by Pascal Terjan + +2008-10-14 Matthias Clasen <mclasen@redhat.com> + Bug 556335 – make check fails in abicheck.sh * gio.symbols: Add g_file_attribute_info_list_get_type. diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 85cb2f10f..0c38e17c4 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -184,6 +184,7 @@ read_link (const gchar *full_name) #endif /* S_ISLNK */ +#ifdef HAVE_SELINUX /* Get the SELinux security context */ static void get_selinux_context (const char *path, @@ -191,7 +192,6 @@ get_selinux_context (const char *path, GFileAttributeMatcher *attribute_matcher, gboolean follow_symlinks) { -#ifdef HAVE_SELINUX char *context; if (!g_file_attribute_matcher_matches (attribute_matcher, G_FILE_ATTRIBUTE_SELINUX_CONTEXT)) @@ -216,8 +216,8 @@ get_selinux_context (const char *path, freecon (context); } } -#endif } +#endif #ifdef HAVE_XATTR @@ -1659,7 +1659,9 @@ _g_local_file_info_get (const char *basename, get_access_rights (attribute_matcher, info, path, &statbuf, parent_info); +#ifdef HAVE_SELINUX get_selinux_context (path, info, attribute_matcher, (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0); +#endif get_xattrs (path, TRUE, info, attribute_matcher, (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0); get_xattrs (path, FALSE, info, attribute_matcher, (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0); @@ -1785,6 +1787,7 @@ get_byte_string (const GFileAttributeValue *value, } #endif +#ifdef HAVE_SELINUX static gboolean get_string (const GFileAttributeValue *value, const char **val_out, @@ -1801,7 +1804,7 @@ get_string (const GFileAttributeValue *value, return TRUE; } - +#endif static gboolean set_unix_mode (char *filename, @@ -2047,6 +2050,7 @@ set_mtime_atime (char *filename, #endif +#ifdef HAVE_SELINUX static gboolean set_selinux_context (char *filename, const GFileAttributeValue *value, @@ -2064,7 +2068,6 @@ set_selinux_context (char *filename, return FALSE; } -#ifdef HAVE_SELINUX if (is_selinux_enabled ()) { security_context_t val_s; @@ -2086,10 +2089,10 @@ set_selinux_context (char *filename, _("SELinux is not enabled on this system")); return FALSE; } -#endif return TRUE; } +#endif gboolean |