Re: [PATCH] libmount: Ensure utab.lock mode 644

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

 



On Tue, Apr 11, 2017 at 04:12:52PM +0200, Stanislav Brabec wrote:
> If utab.lock is created by a process with a restricted umask, utab.lock is
> created with restricted permissions. It breaks userspace monitor.
> 
> Ensure that the mode is always 644.
> 
> Signed-off-by: Stanislav Brabec <sbrabec@xxxxxxx>
> ---
>  libmount/src/lock.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libmount/src/lock.c b/libmount/src/lock.c
> index 06eff1344..f9d0253fb 100644
> --- a/libmount/src/lock.c
> +++ b/libmount/src/lock.c
> @@ -220,6 +220,11 @@ static int lock_simplelock(struct libmnt_lock *ml)
>  		rc = -errno;
>  		goto err;
>  	}
> +	rc = fchmod(ml->lockfile_fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
> +	if (rc < 0) {
> +		rc = -errno;
> +		goto err;
> +	}

Hmm... interesting issue. systemd?

Applied, thanks!

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux