Commit Graph

12368 Commits

Author SHA1 Message Date
root 20432749c1 tests: suppress warning for old sync(1)
Old sync(1) prints a warning which looks ugly among our
test output: "sync: ignoring all arguments"

Seen on travis, Ubuntu <= 14.04 (Trusty).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:35 +01:00
Ruediger Meier 68ac426949 fsck.cramfs: fix error message
errno is invalid in case that we just read(3) too short.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:34 +01:00
Ruediger Meier c990f94cbc tests: rewrite fsck-bad-header
Fix test for systems with pagesize != 4096
Loop over many combinations of sizes, endianness and blocksizes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:33 +01:00
Ruediger Meier 2374b1ab75 fsck.cramfs: fix crash when superblock size is too small
This hopefully fixes the original problem addressed by the reverted
patch 7cb962c7.

The bug was introduced by myself in
    f991dbd3 "fsck.cramfs: allow smaller superblock sizes"

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:31 +01:00
Ruediger Meier 919e372da8 Revert "fsck.cramfs: Fix bus error on broken file system."
This reverts commit 7cb962c770.

It can't be right that we mmap (start + super.size) bytes from a file
which is usually only super.size bytes large. The patch "fixed" a
problem when super.size is bad but now it fails for the correct case:

$ mkdir -p root/subdir
$ ./mkfs.cramfs -p root cramfs
$ ./fsck.cramfs cramfs
Bus error (core dumped)

We will fix the original problem later.

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:28 +01:00
Karel Zak c0b340bc99 tests: use subtests for weeknum cal(1) tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 17:09:25 +01:00
Karel Zak 940b55ac4b tests: use subtests for weekarg cal(1) tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:55:07 +01:00
Karel Zak 1b1f6f2511 test: use subtests for jan1753 cal(1) test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:54:06 +01:00
Karel Zak 5b9138d952 tests: merge year cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:01:14 +01:00
Karel Zak b0636cc11a tests: merge 1m and 3m cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:01:06 +01:00
Karel Zak a88564a061 tests: merge sep1752 cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:00:39 +01:00
Karel Zak 5c8324fb88 tests: use subtests for sep1752w test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 15:01:05 +01:00
Karel Zak c24a4de605 tests: simplify cal(1) sep1752w test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 14:44:40 +01:00
Karel Zak fbb94f5790 tests: add cal(1) --week=40 1752
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 14:26:39 +01:00
J William Piggott 6304358cb7 cal: fix first week calculation
Commit efafeaf set 1 Jan as week 1, but the change
was missed in week_to_day() and in the man page.

Before
cal --week=40 --iso 1752
      October 1752
   Su Mo Tu We Th Fr Sa
41  1  2  3  4  5  6  7
42  8  9 10 11 12 13 14
43 15 16 17 18 19 20 21
44 22 23 24 25 26 27 28
45 29 30 31

Patched
cal --week=40 --iso 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36                 1  2
37  3  4  5  6  7  8  9
38 10 11 12 13 14 15 16
39 17 18 19 20 21 22 23
40 24 25 26 27 28 29 30

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 14:16:57 +01:00
J William Piggott e572a765f9 cal: fix week calculations for 1752
Before:
cal --week=39 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36        1  2 14 15 16
37 17 18 19 20 21 22 23
38 24 25 26 27 28 29 30

Patched:
cal --week=39 1752
      October 1752
   Su Mo Tu We Th Fr Sa
