* policycoreutils diff
@ 2005-02-07 19:00 Daniel J Walsh
2005-02-07 19:43 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Walsh @ 2005-02-07 19:00 UTC (permalink / raw)
To: Stephen Smalley, SELinux
[-- 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]);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: policycoreutils diff
2005-02-07 19:00 policycoreutils diff Daniel J Walsh
@ 2005-02-07 19:43 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2005-02-07 19:43 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: SELinux
On Mon, 2005-02-07 at 14:00, Daniel J Walsh wrote:
> sestatus was going into infinite loops with booleans > 30 chars.
Thanks, merged as of policycoreutils 1.21.13.
--
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-07 19:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-07 19:00 policycoreutils diff Daniel J Walsh
2005-02-07 19:43 ` Stephen Smalley
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.