Bug 17719 - a mechanism for maintaining consistent intended relations between /etc/passwd and /etc/group
Summary: a mechanism for maintaining consistent intended relations between /etc/passwd...
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: rpm (show other bugs)
Version: unstable
Hardware: all Linux
: P2 enhancement
Assignee: placeholder@altlinux.org
QA Contact: qa-4.1@altlinux.org
URL:
Keywords:
Depends on:
Blocks: 17718
  Show dependency tree
 
Reported: 2008-10-29 01:14 MSK by Ivan Zakharyaschev
Modified: 2021-12-12 20:01 MSK (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2008-10-29 01:14:10 MSK
https://bugzilla.altlinux.org/show_bug.cgi?id=17718 suggests that the intended configuration of permissions for klogd be checked in a working system. The "configuration" is the relation between the dedicated user "klogd", his primary group (stored in /etc/passwd), the group named "klogd" (stored in /etc/groups) and the permissions on the working directory (/var/lib/klogd/...).

The situation reported in https://bugzilla.altlinux.org/show_bug.cgi?id=17250 was caused by a typo in /etc/passwd which had lead to an inconsistency between /etc/passwd and /etc/group.

This inconsistency could have been formally discovered. 

This feature request suggests there could be a general mechanism for this in the system (and it could be employed, say, on every startup of a service, or after the administrator edited something).

Now the intended configuration is expressed in an imperative way by the commands in the RPM preinstall script:

# rpm -q klogd --scripts 
preinstall scriptlet (through /bin/sh):
/usr/sbin/groupadd -r -f klogd
/usr/sbin/useradd -r -g klogd -d /dev/null -s /dev/null -n klogd >/dev/null 2>&1 ||:

but this intention could be installed as a declarative policy ("the primary gid of user klogd is the group with name klogd"). Then this policy could be checked any time.

(And such a check would discover my typo.)
Comment 1 Ivan Zakharyaschev 2008-10-29 01:35:05 MSK
A simplified approximation to such checks (on package upgrades): https://bugzilla.altlinux.org/show_bug.cgi?id=17720 .
Comment 2 Jeff Johnson 2012-01-02 19:52:24 MSK
tracked at https://bugs.launchpad.net/rpm/+bug/910889