mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
test-tool: Display SELinux status in output of libguestfs-test-tool.
This commit is contained in:
@@ -29,6 +29,7 @@ libguestfs_test_tool_CFLAGS = \
|
||||
-DGUESTFS_WARN_DEPRECATED=1 \
|
||||
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
$(GPROF_CFLAGS) $(GCOV_CFLAGS)
|
||||
libguestfs_test_tool_LDADD = \
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <guestfs.h>
|
||||
#include "guestfs-internal-frontend.h"
|
||||
|
||||
#include "ignore-value.h"
|
||||
|
||||
#ifndef P_tmpdir
|
||||
#define P_tmpdir "/tmp"
|
||||
#endif
|
||||
@@ -211,6 +213,13 @@ main (int argc, char *argv[])
|
||||
if (p)
|
||||
printf ("PATH=%s\n", p);
|
||||
|
||||
/* Print SELinux mode (don't worry if this fails, or if the command
|
||||
* doesn't even exist).
|
||||
*/
|
||||
printf ("SELinux: ");
|
||||
fflush (stdout); /* because getenforce prints output on stderr :-( */
|
||||
ignore_value (system ("getenforce"));
|
||||
|
||||
/* Configure the handle. */
|
||||
if (guestfs_add_drive_opts (g, tmpf,
|
||||
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
||||
|
||||
Reference in New Issue
Block a user