39  1  2  3  4  5  6  7
40  8  9 10 11 12 13 14
41 15 16 17 18 19 20 21
42 22 23 24 25 26 27 28
43 29 30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 14:16:57 +01:00
Karel Zak 6776ab6f60 Merge branch 'patch-2' of https://github.com/sourcejedi/util-linux
* 'patch-2' of https://github.com/sourcejedi/util-linux:
  mount(8): umount does not (anymore?) say `none busy'
2018-01-22 14:01:42 +01:00
Karel Zak 267b44e6ee mount: be more accurate in man page about propagation flags
Addresses: https://github.com/karelzak/util-linux/issues/565
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:54:49 +01:00
Karel Zak d4e89fc11f Merge branch 'master' of https://github.com/rluzynski/util-linux
* 'master' of https://github.com/rluzynski/util-linux:
  cal: Use ALTMON_* correctly
2018-01-22 13:31:22 +01:00
Karel Zak af808dfa6d lscpu: (arm) cleanup code
* check for strtol() errors
* fix indention
* fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:20:51 +01:00
Karel Zak 8229df2093 lscpu: move ARM decoding to lscpu-arm.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:08:11 +01:00
Karel Zak 7106169441 lscpu: move struct lscpu_desc header file
The lscpu code is growing and it seems better to allow to make code
more structured.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:04:12 +01:00
Karel Zak 7b0926acb0 Merge branch 'arm-cpus' of https://github.com/suihkulokki/util-linux
* 'arm-cpus' of https://github.com/suihkulokki/util-linux:
  lscpu: Decode ARM CPUs
2018-01-22 12:47:47 +01:00
Rafal Luzynski 4e12a62e88 cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display
months in a standalone form correctly.  These constants have just
been newly added to glibc.  ALTMON_x has been used in BSD family
since 1990s and has been accepted as the future POSIX extension.
_NL_ABALTMON_* is exclusively a GNU extension but it is expected
to be added to POSIX in future.

More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
2018-01-22 11:50:50 +01:00
J William Piggott 1dca3edc36 cal: fix julian calendars for large years
Before:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Patched:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 11:33:20 +01:00
Ruediger Meier af1bc027db build-sys: remove redundant EXTRA_DIST files
The sources of AC_CONFIG_FILES (*.in) are automatically
distributed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 4beacf105e build-sys: avoid using prog_DEPENDENCIES
Use EXTRA_prog_DEPENDENCIES to have the benefit
of automake's automatic prog_DEPENDENCIES.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 0da03d4490 build-sys: remove unneeded dependencies on bla.h.in
We have already automakes's automatic dependencies like
  bla.h.in -> bla.h -> foo.o -> bar.la

An explicit direct dependency bla.h.in -> bar.la
is redundant and useless anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier a459f2ec33 build-sys: automake is able to find headers in builddir ...
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 1d667d8849 build-sys: remove generated headers from dist tar ball
Headers should only be listed in either *_HEADERS or
*_SOURCES, especially when we want nodist_*_HEADERS.

Since all the generated headers are made by configure we
don't even need to use BUILT_SOURCES or other tricks.

Also see automake docs 9.4.1 Built Sources Example:
  case "Build bindir.h from configure"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
J William Piggott ff4e18bd2d hwclock: add --ul-debug implementing debug.h
Undocumented at this time, because it is a skeleton
implementation.  More debugging points are to be added after
refactoring is complete, or ad hoc in the mean time.

When fully implemented, enough time may have passed that the
deprecated --debug could be used to replace --ul-debug.

[kzak@redhat.com: - use __UL_INIT_DEBUG_FROM_STRING() to initialize the mask
                  - add hwclock_init_debug()]

Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 11:10:22 +01:00
Alan Jenkins c72fa620b0
mount(8): umount does not (anymore?) say `none busy'
The closest I can get is with `mount`, so refer to that instead.

    # mount none -t proc /proc 
    mount: /proc: none already mounted or mount point busy.
    # umount /proc
    umount: /proc: target is busy.
    # (cd /root; umount proc)
    umount: /proc: target is busy.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
