Commit Graph

9721 Commits

Author SHA1 Message Date
Karel Zak cdb4a9464d lsipc: don't duplicate already allocated data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:57:45 +02:00
Karel Zak 2c6567799d build-sys: add --disable-assert
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:40:44 +02:00
Karel Zak cba392b661 libmount: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:21:42 +02:00
Karel Zak 1c3c92cd8d libfdisk: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:03:14 +02:00
Karel Zak e97c021472 libblkid: remove dead code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 12:31:39 +02:00
Karel Zak 70e0513563 mkfs.minix: add hint for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:42:27 +02:00
Karel Zak cd16685e94 mkfs.minix: use xalloc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:39:49 +02:00
Karel Zak 101c80f316 mkfs.cramfs: remove dead code [coverity scan]
There two possible ways, print error and exit on too long names or
truncate the filename -- but it's impossible to do both in the same
code :-) It seems that code already assumes warning on long names, so
let's remove errx() and keep the behavior in dependence on -E.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:33:57 +02:00
Karel Zak 1e9d849b8d fsck.minix: be more paranoid with block buffers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:15:53 +02:00
Karel Zak 4c166c2200 cfdisk: check return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 10:59:52 +02:00
Karel Zak 21ce5a5d70 lsipc: ifdef SHM_* macros
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 13:20:56 +02:00
Karel Zak dc5c91f648 tests: fix minix tests filenames
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 12:51:13 +02:00
Karel Zak 45caf6eea8 tests: try mkfs & mount all supported minix versions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 12:35:29 +02:00
Sami Kerola 24bdce6ea8 bash-completion: update few options changed since v2.26
Attempt to find and update all changes to command line options that has
not been reflected in bash-completion files in between versions v2.26 to
v2.27-rc1.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 12:35:18 +02:00
Karel Zak 39c795d8b7 tests: fix minix test
- run the test with UID=0 only. The minix FS inode contains UID and
  GID, so the final image checksum depends on user...

- always use subtest name for the images

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 12:31:40 +02:00
Sami Kerola 6fb15a2dcf tests: add fsck.minix checks
The debian bug was fixed in commit 730ae9c899, and the rest are about
having test coverity for various file name lenghts and minix fs versions.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:38 +02:00
Sami Kerola 98f8b800dc tests: add way to control mkfs.minix time stamps
Needed in order to create reproducable file systems image files, so that
out come of mkfs.minix can be checksum'ed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:37 +02:00
Sami Kerola 3e56e36291 mkfs.minix: re-fix block count maths
Error, that Joshua Hudson already pointed out, creapped back to commit
da41ff5 when changes were applied from mailbox rather than git remote, as
the corrected change had included some accidental rubbish.

Reference: http://www.spinics.net/lists/util-linux-ng/msg11764.html
Reference: http://www.spinics.net/lists/util-linux-ng/msg11848.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:36 +02:00
Benno Schulenberg d000470d51 unshare: remove angular brackets from literal argument in usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:19:10 +02:00
Benno Schulenberg c3a68a8f67 docs: fix some grammar and punctuation in the 2.27 release notes
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:19:05 +02:00
Benno Schulenberg 89de71b347 mount: remove duplications of --help and --version from usage text
And slice up the affected portions.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:19:02 +02:00
Benno Schulenberg 315be52f50 lslocks: slice up the recently modified usage text
For ease of translation when it changes.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:18:59 +02:00
Benno Schulenberg 62eea9ce12 textual: adjust grammar and punctuation of some messages
Also equalize three messages to one other one,
and fix a typo in USE_COLORS_BY_DEFAULT.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:18:56 +02:00
Karel Zak d3a1e3bfaa build-sys: mark script(1) as Linux only due to signalfd()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-31 15:27:10 +02:00
Karel Zak 55ebd014b0 build-sys: release++ (v2.27-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-31 12:08:18 +02:00
Karel Zak 5eb470aa7f docs: add v2.27-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-31 12:06:38 +02:00
Karel Zak c37b3314c7 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-31 11:02:35 +02:00
Karel Zak d3cac66d66 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-31 10:56:34 +02:00
Milan Broz c49ff158aa lsblk: Display mountpoint even for top-level device
If a filesystem is mounted on top-level block device
with existing partitions, the mountpoint is not displayed
in the lsblk output.

This situation can happen by a configuration mistake
and lsblk could be used to detect such a mistake.

This patch allows searching for a mountpoint for all displayed
devices, not only for leaf nodes.
(It should be pretty cheap operation, mtab is parsed only once.)

For example: lsblk /dev/loop1
NAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop1       7:1    0  128M  0 loop /mnt/tst
└─loop1p1 259:0    0  127M  0 loop

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2015-07-31 10:44:57 +02:00
Karel Zak 901f85fe54 sfdisk: don't print extra linebreaks on --quiet
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 13:22:35 +02:00
Karel Zak df15fb3d05 libfdisk: allow to change partition type for extended partitions
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1248115
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 12:55:56 +02:00
Karel Zak 35d8592cd4 hexdump: fix man page (-x vs. default output)
Reported-by: Reuti <reuti@staff.uni-marburg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 11:49:15 +02:00
Sami Kerola e87a6ee0f5 docs: make fsck.minix(8) more pretty
Use real table to device list, add missing new paragraph markers, remove
braces that cause reader to wonder if test is meant or not, squeeze error
code list, move references to bottom of the manual, and use mail or web
address macro when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:18 +02:00
Sami Kerola 158b8d6918 fsck.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:17 +02:00
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