Commit Graph

5021 Commits

Author SHA1 Message Date
Karel Zak
0e60bc9b15 build-sys: add compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-06 12:10:41 +02:00
Karel Zak
df68ccd8b8 fdisk: fix io_size usage in new API
properly implemented fdisk_dev_has_topology() requires optimal
I/O size to detect that the device provides topology.

Unfortunately, currently used cxt->io_size maybe overwritten in
__discover_topology() to min_io_size.

This patch introduces cxt->optimal_io_size and keeps it independent on
cxt->io_size. The cxt->io_size is I/O size used by fdisk for alignment
calculation.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-06 11:03:23 +02:00
Karel Zak
dde32b6ccd fdisk: fix compiler warning [-Wunused-variable]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-06 10:56:29 +02:00
Karel Zak
c04e4a6a20 fdisk: fix compiler warning [-Wpointer-sign]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-06 10:53:20 +02:00
Karel Zak
e1fc87eacd fdisk: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-06 10:48:26 +02:00
Davidlohr Bueso
14e93ff3c8 fdisk: remove user specified sector size global variable
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:43:27 +02:00
Davidlohr Bueso
6e89f25e8b fdisk: add fdisk_dev_sectsz_is_default helper
Instead of printing this warning from the API, add a helper and call it from
fdisk logic.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:41:51 +02:00
Davidlohr Bueso
3e3de41ad9 fdisk: use EXIT_SUCCESS for -l option
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:41:38 +02:00
Davidlohr Bueso
618882d609 fdisk: add total sectors
Add the total_sectors variable to the context structure. This is the initial
geometry information.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:40:40 +02:00
Davidlohr Bueso
e53ced85bf fdisk: add device topology to the API
This patch adds device topology discovery to the internal API. This
functionality is static only to the API and therefore hidden from general fdisk
code. Functionality itself doesn't really change, min_io_size, io_size, logical
and physical sector sizes and alignment offset are added to the fdisk_context
structure and elements are accessed from there. The logical sector size
(sector_size) is now unsigned long instead of unsigned int, this as no effect
otherwise.

A few things to notice:
 - The patch is larger than I wanted but we need to modify function parameters
   across fdisk and its labels to use the topology data from cxt-> instances.
   Hopefully this will be pretty much it regarding this kind of modifications -
   perhaps geometry will need something of the like too.

 - The -b option must override internal discovery.

 - A new helper function has added to verify if the device provides topology
   information, this replaces the 'has_topology' global variable.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:30:07 +02:00
Davidlohr Bueso
7db8141571 fdisk: sun: use sector_t
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:12:05 +02:00
Davidlohr Bueso
c9d7e0140f fdisk: sgi: use sector_t
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:12:01 +02:00
Davidlohr Bueso
24def09df4 fdisk: dos: use sector_t
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:11:58 +02:00
Davidlohr Bueso
50dec1ebff fdisk: introduce sector_t type
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:11:54 +02:00
Davidlohr Bueso
d8de095530 fdisk: remove useless comments
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:11:47 +02:00
Davidlohr Bueso
7737f69850 fdisk: use context as a parameter
This program heavily uses global variables, which isn't very elegant and can
lead to nasty bugs. Modify functions that use fdisk's context current features
(descriptor and path), to receive the context as a parameter instead of
globally. This includes DOS, SUN, SGI and BSD label code. Another benefit that
comes with this is that as the API grows all the information regarding fdisk
will be accessible from this structure so we can reduce even more global
variables and simply code.

This patch passed:
 - building
 - regression tests
 - local dos/sun/bsd partition changes

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:11:41 +02:00
Davidlohr Bueso
89fd812fcb fdisk: stop buffering welcome message
Recently, commit 0a86755fe8 directed the welcome
message output from stderr to stdout breaking regression tests.  Correct this
by flushing stdout and stop buffering the output - a trivial function is
created as well.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-06-06 10:11:22 +02:00
Karel Zak
d07dc5e4ee build-sys: suid su in make install
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 17:38:09 +02:00
Karel Zak
7d18972b00 login: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 16:59:54 +02:00
Karel Zak
abb53be5cb Merge branch '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit
* '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit:
  docs: clean up getopt.1 manual
  docs: clean up dmesg.1 manual
  docs: clean up chcpu.8 manual
  fileutils: xmkstemp() interface change
  docs: fix all man page groff warnings
  tools: add checkmans.sh
  docs: clean up wdctl.8 manual
  docs: clean up login.1 manual
  login: allow TTYGROUP name begin by number
  build-sys: add su executable to .gitignore
  logindefs: change getlogindefs_num() to return unsigned long

Conflicts:
	login-utils/su.c
	sys-utils/dmesg.1
2012-06-05 16:57:01 +02:00
Ludwig Nussel
8ce7dfa341 su: preserve errno in cleanup_pam()
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:51:26 +02:00
Karel Zak
90af3fe39b inclide/env: innclude c.h, remove _() macro from xsetenv()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 15:44:12 +02:00
Dave Reisner
5e7b834002 libmount: trim leading commas from each options string
Fixes a bug in option string parsing wherein a line such as:

  ro,relatime,,nosuid,nodev

