All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Mark the generated service file avaliable to be accessed
Date: Wed, 21 May 2014 10:13:52 +0200	[thread overview]
Message-ID: <537C6040.6060806@redhat.com> (raw)
In-Reply-To: <1400656906-14751-1-git-send-email-dmzhang@suse.com>

On 05/21/2014 09:21 AM, dongmao zhang wrote:
> 'journalctl -b' reports this:
> May 17 08:21:00 test systemd[1]: Configuration file
> /run/systemd/generator/lvm2-activation-early.service is marked
> world-inaccessible. This has no effect as configuration data is
> accessible via
> APIs without restrictions. Proceeding anyway.
> 
> So, set the mask to 022 for all the generators
> ---
>  scripts/lvm2_activation_generator_systemd_red_hat.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> 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");
> 

Applied. Thanks for the patch!

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e9db11f387086787fb1aad5a853990e9e6034ad5

-- 
Peter



      reply	other threads:[~2014-05-21  8:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  7:21 [PATCH] Mark the generated service file avaliable to be accessed dongmao zhang
2014-05-21  8:13 ` Peter Rajnoha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537C6040.6060806@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.