* [patch] libselinux, setfiles: fix selabel option flag setting
@ 2007-09-18 18:20 Stephen Smalley
2007-09-18 19:45 ` Eamon Walsh
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Smalley @ 2007-09-18 18:20 UTC (permalink / raw)
To: Eamon Walsh; +Cc: selinux
Fix selabel option flag setting to eliminate a build error on 64-bit.
---
libselinux/src/matchpathcon.c | 4 ++--
policycoreutils/setfiles/setfiles.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
Index: trunk/libselinux/src/matchpathcon.c
===================================================================
--- trunk/libselinux/src/matchpathcon.c (revision 2562)
+++ trunk/libselinux/src/matchpathcon.c (working copy)
@@ -119,10 +119,10 @@
memset(options, 0, sizeof(options));
i = SELABEL_OPT_BASEONLY;
options[i].type = i;
- options[i].value = (char *)(flags & MATCHPATHCON_BASEONLY);
+ options[i].value = (flags & MATCHPATHCON_BASEONLY) ? (char*)1 : NULL;
i = SELABEL_OPT_VALIDATE;
options[i].type = i;
- options[i].value = (char *)(flags & MATCHPATHCON_VALIDATE);
+ options[i].value = (flags & MATCHPATHCON_VALIDATE) ? (char*)1 : NULL;
notrans = flags & MATCHPATHCON_NOTRANS;
}
Index: trunk/policycoreutils/setfiles/setfiles.c
===================================================================
--- trunk/policycoreutils/setfiles/setfiles.c (revision 2562)
+++ trunk/policycoreutils/setfiles/setfiles.c (working copy)
@@ -967,8 +967,8 @@
}
/* Load the file contexts configuration and check it. */
- opts[0].value = (char *)ctx_validate;
- opts[1].value = (char *)base_only;
+ opts[0].value = (ctx_validate ? (char*)1 : NULL);
+ opts[1].value = (base_only ? (char *)1 : NULL);
opts[2].value = altpath;
hnd = selabel_open(SELABEL_CTX_FILE, opts, 3);
--
Stephen Smalley
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
* Re: [patch] libselinux, setfiles: fix selabel option flag setting
2007-09-18 18:20 [patch] libselinux, setfiles: fix selabel option flag setting Stephen Smalley
@ 2007-09-18 19:45 ` Eamon Walsh
0 siblings, 0 replies; 2+ messages in thread
From: Eamon Walsh @ 2007-09-18 19:45 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux
Stephen Smalley wrote:
> Fix selabel option flag setting to eliminate a build error on 64-bit.
Looks good to me.
>
> ---
>
> libselinux/src/matchpathcon.c | 4 ++--
> policycoreutils/setfiles/setfiles.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> Index: trunk/libselinux/src/matchpathcon.c
> ===================================================================
> --- trunk/libselinux/src/matchpathcon.c (revision 2562)
> +++ trunk/libselinux/src/matchpathcon.c (working copy)
> @@ -119,10 +119,10 @@
> memset(options, 0, sizeof(options));
> i = SELABEL_OPT_BASEONLY;
> options[i].type = i;
> - options[i].value = (char *)(flags & MATCHPATHCON_BASEONLY);
> + options[i].value = (flags & MATCHPATHCON_BASEONLY) ? (char*)1 : NULL;
> i = SELABEL_OPT_VALIDATE;
> options[i].type = i;
> - options[i].value = (char *)(flags & MATCHPATHCON_VALIDATE);
> + options[i].value = (flags & MATCHPATHCON_VALIDATE) ? (char*)1 : NULL;
> notrans = flags & MATCHPATHCON_NOTRANS;
> }
>
> Index: trunk/policycoreutils/setfiles/setfiles.c
> ===================================================================
> --- trunk/policycoreutils/setfiles/setfiles.c (revision 2562)
> +++ trunk/policycoreutils/setfiles/setfiles.c (working copy)
> @@ -967,8 +967,8 @@
> }
>
> /* Load the file contexts configuration and check it. */
> - opts[0].value = (char *)ctx_validate;
> - opts[1].value = (char *)base_only;
> + opts[0].value = (ctx_validate ? (char*)1 : NULL);
> + opts[1].value = (base_only ? (char *)1 : NULL);
> opts[2].value = altpath;
>
> hnd = selabel_open(SELABEL_CTX_FILE, opts, 3);
>
>
--
Eamon Walsh <ewalsh@tycho.nsa.gov>
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:[~2007-09-18 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-18 18:20 [patch] libselinux, setfiles: fix selabel option flag setting Stephen Smalley
2007-09-18 19:45 ` Eamon Walsh
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.