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