summaryrefslogtreecommitdiff
path: root/sed/sed.c
diff options
context:
space:
mode:
Diffstat (limited to 'sed/sed.c')
-rw-r--r--sed/sed.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sed/sed.c b/sed/sed.c
index e588c56..f75e4b6 100644
--- a/sed/sed.c
+++ b/sed/sed.c
@@ -1,5 +1,5 @@
/* GNU SED, a batch stream editor.
- Copyright (C) 1989-2018 Free Software Foundation, Inc.
+ Copyright (C) 1989-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,6 +29,7 @@
#include "progname.h"
#include "version.h"
#include "xalloc.h"
+#include <selinux/selinux.h>
#include "version-etc.h"
@@ -116,7 +117,6 @@ cancel_cleanup (void)
G_file_to_unlink = NULL;
}
-static void usage (int);
static void
contact (int errmsg)
{
@@ -130,6 +130,22 @@ General help using GNU software: <https://www.gnu.org/gethelp/>.\n"));
fprintf (out, _("E-mail bug reports to: <%s>.\n"), PACKAGE_BUGREPORT);
}
+static void
+selinux_support (void)
+{
+ putchar ('\n');
+#if HAVE_SELINUX_SELINUX_H
+ puts (_("This sed program was built with SELinux support."));
+ if (is_selinux_enabled ())
+ puts (_("SELinux is enabled on this system."));
+ else
+ puts (_("SELinux is disabled on this system."));
+#else
+ puts (_("This sed program was built without SELinux support."));
+#endif
+ putchar ('\n');
+}
+
_Noreturn static void
usage (int status)
{
@@ -344,6 +360,7 @@ main (int argc, char **argv)
case 'v':
version_etc (stdout, program_name, PACKAGE_NAME, Version,
AUTHORS, (char *) NULL);
+ selinux_support ();
contact (false);
ck_fclose (NULL);
exit (EXIT_SUCCESS);