Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559608 - fcaps.eclass: sys-libs/musl translates strerror(ENOTSUP) as "Not supported" instead of "Operation not supported"
Summary: fcaps.eclass: sys-libs/musl translates strerror(ENOTSUP) as "Not supported" i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-04 18:21 UTC by Anthony Basile
Modified: 2015-09-05 06:47 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2015-09-04 18:21:20 UTC
I question the wisdom of having IUSE=+filecaps on by default.  This is causing me problems building stage3's on systems that don't support caps and its not easy to switch out a kernel, ie on embedded systems boards.  Since these are stage3's I don't want to turn off the flag in stage3's /etc/portage/ nor do I want to turn it off in the profiles.

It might be prudent to add intelligence to fcaps.eclass to not fail if file caps are not supported, but just ewarn.  I'm willing to do the coding, but what do people think?

Here's an example.  Don't mind the -r99 its indentical to the -r2 except for some patches needed for musl.

 * Messages for package net-misc/iputils-20121221-r99:

 * FAILED postinst: 1
 * Setting caps 'cap_net_raw=ep' on file '/bin/arping' failed:
 * Failed to set capabilities on file `/bin/arping' (Not supported)
 * usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
 * 
 *  Note <filename> must be a regular (non-symlink) file.
 * ERROR: net-misc/iputils-20121221-r99::musl failed (postinst phase):
 *   could not set caps
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called pkg_postinst
 *   environment, line 2180:  Called fcaps 'cap_net_raw' 'bin/arping' 'bin/ping' 'bin/ping6' 'usr/bin/clockdiff'
 *   environment, line 1158:  Called die
 * The specific snippet of code:
 *                               die "could not set caps"
 * 


Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2015-09-04 18:23:16 UTC
oops i mean identical to -r1 not -r2.  minor point but just in case it causes confusion, i should clarify.
Comment 2 SpanKY gentoo-dev 2015-09-04 18:44:47 UTC
my guess is that musl does:
  strerror(ENOTSUP) == "Not supported"

instead of what other C libraries (and the documentation) state:
  strerror(ENOTSUP) == "Operation not supported"

if musl translated things that way, fcaps would do the right thing.
Comment 3 Felix Janda 2015-09-04 19:32:39 UTC
Indeed musl[1] uses "Not supported" as does POSIX[2].

[1]: http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n84
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
Comment 4 Anthony Basile gentoo-dev 2015-09-04 20:01:49 UTC
(In reply to SpanKY from comment #2)
> my guess is that musl does:
>   strerror(ENOTSUP) == "Not supported"
> 
> instead of what other C libraries (and the documentation) state:
>   strerror(ENOTSUP) == "Operation not supported"
> 
> if musl translated things that way, fcaps would do the right thing.

Sorry Mike, it would really have helped if I'd read fcaps.eclass before just assuming that it lacked intelligence :(

Anyhow, changing the line in the case statement to

    *"Operation not supported"*|*"Not supported"*)

fixes the problem, line 165.
Comment 5 SpanKY gentoo-dev 2015-09-05 00:16:32 UTC
does musl define ENOTSUP to EOPNOTSUPP ?  glibc does which means only one of ENOTSUP and EOPNOTSUPP must be picked, and glibc happens to use the translation for EOPNOTSUPP over ENOTSUPP.
Comment 7 Felix Janda 2015-09-05 06:47:28 UTC
Musl does define ENOTSUP to EOPNOTSUPP.

From reading online man pages, BSDs seem to do something similar to
glibc, while Mac OSX has ENOTSUP and EOPNOTSUPP separated and uses the
messages from POSIX (, which is "Operation not supported on socket" for
EOPNOTSUPP). bionic seems to use "Operation not supported on transport
endpoint".