Bug 1395717 - Cannot run /usr/libexec/news/innd as non-root user because innd segfaults
Summary: Cannot run /usr/libexec/news/innd as non-root user because innd segfaults
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: inn
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dominik 'Rathann' Mierzejewski
QA Contact: Fedora Extras Quality Assurance
URL: https://lists.isc.org/pipermail/inn-w...
Whiteboard:
: 1416951 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-16 13:54 UTC by Petr Pisar
Modified: 2017-02-07 00:53 UTC (History)
3 users (show)

Fixed In Version: inn-2.6.1-3.fc25 inn-2.6.1-3.fc24
Clone Of:
Environment:
Last Closed: 2017-02-07 00:24:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2016-11-16 13:54:45 UTC
I need run inn as a normal user to test an NNTP client. I have my own directory with configuration, spool, database, logs etc.

If I start

$ INNCONF=/tmp/t/etc/inn.conf /usr/libexec/news/innd -d

from inn-2.6.0-4.fc25.x86_64, it segfaults in newsuser.c:98:

ensure_news_grp(bool may_setgid)
{
    gid_t gid;

    get_news_uid_gid(false, &gid, true);
    if (may_setgid && geteuid() == 0) {
        if (setgid(gid) < 0) {
            sysdie("failed to setgid");
        }
    }
    if (getegid() != gid || getgid() != gid) {
→       die ("must be run as %s group", innconf->runasgroup);
    }
}


It crashes because innconf variable is NULL and this is because innd calls ensure_news_grp() via ensure_news_user_grp() before reading a configuration with innconf_read() in main().

The issue is that the target user and group is defined in the configuration file. The get_news_uid_gid() default to hard-coded "news" group if configuration is not yet loaded.

Would it be possible to modify innd so that it first reads condfiguration, and then it tries to change UID and GID?

Comment 1 Dominik 'Rathann' Mierzejewski 2017-01-26 22:22:14 UTC
*** Bug 1416951 has been marked as a duplicate of this bug. ***

Comment 2 Dominik 'Rathann' Mierzejewski 2017-01-26 22:23:18 UTC
Sorry for the long delay. I managed to reproduce and reported upstream. Thanks.

Comment 3 Dominik 'Rathann' Mierzejewski 2017-01-27 11:44:39 UTC
This is fixed in 2.6.1 (currently in rawhide). I'll build 2.6.1 for stable releases soon.

Comment 4 Fedora Update System 2017-01-28 22:44:16 UTC
inn-2.6.1-3.fc24 inn-2.6.1-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0a04196fd1

Comment 5 Fedora Update System 2017-01-28 22:46:41 UTC
inn-2.6.1-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-61f63409ea

Comment 6 Fedora Update System 2017-01-29 23:18:00 UTC
inn-2.6.1-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-0a04196fd1

Comment 7 Fedora Update System 2017-01-29 23:50:12 UTC
inn-2.6.1-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-61f63409ea

Comment 8 Fedora Update System 2017-02-07 00:24:23 UTC
inn-2.6.1-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2017-02-07 00:53:29 UTC
inn-2.6.1-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.