Commit Graph

9837 Commits

Author SHA1 Message Date
Sami Kerola 86a9f3dad5 fsck.minix: add minix v3 support
Relates-to: a2657ae3ff
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:16 +02:00
Sami Kerola e1df9d4cd6 fsck.minix: rename device file descriptor variable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:16 +02:00
Sami Kerola ed7f9c5d96 mkfs.minix: refactor root block content creation
This does not belong to main() function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:15 +02:00
Sami Kerola a232cfdc0a mkfs.minix: check requested blocks will not exceed available on device
Earlier user could define more blocks than device, or backing file for
loopback file system, had available.  That lead to a system crash with
following commands;

fallocate --length 64KiB test-file
mkfs.minix -3 -i 842160 test-file 104882174
mkdir test-file.d
mount test-file test-file.d
cp /etc/service test-file.d
Killed
sudo umount test-file.d

The minix driver should probably not hang the whole kernel, but the least
that mkfs.minix ought to do is not to let users to get that condition
quite as easily.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:15 +02:00
Sami Kerola 2159dbf365 mkfs.minix: check user input carefully
File name lenght and version input needs to be checked against each
other, which will determine what version of file system is in question.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:14 +02:00
Sami Kerola 77799d7c38 mkfs.minix: add fs_control structure, and remove most global variables
This allows better code structure in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:14 +02:00
Sami Kerola 3bb74a3ada mkfs.minix: remove unuseful code
Checks about inodes vs block sizes does not add much robustness.  Both
values are derived at compilation time from struct minix_inode size, and
they form full definition circle.

Bad block check for none-block devices should not be supressed, user
requested it so let him have it.

Check for st_rdev == 0x0300 || st_rdev == 0x0340 was unreachable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:13 +02:00
Sami Kerola c99128bcf5 mkfs.minix: use is_mounted() from libcommon
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:13 +02:00
Sami Kerola b59c5925ce mkfs.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:12 +02:00
Joshua Hudson da41ff553a mkfs.minix: increase maximum minix v2 and v3 file system sizes
mkfs.minix misbehaves when attempting to create a large v2 or v3
filesystem.  I finally traced it down to attempting to create too many
inodes so that the first zone is past 65535 blocks in.  This obviously
doesn't work as the on-disk superblock says this is a 16 bit integer.

I wrote a patch that catches this, clamps to the absolute v2/v3 limit
(like it already does for v1), and sets the blocks per inode to a more
reasonable ratio when exceeding half a gigabyte.  Having a half-gig
filesystem with most files being smaller than 3k isn't really reasonable.

I suppose if you don't want to adjust inode sizes automatically you could
take that part out, and it will just crab sooner.