Will be seen as only the tokens "ro" and "relatime" after the parser
encounters a zero length (and erroneously declared NULL) option.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-05 15:40:11 +02:00
Dave Reisner
9d20b49607 build-sys: include correct source file for chsh
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-05 15:39:54 +02:00
Ludwig Nussel
a9a8b2c4f4 su: use BSD err function instead of gnu's error()
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:20:08 +02:00
Ludwig Nussel
1ecb6186c5 su: remove unused code
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:19:09 +02:00
Ludwig Nussel
e824086bbd su: replace PAM_BAIL_P macro with better solution
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:16:27 +02:00
Ludwig Nussel
e557efdedd su: introduce xsetenv globally
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:16:18 +02:00
Ludwig Nussel
a711e67a44 su: use ENV_PATH resp ENV_SUPATH to be consistent with login
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:16:10 +02:00
Ludwig Nussel
07ffbaf2b0 su: use EXIT_FAILURE consistently
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:16:03 +02:00
Ludwig Nussel
8aa108ff47 su: don't use custom MAX macro
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2012-06-05 15:15:56 +02:00
Milan Broz
cbc729f030 libblkid: add dm-verity hash device detection
dm-verity can use separate device for hash verification,
in this case there is a superblock in the first sector.

See
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/device-mapper/verity.txt
for more info.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-06-05 14:55:55 +02:00
maximilian attems
ab65d635c8 lib/strutils: circumvent missing localeconv()
Add stub too nls.h, include it instead of locale.h.
Code in strutils handles already returned NULL.

Signed-off-by: maximilian attems <max@stro.at>
2012-06-05 14:54:12 +02:00
Karel Zak
e7b976862a Merge branch 'su.1' of https://github.com/kerolasa/lelux-utiliteetit
* 'su.1' of https://github.com/kerolasa/lelux-utiliteetit:
  docs: rewrite su.1 manual
  docs: fix email macro in manual example
  docs: add su.1 manual page
2012-06-05 14:47:00 +02:00
Karel Zak
a862a45210 dmesg: fix typo in man page
Reported-by: Hemant Borole <hemantborole@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 14:40:10 +02:00
Bernhard Voelker
871ffd0960 Fix typos in comments and wall's man page
Culprits identified again by (newer) misspellings:

  $ git ls-files | misspellings -f - | grep -v '^po/'

* wall: Fix typo in man page.
* Fix typos in source code comments.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-06-05 14:37:26 +02:00
Andreas Bießmann
3339f0daab text-utils/hexsyntax.c: fix for missing program_invocation_short_name
Some libc do not expose program_invocation_short_name. Therefore util-linux
comes with helpers in 'c.h'. Use the 'c.h' in hexsyntax.c where it was missed.

This patch fixes following error for me:
---8<---
hexsyntax.c: In function 'newsyntax':
hexsyntax.c:115: error: 'program_invocation_short_name' undeclared (first use in this function)
hexsyntax.c:115: error: (Each undeclared identifier is reported only once
hexsyntax.c:115: error: for each function it appears in.)
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
2012-06-05 14:31:13 +02:00
Karel Zak
eecbb2cfee more: fix regex error messages printing
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 14:19:13 +02:00
Jeremy Huntwork
7f84e4440f more: remove a meaningless test
regexec only returns 0 or REG_NOMATCH so remove a meaningless test

Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-05 14:09:36 +02:00
Sami Kerola
00388ebc7b docs: clean up getopt.1 manual
* Add lightness to synopsis.
* Add spaces after dots (English spacing).
* Replace backticks by ticks.
* Reformat text to be 70 characters wide.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 22:39:40 +02:00
Sami Kerola
8a78a4fe2f docs: clean up dmesg.1 manual
* Add lightness to synopsis.
* Add few missing italic highlights to text segments which refer
  command line argument(s).
* Turn off bold where ever possible (makes text unnecessarily heavy).
* Add spaces after dots (English spacing).
* Use URL and email macros where appropriate.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 21:57:31 +02:00
Sami Kerola
a6210872c5 docs: clean up chcpu.8 manual
* Add lightness to synopsis.
* Use argument and parameter highlights consistently.
* Indent dispatch modes.
* Add spaces after dots (English spacing).
* Add line break macros.
* Use URL and email macros where appropriate.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 21:18:04 +02:00
Dave Reisner
3c4fed097d fileutils: xmkstemp() interface change
We can not let the user control where TMPDIR is for this tempfile.
This will be where we write the updated passwd file, and must be
capable of being moved atomically with rename(2).  Therefore, it
cannot be on a different device, or setpwnam() and vipw/vigr programs
will invariably fail with EXDEV.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:12 +02:00
Sami Kerola
79f8481889 docs: fix all man page groff warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:12 +02:00
Sami Kerola
ea6c96fb0f tools: add checkmans.sh
A script to find whether all manuals has proper groff syntax.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:07 +02:00
Sami Kerola
2002f9c4c3 docs: clean up wdctl.8 manual
Align with Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 15:11:27 +02:00
Sami Kerola
39c877f1a5 docs: clean up login.1 manual
PATH contents for users & root in DESCRIPTION section where wrong,
and couple default values where missing.  Rest of the change is about
making the groff, and the output, to look good.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 15:11:27 +02:00
Sami Kerola
10b3219a5f login: allow TTYGROUP name begin by number
Assuming someone is using a TTYGROUP name beginnign by a digit the
login was misbehaving with 'contains invalid numerical value: %s'
message(s) in syslog.  Please notice that group names that consist
only digits as characters are valid (but likely to cause confusion,
and chaos).

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 15:10:28 +02:00
Sami Kerola
efa0f39c6e build-sys: add su executable to .gitignore
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 12:00:48 +02:00
Sami Kerola
c9baf5da86 logindefs: change getlogindefs_num() to return unsigned long
Where ever getlogindefs_num() is called return value is always
expected to be unsigned, such as sleep() input, gid_t or mode_t.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 11:57:42 +02:00