2018-01-21 16:41:17 +00:00
Riku Voipio 744d62ee0c lscpu: Decode ARM CPUs
Since the kernel developers have refused to make /proc/cpuinfo user
understandable, implement mapping in userspace. lscpu is available for
most users via util-linux, so store the information here.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2018-01-19 17:14:19 +02:00
Mike Frysinger 8fb096b2a7 mount(8): point people to the proc(5) page for mount options
This page is out of date wrt proc mount options, so point it to the
proc(5) page which is kept up to date.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2018-01-19 11:14:00 +01:00
Karel Zak aefa920a79 sfdisk: add hint about udev and flock to the man page
Addresses: https://github.com/karelzak/util-linux/issues/563
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 16:30:06 +01:00
Karel Zak 88e5d289d5 tests: mark fincore/count as KNOWN_FAIL
The test (or our expectations about Direct-IO) seems not robust
enough. I guess this is not fincore problem.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 14:52:17 +01:00
Carlos Santos a9e4662d26 docs: add ISC licence
Save the top 21 lines of sys-utils/rfkill.c as COPYING.ISC. This is
useful for Linux distributions an integration tools like Buildroot,
to collect detailed legal information for each package.

[kzak@redhat.com: - remove C-comments and rfkill header]

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 14:38:49 +01:00
Karel Zak a15dca2f6d include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()
Let's make it possible to use debug.h without environment variables.

Suggested-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 13:58:29 +01:00
J William Piggott de4568f757 hwclock: rename --debug option to --verbose
Warn on --debug; do not fallthrough because
the message is lost in the verbose output.

Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-17 13:29:11 +01:00
J William Piggott a4b55ad008 cal: update man page
Update cal.1 with the new options --reform and --iso.

Also add information about the calendar systems used and
the difference between the --julian option and the Julian
calendar system.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-16 13:51:43 -05:00
J William Piggott ae51e7b429 cal: add option to set Gregorian reform date
Create the new option: --reform <1752|gregorian|iso|julian>

This adds the capability to display either the proleptic Gregorian or
the Julian calendar systems exclusively.

Also create the option --iso as alias of --reform=gregorian.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-16 13:51:24 -05:00
J William Piggott db9baa8ab7 cal: move REFORMATION_YEAR to control struct
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-15 11:06:36 -05:00
Karel Zak 7bd0c1ae18 include/debug: improve debug message
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12 13:46:49 +01:00
Karel Zak 66643f3151 include/debug: print info when addresses suppressed
Suggested-by: Peter Cordes <peter@cordes.ca>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12 13:37:05 +01:00
Karel Zak 7e95fd82b7 sfdisk: cleanup shortcuts in man page too
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12 12:38:58 +01:00
Karel Zak e92b6f68c4 libfdisk: (script) be consistent in code with types
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12 12:04:16 +01:00
Karel Zak bc9ca775a2 Merge branch 'mbsencode' of https://github.com/yontalcar/util-linux
* 'mbsencode' of https://github.com/yontalcar/util-linux:
  tests: mark mbsencode as KNOWN_FAIL
  tests: mbsencode - test for HAVE_WIDECHAR
  lib/mbsalign: Fix escaping nonprintable multibyte characters
  tests: mbsencode - removed emoji, added control unicode character
  tests: add tests for encode functions from lib/mbsalign.c
  lib/mbsalign: escape "\x" when HAVE_WIDECHAR not defined
2018-01-12 11:59:22 +01:00
Karel Zak 6d00cfb233 include/debug: don't print pointer address for SUID programs
* introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing

* use __UL_DEBUG_FL_NOADDR when SUID

* move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK
  to provide access to the current mask from ul_debugobj(). It's better
  than modify all ul_debugobj() calls and use the global mask as
  argument.

* remove never used UL_DEBUG_DEFINE_FLAG

Reported-by: halfdog <me@halfdog.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12 11:01:26 +01:00
Karel Zak 9c76f85f9a libfdisk: allow to start freespace for zero
This is necessary for disk labels like SUN where whole disk is possible
to address by partitions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-11 15:18:00 +01:00
Karel Zak f7606d2d9f libfdisk: (sun) fix n-1 bug and whole-disk
* set whole_disk variable if SUN_TAG_WHOLEDISK specified
* fix N-1 bug in add new partition according to template (script)

Addresses: https://github.com/karelzak/util-linux/issues/555
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-11 14:23:57 +01:00