summaryrefslogtreecommitdiffstats
path: root/misc-utils/mcookie.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mcookie: properly initialize hashKarel Zak2017-12-121-0/+1
| | | | | | This stupid mistake has been introduced by commit 46ae163a8e5dc8457f8e2828eb53db8e610af275. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-7/+7
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-261-3/+4
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-1/+1
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-211-4/+2Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: fix -f usage [clang analyze]Karel Zak2015-07-291-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+3
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mcookie: avoid format warningBernhard Voelker2014-07-281-2/+2
| | | | | | | | | | | | | "gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]" issued the following warning: warning: format ‘%zu’ expects argument of type ‘size_t’, \ but argument 3 has type ‘int’ [-Wformat=] * misc-utils/mcookie.c (main): Change format from %zu to %d. RAND_BYTES is an enum, thus of type int. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* textual: fix some typos and inconsistencies in various messagesBenno Schulenberg2014-07-231-3/+4
| | | | | | | | Fixing plain typos, miswordings, inconsistent periods, some missing angular brackets, and a proper pluralization (even when it involves a constant, because for some languages the precise value matters). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mcookie: add --max-size optionSami Kerola2014-03-261-5/+27
| | | | | | | | | | | | Just in case someone wants to add entropy from device with invocation demonstrated below. $ mcookie --file /dev/urandom --max-size 64k [kzak@redhat.com: - use all-io.h] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* mcookie: use control structure, and fix usage()Sami Kerola2014-03-261-45/+49
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: use same variable type consistentlySami Kerola2014-03-261-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: allow --file option be defined multiple timesSami Kerola2014-03-261-29/+44
| | | | | | Earlier only the last option argument took effect. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: use lib/randutilsSami Kerola2014-03-261-47/+10Star
| | | | | | | | | The mcookie should reuse existing code, and there is definitely no need to prefer /dev/random for this utility. See reference for explanation about later statement. References: http://www.2uo.de/myths-about-urandom/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: pluralize two messagesBenno Schulenberg2013-10-081-4/+6
| | | | | Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: spell and encode the name of Arkadiusz Miśkiewicz correctlyBenno Schulenberg2013-02-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: use UTIL_LINUX_VERSION everywhereKarel Zak2013-01-251-3/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify file open error messagesSami Kerola2012-07-161-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc-utils: verify writing to streams was successfulSami Kerola2012-04-041-8/+3Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: cleanup usage()Karel Zak2011-08-161-8/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* md5: use symbolical digest lengthSami Kerola2011-07-211-2/+2
| | | | | | | Magic hash lenght number 16 is turned to a definition MD5LENGTH, and put into use everywhere where md5 checksum is in use. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: change coding styleSami Kerola2011-06-251-142/+152
| | | | | | Now in align with README.devel. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mcookie: use warnx, long options and help screenSami Kerola2011-06-251-10/+47
| | | | | | | | | Help and version options added. Additionally one compiler warning got to be fixed. mcookie.c:115:18: warning: comparison of integers of different signs: 'int' and 'unsigned long' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* remove CVS keywordsmaximilian attems2008-07-281-2/+0Star
| | | | | | | | this patch removes old CVS keywords from comments. mount(8) works for newer Linux then 0.99 ;) Signed-off-by: maximilian attems <max@stro.at>
* mcookie: remove non-linux codeKarel Zak2007-06-141-16/+1Star
| | | | | | | Something like #ifdef __linux__ is non-sense in util-linux where everything depend on linux. Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre1 tarball.Karel Zak2006-12-071-3/+3
|
* Imported from util-linux-2.11o tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.11b tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.9v tarball.Karel Zak2006-12-071-25/+66
|
* Imported from util-linux-2.9i tarball.Karel Zak2006-12-071-2/+5
|
* Imported from util-linux-2.7.1 tarball.Karel Zak2006-12-071-2/+2
|
* Imported from util-linux-2.5 tarball.Karel Zak2006-12-071-17/+93
|
* Imported from util-linux-2.2 tarball.Karel Zak2006-12-071-0/+44