mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
Set owner of /var/run/utmp to root:utmp
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
0.5 ()
|
||||
- finit-alt listens to /dev/initctl to work with reboot(8)
|
||||
- write runlevel to utmp, needed by Printerdrake (by Pascal Terjan)
|
||||
- fix ownership of /var/run/utmp (reported by Pascal Terjan)
|
||||
|
||||
O.4 (20080516)
|
||||
- default username for finit-alt configurable in Makefile
|
||||
|
||||
@@ -325,6 +325,8 @@ int main()
|
||||
}
|
||||
|
||||
touch("/var/run/utmp");
|
||||
chown("/var/run/utmp", 0, getgroup("utmp"));
|
||||
|
||||
#ifdef RUNLEVEL
|
||||
memset(&entry, 0, sizeof(struct utmp));
|
||||
entry.ut_type = RUN_LVL;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include <grp.h>
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
/*
|
||||
@@ -157,6 +159,16 @@ int run_parts(char *dir, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getgroup(char *s)
|
||||
{
|
||||
struct group *grp;
|
||||
|
||||
if ((grp = getgrnam(s)) == NULL)
|
||||
return -1;
|
||||
|
||||
return grp->gr_gid;
|
||||
}
|
||||
|
||||
/*
|
||||
* Other convenience functions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user