Re: [PATCH] mkswap: Add warnings for insecure device permissions/owners

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

 



On 19 Jan 2016 10:37, Wayne R. Roth wrote:
> +        permMask = S_ISBLK(ctl.devstat.st_mode) ? 07007 : 07077;
> +        if ((ctl.devstat.st_mode & permMask) != 0)
> +                warnx(_("%s: insecure permissions %04o, %04o suggested."),
> +                                ctl.devname, ctl.devstat.st_mode & 07777,
> +                                ~permMask & 0666);
> +        if (S_ISREG(ctl.devstat.st_mode) && ctl.devstat.st_uid != 0)
> +                warnx(_("%s: insecure file owner %d, 0 (root) suggested."),
> +                                ctl.devname, ctl.devstat.st_uid);

i haven't read/tested the code, so my assumptions might be off, but this
seems to complain even when creating files as non-root.  mkswap should
not do that.  a perfectly reasonable use case is to create images as a
non-root user for use with something like qemu.

maybe you want to add a getuid() check in there, or scuttle it altogether.
-mike

Attachment: signature.asc
Description: Digital signature


[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