Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 400837 - sys-apps/openrc-0.9.8.1 removes /etc/nologin on boot
Summary: sys-apps/openrc-0.9.8.1 removes /etc/nologin on boot
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Misc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 22:12 UTC by Petr Pisar
Modified: 2012-01-31 19:36 UTC (History)
1 user (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 Petr Pisar 2012-01-25 22:12:25 UTC
/etc/nologin is used to deny logging non-root users (e.g. when temporary locking the host due to a local vulnerability). sys-apps/openrc-0.9.8.1 contains following code in /etc/init.d/bootmisc:

start()
{
 ...
 [ -w /etc/nologin ] && rm -f /etc/nologin
}

That means the /etc/nologin may be removed on reboot and the host made accessible for regular users again. Provided default umask makes /etc/nologin writable, the /etc/nologin gets removed by default.

In my opinion, this is pretty bad idea and the line should get removed from /etc/init.d/bootmisc.
Comment 1 Tim Sammut (RETIRED) gentoo-dev 2012-01-26 04:29:46 UTC
@openrc, thoughts on this?
Comment 2 SpanKY gentoo-dev 2012-01-26 06:11:55 UTC
that has a bit of historical context ... baselayout used to have an option to manually set that file while booting up and then rm it later on (once the system had finished booting).

seems during the rewrite of openrc, the bigger picture was lost, and now the code indiscriminately punts the file.

http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=3ad501218d268f9884d84079f3e2de4ac0793147
Comment 3 Petr Pisar 2012-01-31 19:36:10 UTC
Thank you for quick fix in upstream.

However this issue still presents in latest stable portage version (sys-apps/openrc-0.9.8.4). Regarding the Gentoo Security notice, I think this bug report should keep opened until the fix reaches portage.