All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Zaman <jason@perfinion.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 4/5] restorecond: Musl compatibility for GLOB_BRACE and GLOB_TILDE
Date: Thu, 17 May 2018 13:11:16 +0800	[thread overview]
Message-ID: <20180517051117.48454-5-jason@perfinion.com> (raw)
In-Reply-To: <20180517051117.48454-1-jason@perfinion.com>

musl doesn't implement GLOB_BRACE and GLOB_TILDE, so simply don't use
them there. This affects restorecond -u but braces are not used in the
example configs. GLOB_TILDE is on the roadmap[1] for musl 1.1.21 so
restorecond -u should be fine soon.

[1]: https://wiki.musl-libc.org/roadmap.html

Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 restorecond/restore.c | 13 ++++++++-----
 restorecond/watch.c   |  8 ++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/restorecond/restore.c b/restorecond/restore.c
index cf04e962..f6e30001 100644
--- a/restorecond/restore.c
+++ b/restorecond/restore.c
@@ -1,11 +1,14 @@
-/*
- * Note that the restorecond(8) service build links with these functions.
- * Therefore any changes here should also be tested against that utility.
- */
-
 #include "restore.h"
 #include <glob.h>
 
+#ifndef GLOB_TILDE
+#define GLOB_TILDE 0
+#endif
+
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
 char **exclude_list;
 int exclude_count;
 
diff --git a/restorecond/watch.c b/restorecond/watch.c
index 691df824..98ff797b 100644
--- a/restorecond/watch.c
+++ b/restorecond/watch.c
@@ -20,6 +20,14 @@
 #include "stringslist.h"
 #include "utmpwatcher.h"
 
+#ifndef GLOB_TILDE
+#define GLOB_TILDE 0
+#endif
+
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
 /* size of the event structure, not counting name */
 #define EVENT_SIZE  (sizeof (struct inotify_event))
 /* reasonable guess as to size of 1024 events */
-- 
2.16.1

  parent reply	other threads:[~2018-05-17  5:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  5:11 SELinux musl support Jason Zaman
2018-05-17  5:11 ` [PATCH 1/5] sestatus: include limits.h for PATH_MAX Jason Zaman
2018-05-17  5:11 ` [PATCH 2/5] libselinux: enable linking to musl-fts Jason Zaman
2018-05-17  5:11 ` [PATCH 3/5] setfiles: Musl compatibility for GLOB_BRACE and GLOB_TILDE Jason Zaman
2018-05-17  5:11 ` Jason Zaman [this message]
2018-05-17  5:11 ` [PATCH 5/5] genhomedircon: sysconf can return -1 without failure Jason Zaman
2018-05-17 19:22 ` SELinux musl support Nicolas Iooss
2018-05-18  5:03   ` Jason Zaman
2018-05-18 12:58     ` Stephen Smalley
2018-05-18 15:58       ` Jason Zaman
2018-05-21  9:41         ` Jason Zaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180517051117.48454-5-jason@perfinion.com \
    --to=jason@perfinion.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.