summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/fileio.c b/src/fileio.c
index dc67a00ed2a..ff6720d4ae2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2812,7 +2812,8 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */)
(Lisp_Object filename)
{
Lisp_Object absname;
- Lisp_Object values[4];
+ Lisp_Object user = Qnil, role = Qnil, type = Qnil, range = Qnil;
+
Lisp_Object handler;
#if HAVE_LIBSELINUX
security_context_t con;
@@ -2830,10 +2831,6 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */)
absname = ENCODE_FILE (absname);
- values[0] = Qnil;
- values[1] = Qnil;
- values[2] = Qnil;
- values[3] = Qnil;
#if HAVE_LIBSELINUX
if (is_selinux_enabled ())
{
@@ -2842,20 +2839,20 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */)
{
context = context_new (con);
if (context_user_get (context))
- values[0] = build_string (context_user_get (context));
+ user = build_string (context_user_get (context));
if (context_role_get (context))
- values[1] = build_string (context_role_get (context));
+ role = build_string (context_role_get (context));
if (context_type_get (context))
- values[2] = build_string (context_type_get (context));
+ type = build_string (context_type_get (context));
if (context_range_get (context))
- values[3] = build_string (context_range_get (context));
+ range = build_string (context_range_get (context));
context_free (context);
freecon (con);
}
}
#endif
- return Flist (ARRAYELTS (values), values);
+ return list4 (user, role, type, range);
}
DEFUN ("set-file-selinux-context", Fset_file_selinux_context,