We care about /proc/device-tree/compatible content...
The patch also removes unnecessary path_exist(), it seems good enough
to call open() rather than access() + open().
Addresses: https://github.com/karelzak/util-linux/issues/218
Signed-off-by: Karel Zak <kzak@redhat.com>
configure should include errno.h instead of argp.h when
checking for presence of program_invocation_short_name
uclibc defines this to be const char* unlike util-linux-ng
which defines this to be char* so this error goes unnoticed
on glibc/eglibc systems.
here is the error it fixes
in file included from mountP.h:14:0,
from cache.c:29:
/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'
../../../include/c.h:118:14: note: previous declaration of '__progname' was here
make[3]: *** [cache.lo] Error 1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
This allows Sunday based week 54 be highlighted, and deny week 54 for
Monday based weeks when year has only 52 weeks.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Jan 1 is always First week, and year always has 53 weeks. The week 53
may be cut short, e.g., it may and often has fewer than 7 days. Every
year 28 year intervals US week numbering continues all the way to 54th
week, such as 1972, 2000, and 2028.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249486
Reported-by: Michal Toth
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Very long mount lines from the kernel (either from escaping or from giant
option lists) could exceed BUFSIZ, leading to parsing failures. This
adds a test for the condition.
Signed-off-by: Kees Cook <keescook@chromium.org>
Based on patch from Kees Cook, he wrote:
> The kernel's maximum path length is PATH_MAX (4096). The use of BUFSIZ
> (8192) would seem sufficient for reading mountinfo files, but it's
> not. Paths may contain escaped characters (requiring 4x as many bytes
> to read), and filesystem options are of unknown length. To avoid
> mounts being either intentionally or unintentionally hidden from
> libmount and its users, we must accept arbitrary length lines when
> parsing.
>
> Long valid entries are currently ignored, with warnings like this:
> mount: /proc/self/mountinfo: parse error: ignore entry at line 11.
> mount: /proc/self/mountinfo: parse error: ignore entry at line 12.
>
> Instead of using a malloc on every line parsed from mount files, do it
> once per mount file context, growing it as needed. The general case
> will never grow it.
I have moved the parser stuff to the new struct libmnt_parser, maybe
we can move more things (e.g. libmnt_table->fmt) to this struct later.
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
FALLOC_FL_KEEP_SIZE flag is generic and used in many situations,
"-n" in the error message does not make sense.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1146152
Signed-off-by: Karel Zak <kzak@redhat.com>
Build warning:
sys-utils/hwclock-cmos.c: In function 'i386_iopl':
sys-utils/hwclock-cmos.c:611:9: warning: implicit declaration of function 'iopl' [-Wimplicit-function-declaration]
return iopl(level);
^
sys-utils/hwclock-cmos.c:611:2: warning: nested extern declaration of 'iopl' [-Wnested-externs]
return iopl(level);
^
Also:
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes
Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034
Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html
Please note that this has never been (build-)tested, but should hopefully
resolve the warning.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Fixes the following warning:
sys-utils/hwclock.c: In function 'manipulate_epoch':
sys-utils/hwclock.c:1465:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (epoch_opt == -1)
Full build log available on:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034
Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html
Please note that this has never actually been (build-)tested on alpha,
but should hopefully resolve the warning. Note also that limits.h is
already included.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
sys-utils/zramctl.c: In function 'get_mm_stat':
sys-utils/zramctl.c:276:58: warning: declaration of 'inbytes' shadows a global declaration [-Wshadow]
static char *get_mm_stat(struct zram *z, size_t idx, int inbytes)
sys-utils/zramctl.c:119:39: note: shadowed declaration is here
static unsigned int raw, no_headings, inbytes;
libmount/src/tab.c: In function 'mnt_table_get_fs_root':
libmount/src/tab.c:1221:22: warning: declaration of 'fs' shadows a parameter [-Wshadow]
struct libmnt_fs *fs = mnt_table_find_mountpoint(tb,
libmount/src/tab.c:1197:24: note: shadowed declaration is here
struct libmnt_fs *fs,
disk-utils/fsck.minix.c: In function 'main':
disk-utils/fsck.minix.c:1364:17: warning: declaration of 'i' shadows a previous local [-Wshadow]
unsigned long i, free;
disk-utils/fsck.minix.c:1250:6: note: shadowed declaration is here
int i;
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The utils when compiled WITHOUT libuser then mkostemp()ing
"/etc/%s.XXXXXX" where the filename prefix is argv[0] basename.
An attacker could repeatedly execute the util with modified argv[0]
and after many many attempts mkostemp() may generate suffix which
makes sense. The result maybe temporary file with name like rc.status
ld.so.preload or krb5.keytab, etc.
Note that distros usually use libuser based ch{sh,fn} or stuff from
shadow-utils.
It's probably very minor security bug.
Addresses: CVE-2015-5224
Signed-off-by: Karel Zak <kzak@redhat.com>
Now it's necessary t use two mount(8) calls to create a read-only
mount:
mount /foo /bar -o bind
mount /bar -o remount,ro,bind
This patch allows to specify "bind,ro" and the remount is done
automatically by libmount by additional mount(2) syscall. It's not
atomic of course.
Signed-off-by: Karel Zak <kzak@redhat.com>