From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>, SELinux <SELinux@tycho.nsa.gov>
Subject: policycoreutils diff
Date: Mon, 07 Feb 2005 14:00:07 -0500 [thread overview]
Message-ID: <4207BAB7.3060406@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 70 bytes --]
sestatus was going into infinite loops with booleans > 30 chars.
Dan
[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 2094 bytes --]
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.21.12/scripts/fixfiles
--- nsapolicycoreutils/scripts/fixfiles 2005-02-02 17:20:59.000000000 -0500
+++ policycoreutils-1.21.12/scripts/fixfiles 2005-02-02 17:23:48.000000000 -0500
@@ -67,8 +67,8 @@
-e 's|\?.*|*|g' \
-e 's|\(.*|*|g' \
-e 's|\[.*|*|g' \
- -e 's|\.\*|*|g' \
- -e 's|\.\+|*|g' | \
+ -e 's|\.\*.*|*|g' \
+ -e 's|\.\+.*|*|g' | \
sort -d -u | \
while read pattern ; \
do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
@@ -79,7 +79,7 @@
fi; \
done | \
while read pattern ; do find $pattern -maxdepth 0 -print; done 2> /dev/null | \
- ${RESTORECON} -R $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f -
+ ${RESTORECON} -R $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f -
rm -f ${TEMPFILE}
fi
}
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/sestatus/sestatus.c policycoreutils-1.21.12/sestatus/sestatus.c
--- nsapolicycoreutils/sestatus/sestatus.c 2004-11-03 15:29:44.000000000 -0500
+++ policycoreutils-1.21.12/sestatus/sestatus.c 2005-02-07 13:55:06.000000000 -0500
@@ -30,7 +30,7 @@
#define BUFSIZE 255
/* column to put the output (must be a multiple of 8) */
-#define COL 32
+static int COL=32;
extern char *selinux_mnt;
@@ -152,15 +152,10 @@
}
void printf_tab(const char *outp) {
- /* print then add appropriate number of tabs */
- int i, count;
+ char buf[20];
+ snprintf(buf, sizeof(buf), "%%-%ds", COL);
+ printf(buf, outp);
- printf("%s",outp);
-
- /* insert the right number of tabs */
- count=((COL - strlen(outp) -1) / 8);
- for( i=0 ; i<count ; i++ )
- printf("\t");
}
int main(int argc, char **argv) {
@@ -276,6 +271,10 @@
printf("\nPolicy booleans:\n");
for( i=0 ; i<nbool ; i++ ) {
+ if (strlen(bools[i]) + 1 > COL)
+ COL=strlen(bools[i])+1;
+ }
+ for( i=0 ; i<nbool ; i++ ) {
printf_tab(bools[i]);
rc=security_get_boolean_active(bools[i]);
next reply other threads:[~2005-02-07 19:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-07 19:00 Daniel J Walsh [this message]
2005-02-07 19:43 ` policycoreutils diff Stephen Smalley
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=4207BAB7.3060406@redhat.com \
--to=dwalsh@redhat.com \
--cc=SELinux@tycho.nsa.gov \
--cc=sds@epoch.ncsc.mil \
/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.