| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we use LOOP_CTL_GET_FREE ioctl to ask for free device, for example
losetup -f foo.img
Unfortunately, losetup(8) allows to ask for specified device
losetup /dev/loop100 foo.img
and in this case we assume that the device already exists in the
system. This is incorrect, we should be able to use loop-control
LOOP_CTL_ADD ioctl to ask for the specified device.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
References: https://bugs.archlinux.org/task/36189
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
.. after many many years it seems that we can follow libc code rather
than duplicate realpath(3) implementation.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
When this file was created, the standard license header was missed.
Add it using the same one from unshare.c.
The noreturn attribute is not needed since we include the header
which has it on the prototype.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c: don't interpret empty strings as relative paths
* libmount: more robust libmnt_table find function and debug messages
References: https://bugzilla.novell.com/show_bug.cgi?id=825150
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.
The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.
Addresses: https://bugs.archlinux.org/task/35193
Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
... to make the code easy to use in utils.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
... to implement --color[=<when>]
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I recently tried to mount an hfsplus file system from an image file with
a partition table by using the loop offset and sizelimit options to specify
the location of the file system.
hfsplus stores some metadata at a set offset from the end of the partition,
so it's sensitive to the device size reported by the kernel.
It worked with this:
But failed with this:
/dev/loop0: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000
/dev/loop1: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000
/proc/partitions shows the correct number of blocks to match the sizelimit.
But if I set a breakpoint in mount before the mount syscall, I could see:
102400000
102432768
The kernel loop driver will set the gendisk capacity of the device at
LOOP_SET_STATUS64 but won't sync it to the block device until one of two
conditions are met: All open file descriptors referring to the device are
closed (and it will sync when re-opened) or if the LOOP_SET_CAPACITY ioctl
is called to sync it. Since mount opens the device and passes it directly
to the mount syscall after LOOP_SET_STATUS64 without closing and reopening
it, the sizelimit argument is effectively ignroed. The capacity needs to
be synced immediately for it to work as expected.
This patch adds the LOOP_SET_CAPACITY call to loopctx_setup_device since
the device isn't yet released to the user, so it's safe to sync the capacity
immediately.
[kzak@redhat.com: - port to the current git HEAD,
- use uint64_t]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
* lib/mbsalign.c: s/GPLv3/LGPLv2+/
* include/mbsalign.h: s/GPLv2/LGPLv2+/
* README.licensing: Remove mention GPLv3 as it's not actually used.
|
|
|
|
|
|
|
|
| |
* colorize subsystem prefix
* colorize time
* colorize by keywords (now "segfault" only)
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| | |
* 'patch-1' of https://github.com/dtrebbien/util-linux:
Implement mempcpy() in terms of memcpy() if mempcpy() is unavailable
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
for example:
$ findmnt | cat
$ lslocks > foo
the output should not be truncated.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The behaviour mimics chroot.
Possibly it would have been nicer to to query the password database in
the new namepace and run the shell of the user there, but it's hard to
do correctly. getpwuid() might need to load nss plugins, and the arch
in the new namespace might be different (in case of NEWNS mounts), or
the hostname might be different, etc. So in general it's not possible
to do it reliably.
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
| |
| |
| |
| |
| |
| |
| | |
In current glibc versions, internal __secure_getenv
no longer exists and was replaced by secure_getenv()
Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
|
| |
| |
| |
| | |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|/
|
|
| |
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
|
|
|
|
|
| |
We use the code from include/ and lib/ on many places, so use public
domain if possible or LGPL for code copied from libs.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
- move struct chardata to include/ttyutils.h
- move console.{h,c} to login-utils/sulogin-* (it's sulogin specific)
- fix sulogin and agetty includes
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
... to make it usable for situations when the same backing
file is mapped to more loop devices.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# losetup -a /dev/loop0
/dev/loop0: [2053]:1048578 (/home/fs-images/filesystems/ext2.img)
# findmnt /dev/loop0
TARGET SOURCE FSTYPE OPTIONS
/mnt/test /dev/loop0 ext3 rw,relatime,data=ordered
old version:
./test_ismounted /home/fs-images/filesystems/ext2.img
not mounted
new version:
./test_ismounted /home/fs-images/filesystems/ext2.img
mounted on /mnt/test
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This is very usefull if initrd can not loaded that is no /dev and no
/proc is found. Also if the /etc/shadow and /etc/passwd is copied into
the initrd the sulogin can be used in initrd even before /dev and/or /proc
are mounted.
Signed-off-by: Werner Fink <werner@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
with this the double linked list feature from util-linux is used
instead of the single linked list.
[kzak@redhat.com: use list_last_entry() and list INIT macros]
Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
suid permisssions
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
... and to have names compatible with lib/sysfs.c
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
Well, now all tty stuff are incline functions in include/ttyutils.h.
It's seems more elegant to create regular lib/ttyutils.c for libcommon
and write test program.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
The current code goes immediately to the fallback section if any
detection method fails. It seems better to try another methods before
the fallback solution.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
- may be enabled by CONSOLES_DEBUG env. variable
Signed-off-by: Karel Zak <kzak@redhat.com>
|