Cleaned up udev-selinux patch
Luke Kenneth Casson Leighton
lkcl at lkcl.net
Thu Aug 26 22:59:28 UTC 2004
perhaps the style should be that the Makefile adds some code
add_selinux.c based on a configure-time option,
and that some #ifdefs in a header file call a function which
is a stub in the header if WITH_SELINUX is not defined.
bizarre_but_likely_quite_good_coding_style_never_encountered_before.h:
#ifdef WITH_SELINUX
int do_add_selinux_stuff(args) { return 0; }
#else
#define do_add_selinux_stuff the_real_add_selinux_stuff
#endif
and add_selinux.c contains:
int the_real_add_selinux_stuff(args)
{
....
return err;
}
On Thu, Aug 26, 2004 at 03:07:23PM -0400, Daniel J Walsh wrote:
> Greg KH wrote:
>
> >On Thu, Aug 26, 2004 at 01:41:03PM -0400, Daniel J Walsh wrote:
> >
> >
> >>Greg KH wrote:
> >>
> >>
> >>
> >>>On Thu, Aug 26, 2004 at 11:15:07AM -0400, Daniel J Walsh wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>This will create the security contexts on the fly.
> >>>>
> >>>>Please comment on what would be needed to get this acceptable?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Same things I said on the mailing list:
> >>> - fix coding style
> >>> - no ifdefs in .c files
> >>> - make the selinux stuff all be in its own file
> >>> - make the build flag look like the other build flags
> >>> - not make the makefile changes have silly line continuations
> >>> when not needed :)
> >>> - post the patch on the mailing list (linux-hotplug-devel) for
> >>> others to comment on after fixing the above.
> >>>
> >>>thanks,
> >>>
> >>>greg k-h
> >>>
> >>>
> >>>
> >>>
> >>Another pass at a cleaned up patch. This time attempting to folow Greg
> >>guidelines.
> >>
> >>
> >
> >Looks good. Do you really want it all in a .h file? I don't mind
> >having the selinux functions being in a .c file and building that if
> >USE_SELINUX is enabled.
> >
> >But it's your call, as you are the one going to have to live with the
> >code :)
> >
> >thanks,
> >
> >greg k-h
> >
> >
> I copied the way it was being done with logging.h
>
> I already have some updates from comments from other people.
>
> Dan
>
> --
> This message was distributed to subscribers of the selinux mailing list.
> If you no longer wish to subscribe, send mail to majordomo at tycho.nsa.gov
> with
> the words "unsubscribe selinux" without quotes as the message.
--
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love. If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net"> lkcl.net </a> <br />
<a href="mailto:lkcl at lkcl.net"> lkcl at lkcl.net </a> <br />
More information about the fedora-selinux-list
mailing list