Mikhail Gusarov [Sat, 3 Oct 2009 19:42:08 +0000 (02:42 +0700)]
unshare: new command
New utility allows to run process with separate mount, UTC, IPC or
network namespaces.
[kzak@redhat.com: - some cosmetic changes in usage() and err() usage
- move "if BUILD_UNSHARE" to separate place in Makefile.am
- add unshare to .gitignore]
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Oct 2009 07:17:06 +0000 (09:17 +0200)]
libblkid: fix buffer usage in FAT prober
The blkid_probe_get_buffer() function returns buffer that could be
overwritten in the next blkid_probe_get_buffer() call. It means that
we have to save FAT super block to the temporary buffer if we want to
call blkid_probe_get_buffer() for directory entries or fsinfo.
Karel Zak [Thu, 1 Oct 2009 13:14:48 +0000 (15:14 +0200)]
libblkid: fix non-magic FAT detection
On Wed, Sep 30, 2009 at 03:15:41PM +0200, Lawrence Rust wrote:
> The problem is with shlibs/blkid/src/probers/vfat.c. At the end of
> this file the struct blkid_idinfo is declared with some magic
> search strings. In particular, 2 patterns are defined to match the
> single byte jmp/jxx opcodes at the start of a DOS boot sector.
> Because the partition was once formatted as a bootable DOS
> partition it matches these patterns and consequently the function
> probe_vfat is called. For these simple pattern matches the function
> probe_fat_nomagic is called to filter out false positives.
>
> In normal circumstances only MSDOS 2 and earlier floppies should be
> detected by this function. A very important feature of these disks
> is the boot signature - bytes 0x55, 0xaa at the end of the 1st
> sector which indicate to the BIOS that the disk is bootable. All
> MSDOS floppies have these bytes but the function probe_fat_nomagic
> doesn't check for them.
Note that the msdos/vfat superblock comments has been suggested by
Lawrence.
Reported-by: Lawrence Rust <lawrence@softsystem.co.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 29 Sep 2009 09:08:32 +0000 (11:08 +0200)]
libblkid: fix the default cache file path
The blkid_get_cache_filename() can returns BLKID_CONFIG_FILE instead
BLKID_CACHE_FILE. Yeah, pretty stupid typo.
Fortunately, this brown-paper-bag bug is invisible in almost all cases,
because the default path is returned by blkid_read_config(). The bug
can be visible only when blkid_read_config() returns NULL -- it means
on parses or malloc error.
Karel Zak [Fri, 25 Sep 2009 12:40:23 +0000 (14:40 +0200)]
libblkid: use fstatat(), improve readdir() usage
* fix possible memory leak in ubi_probe_all()
* use dirent->d_type if available (this is tricky, because d_type
is not supported on all systems and some filesystems returns
DT_UNKNOWN). The dirent->d_type allows to avoid unnecessary stat()
calls.
* use fstatat() if available -- allows to avoid malloc() and
sprintf("%s/%s", dirname, dirent->d_name)
Corentin Chary [Mon, 24 Aug 2009 11:11:54 +0000 (13:11 +0200)]
libblkid: add UBI volume support
Probe UBI volume under /dev (or /devfs, /devices).
ubi_ctrl skip is hardcoded, maybe we should find a
cleaner way to do that. Also change probe.c to handle
char devices.
[kzak@redhat.com: - rebase the patch to the current HEAD]
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 18 Aug 2009 11:33:27 +0000 (13:33 +0200)]
fallocate: new command
The fallocate(1) utility is used to preallocate blocks to a file.
This can be useful for virtual images, database files, testing, etc.
Normally we'd hope that various tools will start using preallocation
internally, but until then such a utility may be useful, and could be
scripted as well.
The original Eric's version is available at:
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2490
This version:
- checks for fallocate glibc function and kernel syscall
- does not provide a fallback and does not call posix_fallocate()
- adds long options
- uses err.h for errro messages
- adds NLS support
- cleanups man page
Co-Author: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
mount: document changed semantics of tmpfs size option in mount.8
Linux kernel commit 818db35992c249dc32c1d86daf7d533fb0952f5d fixed a
problem where invoking mount -t tmpfs with a size argument smaler than the
size of one page caused the limits on the size of a tmpfs to not operate.
The commit also caused the number supplied by the size option to be
rounded up to the nearest page size instead of down. This alters the man
page to match the behavior of the kernel in this instance.
Signed-off-by: Kevin Granade <kevin.granade@gmail.com>
Eric Sandeen [Thu, 17 Sep 2009 21:56:00 +0000 (16:56 -0500)]
libblkid: fix topology information values
Looks like the topology values returned are being
inflated by x 512, but the kernel reports them in bytes;
no need for the multiplication, just return the value as-is.
Karel Zak [Wed, 16 Sep 2009 14:17:41 +0000 (16:17 +0200)]
lib: add a generic crc32()
This is public domain implementation, based on static crc32_table[].
This implementation is used on may places (libparted, FreeBSD kernel,
PostgreSQL, ...). The Linux kernel uses on-the-fly generated and
allocated tables. That's useless in shared libraries.
Karel Zak [Tue, 15 Sep 2009 18:51:30 +0000 (20:51 +0200)]
libblkid: move filter macros to header file
* move blkid_bmp_* macros to blkidP.h
* add blkid_bmp_nbytes() -- returns size of bitmap in bytes
* add blkid_bmp_nwords() -- returns size of bitmap in words
(rename from blkid_bmp_size())