Set owner of /var/run/utmp to root:utmp

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka
2008-06-02 17:22:35 -03:00
parent ba9c897e83
commit 0fc7654a83
4 changed files with 16 additions and 0 deletions
+1
View File
@@ -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
+2
View File
@@ -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;
+12
View File
@@ -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
*/
+1
View File
@@ -5,6 +5,7 @@ int makepath (char *);
void ifconfig (char *, char *, char *, int);
void copyfile (char *, char *, int);
void chomp (char *);
int getgroup (char *);
#ifdef BUILTIN_RUNPARTS
int run_parts (char *, ...);