Adding V3 and V5 UUIDs per RFC-4122.
[kzak@redhat.com: - fix symbols file]
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The access(2) is more lightwight than stat(2), and tells whether random
device(s) can be read or not, unlike the earlier stat() call.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The util-linux code was previously aligned to use @localstatedir@ and
the util-linux build system was set to override the default to use /run.
Current GNU Coding Standards introduced the @runstatedir@ variable
for this purpose. Lets use that instead.
The GNU default for @runstatedir@ is ${localstatedir}/run so util-linux
still override the default to be /run to preserve the status quo from
before. The only difference is that you'll now pass --runstatedir to
override the location on the command line instead of --localstatedir.
(FWIW, Debhelper in compat 11 will automatically start passing
--runstatedir=/run to all autotools configured builds. It already
passes --localstatedir=/var (to avoid it ending up with the GNU default
/usr/local/var) which breaks the util-linux build system code that
tries to default it to /run. This change will thus allow util-linux
and debhelper to work better together and avoid the need for a
package-specific override.)
Relevant historic commits:
* commit 07a16b9d1e
"build-sys: change --localstatedir to /run"
* commit 80c51185d5
"uuidd: use run configured state directory"
* commit 01c5b78794
"agetty: use configured run state directory"
[kzak@redhat.com: - add $runstatedir fallback for autoconf < 2.70
- check for unmodified $localstatedir]
CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
We got some errors on Alpine Linux where $LTLIBINTL is non-empty:
./.libs/libcommon.a(libcommon_la-blkdev.o): In function `open_blkdev_or_file':
lib/blkdev.c:282: undefined reference to `libintl_gettext
collect2: error: ld returned 1 exit status
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
We were missing our nice compliler warnings for many programs
and libs. See next commits how many trivial and non-trival
warnings have to be fixed.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This was a major showstopper when building on a system where
LTLIBINTL libs are needed (e.g. OSX). Maybe there are a few test
programs which wouldn't need LDADD ... never mind.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Fix the warnings below for OSX clang and add a few more
casts for timeval:
lib/at.c:131:27: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]
printf("%16jd bytes ", st.st_size);
~~~~~ ^~~~~~~~~~
lib/strutils.c:522:52: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
snprintf(buf, sizeof(buf), "%d%s%jd%s", dec, dp, frac, suffix);
~~~ ^~~~
lib/sysfs.c:468:42: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
len = snprintf(buf, sizeof(buf), "%ju", num);
~~~ ^~~
libuuid/src/gen_uuid.c:316:34: warning: format specifies type 'unsigned long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
clock_seq, last.tv_sec, last.tv_usec, adjustment);
^~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Based on patch from Justin Akers, he wrote:
> When building Openembedded inside a Jenkins matrix job the paths can
> get quite long. This ensures libuuid won't crash when attempting to
> connect to uuidd in such a scenario.
Reported-by: Justin Akers <dafugg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Make return value consistent for consecutive calls. If you call
uuid_generate_time_safe, it should always return -1 if it can't guarantee
uniqueness. Without this patch, on consecutive calls where it can't guarantee
uniqueness, the first call returns -1, but later calls return 0.
Reported-by: Romain Bouvier <skunnyk@alteroot.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
The _SVID_SOURCE is deprecated.
In file included from /usr/include/stdio.h:27:0,
from libuuid/src/gen_uuid.c:46: /usr/include/features.h:148:3:
warning: #warning "_BSD_SOURCE and _SVID_SOURCE are
deprecated, use _DEFAULT_SOURCE" [-Wcpp]
Notice that the Makefile.am has
AM_CPPFLAGS = \
-include config.h \
that enforces the config.h is included before any other hearer. In the
configure.ac there is AC_USE_SYSTEM_EXTENSIONS that makes all possible
features that can be supported in a system are turned on. With these two
there is absolutely no need for any legacy _SOURCE definitions.
Reference: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=c941736c92fa3a319221f65f6755659b2a5e0a20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
In several Makemodule.am, there is a install-exec-hook-<library>
target whose role is to move the shared library from /usr/lib to /lib,
while keeping a symbolic link /usr/lib/libuuid.so ->
../../lib/<library>.so.<version>.
However, when util-linux is built with --enable-static
--disable-shared (as is needed on noMMU platforms that don't support
shared libraries), no <library>.so is built, but the
install-exec-hook-libuuid creates an invalid /usr/lib/<library>.so
symbolic link, pointing to ../../lib (yes, the directory). This causes
troubles later one when other libraries/programs are compiled with
-l<library>, as gcc thinks a shared library is available because
there's a file named /usr/lib/<library>.so.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.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>
This is necessary for paranoid security guys who believe that things
like "-Wl,-z,relro" or "-Wl,-z,bind_now" is a way how to make the
world a safer place...
Signed-off-by: Karel Zak <kzak@redhat.com>
autoconf docs about *dir variables (e.g bindir):
... A corollary is that you should not use these variables except in
makefiles...
...you should not rely on AC_CONFIG_FILES to replace bindir and friends
in your shell scripts and other files; instead, let make manage their
replacement.
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
This reverts commit 6126f7a53c
and fixes the double open and leaking descriptor in a different way,
that is by using newly introduced function 'have_random_source()'
to check whether good random source is available while deciding
which uuid type to generate (random/time).
This is better than calling random_get_fd() twice, passing the file
descriptor down the stack and reusing it in next call to
random_get_fd().
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
We are opening /dev/urandom twice in uuid_generate(): first to check if
the file is available and then later __uuid_generate_random() again to
actually get the random data. Moreover, descriptor from the first open
is leaking.
Fix by passign the descriptor down the stack and reusing it there.
References: http://marc.info/?l=util-linux-ng&m=133406051131131&w=2
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>