selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Duplicate hashtab code in libsepol vs. policycoreutils/newrole?
@ 2020-02-15 17:32 Ondrej Mosnacek
  2020-02-18 13:49 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Mosnacek @ 2020-02-15 17:32 UTC (permalink / raw)
  To: SElinux list
  Cc: Stephen Smalley, James Carter, Nicolas Iooss, Jason Zaman,
	Petr Lautrbach

Hello everyone,

I noticed that there is a duplicate hashtab.[hc] code from libsepol in
policycoreutils/newrole. Can this be deduplicated somehow? I can think
of three options:
1. link to libsepol (a bit unsafe, since hashtab symbols are not
versioned, but other programs already use non-versioned symbols form
libsepol anyway...),
2. statically link with libsepol's hashtab.o (libsepol code would be
needed in ../../libsepol to build newrole)
3. turn the newrole files into symlinks that link to libsepol ones
(similar issue as above, the symlinks would have to be substituted for
actual files when creating release archive).

If we really can't get rid of the duplicity, what should be the policy
for updating the hashtab code? Should the same changes be done
simultaneously to both copies? Or should we change only libsepol and
treat the newrole copy as mostly frozen legacy code?

The thing is, I'd like to make some small changes in them, but I'm not
sure how to handle the duplicity.

Thanks!

-- 
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Duplicate hashtab code in libsepol vs. policycoreutils/newrole?
  2020-02-15 17:32 Duplicate hashtab code in libsepol vs. policycoreutils/newrole? Ondrej Mosnacek
@ 2020-02-18 13:49 ` Stephen Smalley
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2020-02-18 13:49 UTC (permalink / raw)
  To: Ondrej Mosnacek, SElinux list
  Cc: James Carter, Nicolas Iooss, Jason Zaman, Petr Lautrbach

On 2/15/20 12:32 PM, Ondrej Mosnacek wrote:
> Hello everyone,
> 
> I noticed that there is a duplicate hashtab.[hc] code from libsepol in
> policycoreutils/newrole. Can this be deduplicated somehow? I can think
> of three options:
> 1. link to libsepol (a bit unsafe, since hashtab symbols are not
> versioned, but other programs already use non-versioned symbols form
> libsepol anyway...),
> 2. statically link with libsepol's hashtab.o (libsepol code would be
> needed in ../../libsepol to build newrole)
> 3. turn the newrole files into symlinks that link to libsepol ones
> (similar issue as above, the symlinks would have to be substituted for
> actual files when creating release archive).

I'd say none of the above. Nothing should be using a non-versioned 
symbol from libsepol unless it is statically linking libsepol, and we 
don't want to grow the set of users of the static libsepol (if anything 
we want to shrink that set).  We also don't want to create extraneous 
dependencies.

> If we really can't get rid of the duplicity, what should be the policy
> for updating the hashtab code? Should the same changes be done
> simultaneously to both copies? Or should we change only libsepol and
> treat the newrole copy as mostly frozen legacy code?

I'd say the latter - ignore the newrole hashtab.[ch] copy unless/until 
you have a real reason that it requires an update for newrole's sake. 
Treat it as a fork (which it is).

> The thing is, I'd like to make some small changes in them, but I'm not
> sure how to handle the duplicity.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-18 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15 17:32 Duplicate hashtab code in libsepol vs. policycoreutils/newrole? Ondrej Mosnacek
2020-02-18 13:49 ` Stephen Smalley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).