mirror of
https://github.com/troglobit/finit.git
synced 2026-11-28 20:58:24 +00:00
Fix #46: Set correct umask() before makedir() and chmod()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d2846b805a
commit
e03b358ff0
3 files changed
+12
No files matched your search
@@ -43,6 +43,8 @@ static void setup(void *UNUSED(arg))
|
|||||||
{
|
{
|
||||||
int gid;
|
int gid;
|
||||||
|
|
||||||
|
umask(0);
|
||||||
|
|
||||||
_d("Setting up FHS structure in /var ...");
|
_d("Setting up FHS structure in /var ...");
|
||||||
makedir("/var/cache", 0755);
|
makedir("/var/cache", 0755);
|
||||||
makedir("/var/games", 0755);
|
makedir("/var/games", 0755);
|
||||||
@@ -104,6 +106,8 @@ static void setup(void *UNUSED(arg))
|
|||||||
makedir("/var/run/sshd", 01755); /* OpenSSH */
|
makedir("/var/run/sshd", 01755); /* OpenSSH */
|
||||||
makefifo("/dev/xconsole", 0640); /* sysklogd */
|
makefifo("/dev/xconsole", 0640); /* sysklogd */
|
||||||
chown("/dev/xconsole", 0, getgroup("tty"));
|
chown("/dev/xconsole", 0, getgroup("tty"));
|
||||||
|
|
||||||
|
umask(022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static plugin_t plugin = {
|
static plugin_t plugin = {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
static void setup(void *UNUSED(arg))
|
static void setup(void *UNUSED(arg))
|
||||||
{
|
{
|
||||||
|
umask(0);
|
||||||
|
|
||||||
_d("Starting D-Bus ...");
|
_d("Starting D-Bus ...");
|
||||||
makedir("/var/run/dbus", 0755);
|
makedir("/var/run/dbus", 0755);
|
||||||
makedir("/var/lock/subsys", 0755);
|
makedir("/var/lock/subsys", 0755);
|
||||||
@@ -38,6 +40,8 @@ static void setup(void *UNUSED(arg))
|
|||||||
run("dbus-uuidgen --ensure");
|
run("dbus-uuidgen --ensure");
|
||||||
erase("/var/run/dbus/pid");
|
erase("/var/run/dbus/pid");
|
||||||
run_interactive("dbus-daemon --system", "Starting D-Bus");
|
run_interactive("dbus-daemon --system", "Starting D-Bus");
|
||||||
|
|
||||||
|
umask(022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static plugin_t plugin = {
|
static plugin_t plugin = {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ static void setup(void *UNUSED(arg))
|
|||||||
#endif
|
#endif
|
||||||
char line[LINE_SIZE];
|
char line[LINE_SIZE];
|
||||||
|
|
||||||
|
umask(0);
|
||||||
|
|
||||||
makedir("/var/run/console", 01777);
|
makedir("/var/run/console", 01777);
|
||||||
snprintf(line, sizeof(line), "/var/run/console/%s", username);
|
snprintf(line, sizeof(line), "/var/run/console/%s", username);
|
||||||
touch(line);
|
touch(line);
|
||||||
@@ -54,6 +56,8 @@ static void setup(void *UNUSED(arg))
|
|||||||
|
|
||||||
if (fexist("/sbin/restorecon"))
|
if (fexist("/sbin/restorecon"))
|
||||||
run("/sbin/restorecon /tmp/.ICE-unix /tmp/.X11-unix");
|
run("/sbin/restorecon /tmp/.ICE-unix /tmp/.X11-unix");
|
||||||
|
|
||||||
|
umask(022);
|
||||||
}
|
}
|
||||||
|
|
||||||
static plugin_t plugin = {
|
static plugin_t plugin = {
|
||||||
|
|||||||
Reference in new issue
Block a user