Given the non-attention in the code, I suspect nobody ever had cause to
try such a big minix filesystem.  Well I have my reasons involving some
deeply embedded work where ext2 would place too much strain on the
hardware.

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Joshua Hudson <joshudson@gmail.com>
2015-07-30 11:39:12 +02:00
Karel Zak 6b9784b442 libmount: make mnt_get_filesystems() more robust [clang analyze]
The mnt_free_filesystems() relies on NULL as the last item in the
filesystems array. It's necessary to keep NULL there after failed
strdup() too, because we call mnt_free_filesystems() to deallocate
after error.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 09:28:19 +02:00
Karel Zak d8461c4e4d lsipc: cleanup {user,group}name usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 09:18:33 +02:00
Karel Zak dd8dac1914 mcookie: fix -f usage [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:59:56 +02:00
Karel Zak fdd68e25b5 libsmartcols: make child-parent reference more robust [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:44:27 +02:00
Karel Zak a172badb03 hwclock: make static analyzes more happy
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:20:06 +02:00
Karel Zak 129fe4f31b libfdisk: result of operation is garbage or undefined [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:04:17 +02:00
Karel Zak 30ca5e70ce libfdisk: undefined or garbage value returned to caller [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 14:01:40 +02:00
Karel Zak 4df892812b fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:59:19 +02:00
Karel Zak e5161deefb fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:57:28 +02:00
Karel Zak 9380fbefa6 lsipc: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:54:54 +02:00
Karel Zak f45f5c83f9 fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:51:05 +02:00
David Prévot 9bf0b51820 po: update fr.po (from translationproject.org) 2015-07-29 13:42:01 +02:00
Joe Hansen 5d1756fb4f po: update da.po (from translationproject.org) 2015-07-29 13:42:01 +02:00
Karel Zak ca155f53c3 unshare: remove duplicate [make checkincludes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 12:58:06 +02:00
Karel Zak f686b9980a lslogins: remove duplicate [make checkincludes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 12:57:22 +02:00
Karel Zak 462a570340 libmount: sort pseudo filesystems by LC_COLLATE=C
Addresses: https://github.com/karelzak/util-linux/issues/212
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 12:43:45 +02:00
Karel Zak fa9ccce2d4 tasts: add logger octet counting test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 10:41:50 +02:00
Alex Bligh b6b67955ef logger: Add support to logger for RFC6587 octet counting
This patch adds support to logger for RFC6587 octet counting.
RFC6587 provides support for two sorts of framing:

1. Octet counting (at RFC6587 s3.4.1)

   In essence each frame is preceded by a decimal length and a
   space.

2. Non-transparent framing (at RFC6587 s3.4.2), also called
   'octet stuffing'

   In essence each frame is terminated by a `\n`

Prior to this patch, logger used option 2 (non-transparent framing)
on TCP, and used no framing on UDP. After this patch, the default
behaviour is unchanged, but if the '--octet-count' option is supplied,
option 1 is used for both TCP and UDP. Arguably octet count framing
makes little sense on UDP, but some servers provide it and this
allows testing of those servers.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
2015-07-29 10:33:25 +02:00
Karel Zak 8abdb91211 sfdisk: add --list-free
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 15:54:07 +02:00
Karel Zak 0efd951c80 fdisk: add 'F' command to list free unpartitioned space
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 15:53:42 +02:00
Karel Zak 8eb0ce3702 Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux 2015-07-28 12:15:56 +02:00
Ruediger Meier bd84241de3 Revert "tests: start script/race test only when --force specified"
This reverts commit 8ba3f35e07.

This test is not too slow anymore and BTW since last script refactoring
it does work now even on slow/heavy-loaded systems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-07-28 11:54:53 +02:00
Karel Zak 5860c45eed script: improve SIG{TERM,QUIT,KILL} sensitivity
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 10:36:29 +02:00
Karel Zak 1b2e9dd01d cfdisk: don't print obsolete CHS addresses
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:49:14 +02:00
Karel Zak ed99eac0e2 cfdisk: make sure that output fits to terminal width
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:29:37 +02:00
Karel Zak 5627fcec0e libsmartcols: reduce relative columns more aggressively
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 14:29:38 +02:00
Karel Zak 053939a45a fdisk: init libsmartcols debug
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 13:33:09 +02:00
Karel Zak 6e07b904e7 cfdisk: remove extra line between menu and info line
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 12:37:15 +02:00
Benno Schulenberg d48fc38307 cfdisk: spell "label" in lower case
To be less shouty.  It is not an abbreviation like "UUID".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:11 +02:00
Benno Schulenberg 80351b1f4a cfdisk: allow an uppercase X to toggle the extra info
To make true the help text line that says that all commands
can be entered with either upper or lower case.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:08 +02:00
Karel Zak 328eb4455b build-sys: add --disable-cal
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 11:49:29 +02:00
Karel Zak f9ffaac0d2 build-sys: fix test_colors build
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-24 14:33:25 +02:00
Karel Zak a5f3263967 tests: update build-sys tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-24 13:15:04 +02:00
Karel Zak 0bef6f759b libsmartcols: don't link with tinfo
Let's move color names to sequence translation to separate file to
make it usable without all the stuff in lib/colors.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-24 12:57:46 +02:00
Karel Zak 5404421866 tests: add udevadm settle
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-24 12:21:42 +02:00
Karel Zak 8c14a7434c libfdisk: add comment to the header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-24 11:18:11 +02:00
Karel Zak 2916afa3f5 lsipc: make --id usable with all output formats and with -o
This patch allows to use things like:

 # lsipc -m --id 47611910 -o COMMAND,SIZE,KEY --json

or

 # lsipc -m --id 47611910 -o SIZE --bytes --noheadings --raw

to get just one value for the resource.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 11:09:49 +02:00
Karel Zak 8f405a5bed lsipc: the default --global is mutually exclusive with -c --id and -t
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 10:36:02 +02:00
Karel Zak 2a7150ac2e lsipc: remove --print0 and -colon-separate
These options have been originally designed for lslogins for
compatibility another passwd-like tools. It does not make sense for
IPC.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 10:28:32 +02:00
Karel Zak cdedcbe603 lsipc: remove duplicate "Usage:"
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 10:20:06 +02:00