mnt_table_parse_dir in libmount/src/tab_parse.c calls
scandir, and then opendir. When the latter one, opendir is failed,
buffers allocated in scandir are not released.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This patch is based on my last patch:
[PATCH 1/2] scandirat based mnt_table_parse_dir implementation
scandir* used in `mnt_table_parse_dir in libmount/src/tab_parse.c
can take filter function as an argument.
`mnt_table_parse_dir' picks up fstab files from namelist returned from
scandir* for itself. However, some parts of picking-up job can be done
in the filter function.
This patch introduces a new function `mnt_table_parse_dir_filter' to
share the code for picking-up job between two implementations of
`mnt_table_parse_dir_filter', scandir based and scandirat based.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
In comment of `mnt_table_parse_dir' of libmount/src/tab_parse.c:
/* TODO: it would be nice to have a scandir() implementation that
* is able to use already opened directory */
Nowadays glibc provides `scandirat'. This patch implements `scandirat'
based `mnt_table_parse_dir'.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Note that old umount(8) uses 0 and 1 exit codes, and some
exceptions like 4 or 32.
The new umount(8) cleanups this mess and uses the same exit codes as
mount(8) (see mount(8) man page).
Signed-off-by: Karel Zak <kzak@redhat.com>
The optional argument for -s, --fstab options (--fstab=file) is not
backwardly compatible, because command line with short options (e.g.
findmnt -snr) will be interpreted incorrectly.
This patch removes support for the optional --fstab argument and
introduces a new option --tab-file, for example:
findmnt --fstab --tab-file=/etc/fstab.foo
Reported-by: Juergen Daubert <jue@jue.li>
Signed-off-by: Karel Zak <kzak@redhat.com>
flock.c:90:23: warning: argument to 'sizeof' in 'memset' call is the
same expression as the destination; did you mean to dereference it?
[-Wsizeof-pointer-memaccess]
memset(sa, 0, sizeof sa);
~~ ^~
Reported-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The script creates directory kernel.org/v<version>/, copy .xz tarball,
changelog, release notes and docs to the directory and sign all files by
gpg.
Signed-off-by: Karel Zak <kzak@redhat.com>