If a libuuid application is unable to access /dev/random or /dev/urandom
then uuid generation by uuid_generate falls back to uuid_generate_time.
This could happen in chroot or container environments.
The function ul_random_get_bytes from lib/randutils.c uses getrandom if
it is available. This could either mean that the libuuid application
skips good random bytes because the character special files do not exist
or the application trusts in good random bytes just because these files
are accessible but not necessarily usable, e.g. limit of open file
descriptors reached, lack of data, kernel without getrandom, etc.
This commit modifies ul_random_get_bytes to return an integer which
indicates if random bytes are of good quality (0) or not (1). Callers
can decide based on this information if they want to discard the random
bytes. Only libuuid checks the return value. I decided to return 1
instead of -1 because -1 feels more like an error, but weak random bytes
can be totally fine.
Another issue is that getrandom sets errno to specific values only in
case of an error, i.e. with return value -1. Set errno to 0 explicitly
if getrandom succeeds so we do not enter the fallback routine for
ENOSYS by mistake. I do not think that this is likely to happen, but it
really depends on possible wrapper function supplied by a C library.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
mandoc: ./libuuid/man/uuid_generate.3:44:101: STYLE: unterminated quoted argument
mandoc: ./libuuid/man/uuid_generate.3:45:102: STYLE: unterminated quoted argument
####
There is no change in the output of "nroff" or "groff".
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.
In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.
Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
[Apply patch]
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
$ diff a b
$ echo $?
0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.
In the Linux man-pages project, I long ago did away with the
AUTHOR(S) section, but I realize some projects like to keep this.
But, let's make sure that the section is consistently titled
across pages. Currently we have AUTHOR (47) or AUTHORS (41).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Using double quotes in .SH lines containing multiple words is unneeded,
and in any case is not consistently done in the util-linux manual pages,
where double quotes are used in only around half of the cases.
(This usage was long ago elminated in the man-pages project, with
no ill effects reported to date.)
Remove these quotes, so that .SH lines are more uniform, in preparation
for some (more easily) scripted doiscovery of consistency problems in
(and possibly global fixes to) the manual pages.
Other than stripping the double quotes, this patch makes no changes to
the content of the manual pages.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This patch does only the following:
* Order SEE ALSO entries first by section name, then alphabetically
within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
at the end of SEE ALSO lists.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Change '\-' (minus) to '-' (code "hyphen-minus", rendered with the
glyph 'hyphen' in troff), if it is a part of a compound word.
Use \e to print the escape character, instead of \\, as \e is not
interpreted in copy mode
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Use \e for the printable escape character instead of \\
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Change '-' to '\-', if it means a minus
Protect a full stop (.), that begins or ends a string, with \&
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Protect a full stop (.), that begins or ends a string, with \&
Inhibit right adjusting for the section "SEE ALSO" with ".na/.ad", or
use '.ad l' for the entire manual
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
It seems more simple to create small three files with man page links
than generate the files on the fly.
Note that the libuuid/man directory is not in builddir by default so
you have to create proper directory and then create the man pages...
too complex task for this three tiny files.
Signed-off-by: Karel Zak <kzak@redhat.com>
Several horizontal lists are turned to vertical, and sorted to
alphabetical order. Additionally spaces are converted to tabs where
ever possible.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>