Re: [BUG libselinux] Use nftw() instead of fts()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 1, 2016 at 3:17 PM, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:
> On 07/01/2016 04:53 AM, Thomas Petazzoni wrote:
>> The recent versions of libselinux use the fts() function in
>> src/selinux_restorecon.c. This function is BSD-only, and therefore not
>> available in the musl C library, and only available optionally in the
>> uClibc C library.
[...]
> selinux userspace has been using fts() since 2009 (commit
> cce17290670ed7e1803ca6da660225ac01931d0c), when policycoreutils/setfiles
> was converted from nftw() to fts().  libselinux usage is newer, but
> src/selinux_restorecon.c is essentially a library function version of
> setfiles.
>
> Not saying that it would be impossible to switch (back) to nftw(), but I
> guess we'd have to understand the cost/benefit tradeoff there.  If fts()
> isn't available or well supported, why hasn't this previously been an
> issue for policycoreutils/setfiles?

Do you know why the code was switched from nftw() to the fts-style
functions? The commit message doesn't really say so, instead focusing
on the compatibility and showing that there is no performance impact
associated with it.

I think the main benefit here would be to allow musl- and ucLibc
systems to use libselinux. I did a quick check to see if Android's
libselinux port had to work around it as well, but apparently bionic
uses the fts-style functions as well.

Wkr,
  Sven Vermeulen
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux