2008-01-03 Alexander Larsson <alexl@redhat.com>
+ * gfileinfo.h:
+ * glocalfileinfo.c:
+ Add define for selinux context attribute.
+ Fix missing : -> :: namespace separator change
+ Fix missing _ -> - name change for xattr-sys.
+ (#505058)
+
+2008-01-03 Alexander Larsson <alexl@redhat.com>
+
* fam/Makefile.am:
Link to libglib and libgobject directly (#504879)
Patch from Sebastien Bacher
/**
* G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
- *
- * A key in the "filesystem" namespace for checking if the file system is read only.
- * Is set to %TRUE if the file system is read only. Corresponding
- * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * * A key in the "filesystem" namespace for checking if the file system
+ * is read only. Is set to %TRUE if the file system is read only.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
**/
#define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
**/
#define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
+/**
+ * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
+ *
+ * A key in the "selinux" namespace for getting the file's SELinux
+ * context. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
+
GType g_file_info_get_type (void) G_GNUC_CONST;
GFileInfo * g_file_info_new (void);
#ifdef HAVE_SELINUX
char *context;
- if (!g_file_attribute_matcher_matches (attribute_matcher, "selinux::context"))
+ if (!g_file_attribute_matcher_matches (attribute_matcher, G_FILE_ATTRIBUTE_SELINUX_CONTEXT))
return;
if (is_selinux_enabled ())
if (context)
{
- g_file_info_set_attribute_string (info, "selinux::context", context);
- freecon(context);
+ g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, context);
+ freecon (context);
}
}
#endif
if (user)
all = g_file_attribute_matcher_enumerate_namespace (matcher, "xattr");
else
- all = g_file_attribute_matcher_enumerate_namespace (matcher, "xattr_sys");
+ all = g_file_attribute_matcher_enumerate_namespace (matcher, "xattr-sys");
if (all)
{
set_info_from_stat (info, &stat_buf, matcher);
#ifdef HAVE_SELINUX
- if (g_file_attribute_matcher_matches (matcher, "selinux:context") &&
+ if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_SELINUX_CONTEXT) &&
is_selinux_enabled ())
{
char *context;
if (fgetfilecon_raw (fd, &context) >= 0)
{
- g_file_info_set_attribute_string (info, "selinux:context", context);
- freecon(context);
+ g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, context);
+ freecon (context);
}
}
#endif