Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different EPERM error string on Solaris #1504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sashan
Copy link
Contributor

@Sashan Sashan commented Aug 18, 2022

s/Operation not permitted/Insufficient privileges

s/Operation not permitted/Insufficient privileges
@Castaglia
Copy link
Member

And does the textual mapping of the EPERM errno value vary across different versions of Solaris?

@Sashan
Copy link
Contributor Author

Sashan commented Oct 3, 2022

And does the textual mapping of the EPERM errno value vary across different versions of Solaris?

very good question... So I did poke to history which is very interesting. Solaris uses Insufficient privileges since 2020. So this string mapping is relevant for 11.4 only. Before that the strerror() gave Not owner. People were unhappy about Not owner message because it was creating confusion. The change request was filed ~2008. Let me quote some interesting parts here:
Roger Faulkner:

This is something of a history and standards issue.
For a long time (since SVR4 came from New Jersey in 1989),
we have had EPERM mapping into "Not owner".
It's in the file:

usr/src/lib/libc/port/gen/errlist

It would be easy enough to change this from this:
1       Not owner
to this:
1       Operation not permitted.

to follow the SUSv3 standard's wording.  But would this be wise?
I'm assigning Lee Damico as the RE so she can investigate
and answer the question.

Peter Memishian follows with:

This goes back *a lot* further than SVR4 -- from the UNIX v7 source
tree (src/libc/gen/errlst.c), circa 1979:

  char    *sys_errlist[] = {
        "Error 0",
-->     "Not owner",
        "No such file or directory",
        "No such process",
        "Interrupted system call",

One would hope that no scripts out there are actually parsing this
output message (especially given internationalization), but after
29 years, we may discover otherwise.

As an aside, we've worked around this in various places in the past,
such as the Perror2() routine in ifconfig(1M):

        switch (error) {
        case ENXIO:
                (void) fprintf(stderr, "%s: no such interface\n", str);
                break;
-->     case EPERM:
-->             (void) fprintf(stderr, "%s: permission denied\n", str);
                break;
        case EEXIST:
                (void) fprintf(stderr, "%s: already exists\n", str);
                break;
        default:
                errno = error;
                perror(str);
        }

In 2020 Solaris has settled on using Insufficient privileges. I don't know details behind why Insufficient privileges was chosen over Operation not permitted. Before that change we could see at least two different error strings for EPERM: we could see Not owner for cases where strerror() was used or permission denied which came from ifconfig(8) There could be other components which were deliberately avoiding strerror().

The only thing which matters to proftpd is strerror(). So there is Insufficient privilegesfor Solaris 11.4. For older versions there isNot owner`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants