[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] master - systemd: use umask 022 for generated systemd units by lvm2-activation-generator



Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e9db11f387086787fb1aad5a853990e9e6034ad5
Commit:        e9db11f387086787fb1aad5a853990e9e6034ad5
Parent:        7d7c1f2025e73e729e53ddb9e09ce8097b532797
Author:        Dongmao Zhang <dmzhang suse com>
AuthorDate:    Wed May 21 10:10:24 2014 +0200
Committer:     Peter Rajnoha <prajnoha redhat com>
CommitterDate: Wed May 21 10:12:02 2014 +0200

systemd: use umask 022 for generated systemd units by lvm2-activation-generator

---
 WHATS_NEW                                          |    1 +
 .../lvm2_activation_generator_systemd_red_hat.c    |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index 86ed3bc..7f50eb1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.107 - 
 ==================================
+  Use proper umask for systemd units generated by lvm2-activation-generator.
   Check for failing mirror_remove_missing() function.
   Prompt before converting volumes to thin pool and thin pool metadata.
   Add dumpconfig --type profilable-{metadata,command} to select profile type.
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index e39f901..6a003f5 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -170,6 +170,7 @@ int main(int argc, char *argv[])
 {
 	const char *dir;
 	int r = EXIT_SUCCESS;
+	mode_t old_mask;
 
 	kmsg_fd = open(KMSG_DEV_PATH, O_WRONLY|O_NOCTTY);
 
@@ -184,10 +185,13 @@ int main(int argc, char *argv[])
 
 	dir = argv[1];
 
+	/* mark lvm2-activation.*.service as world-accessible */
+	old_mask = umask(0022);
 	if (!generate_unit(dir, UNIT_EARLY) ||
 	    !generate_unit(dir, UNIT_MAIN) ||
 	    !generate_unit(dir, UNIT_NET))
 		r = EXIT_FAILURE;
+	umask(old_mask);
 out:
 	if (r)
 		kmsg(LOG_ERR, "LVM: Activation generator failed.\n");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]