Commit Graph

105 Commits

Author SHA1 Message Date
Sami Kerola 8791804065 misc: do not use plain 0 as NULL [smatch scan]
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>
2017-02-20 12:58:49 +01:00
Karel Zak 59dee89d5b libuuid: unused parameter [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 12:04:22 +01:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
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>
2016-11-29 10:44:19 +01:00
Ruediger Meier 18336d16d9 build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:48:09 +01:00
Karel Zak 5bb1d22e8a build-sys: fix if..endif for *_la_LDFLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-10 13:54:15 +01:00
Ruediger Meier b0b54cc582 build-sys: always add AM_CFLAGS
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>
2016-02-23 01:17:29 +01:00
Ruediger Meier b201f1d86c build-sys: always use global LDADD
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>
2016-02-23 01:16:58 +01:00
Ruediger Meier 3719bf8de9 build-sys: check linker support for version scripts
The macro AX_CHECK_VSCRIPT was taken from gnu autoconf archive.
http://www.gnu.org/software/autoconf-archive/

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Ruediger Meier 7231fb2a5b misc: fix some printf format strings
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>
2016-02-11 13:39:56 +01:00
Sami Kerola 85638702ed
tests: make test_uuid_parser to read files
This allows using the command to check uuidgen and uuidd are generating
valid outputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 19:12:30 +01:00
Sami Kerola 4d3f964e4a
tests: add uuid parser check
The check is based on code by Theodore Ts'o to test libuuid, from which
unstable output is commented out.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:39:21 +01:00
Karel Zak d5358bbb6b libuuid: fix buffer overflow with long paths
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>
2015-09-30 12:42:16 +02:00
Romain Bouvier c893f5e462 libuuid: return correct value for uuid_generate_time_safe
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>
2015-06-18 12:12:16 +02:00
Karel Zak adc9f78cfc build-sys: cleanup library symbol files
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-20 14:01:03 +01:00
Sami Kerola 4c87bb0d99 libuuid: remove _SVID_SOURCE pre-processor definition
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>
2014-10-01 12:33:31 +02:00
Sami Kerola 5f10333ab4 libuuid: add extern qualifiers to uuid/uuid.h system header
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:00 +01:00
Thomas Petazzoni 6e90f2b479 Only move shared libraries to /lib if they exists
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>
2014-06-16 14:53:09 +02:00
Bjarni Ingi Gislason 4f712efe89 libuuid: (uuid.3) Improve the typesetting of the manual
Protect a full stop (.), that begins or ends a string, with \&

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-05-06 11:56:29 +02:00
Bjarni Ingi Gislason da93895661 libuuid: (uuid_unparse.3) Improve the typesetting of the manual
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>
2014-05-06 11:56:12 +02:00
Bjarni Ingi Gislason c5280309c4 libuuid: (man/uuid_time.3) Improve the typesetting of the manual
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>
2014-05-06 11:55:57 +02:00
Bjarni Ingi Gislason 7a8c8e7efd libuuid: (uuid_parse.3) Improve the typesetting of the manual
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>
2014-05-06 11:55:45 +02:00
Bjarni Ingi Gislason 377c30b4ea libuuid: (uuid_is_null.3) Improve the typesetting of the manual
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>
2014-05-06 11:55:31 +02:00
Bjarni Ingi Gislason ba0738ea7e libuuid: (uuid_generate) Improve the typesetting of the manual
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>
2014-05-06 11:55:19 +02:00
Bjarni Ingi Gislason e12e2bac51 libuuid: (uuid_copy.3) Improve the typesetting of the manual
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>
2014-05-06 11:55:00 +02:00
Bjarni Ingi Gislason 0d3aa3b259 libuuid: (uuid_compare.3) Improve the typesetting of the manual
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>
2014-05-06 11:54:48 +02:00
Bjarni Ingi Gislason c1991c296d libuuid: (uuid_clear.3) Improve the typesetting of the manual
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>
2014-05-06 11:54:35 +02:00
Benno Schulenberg e9c58f6d55 COPYING: fix grammar of referring phrase, and indicate location better
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:38:39 +02:00
Karel Zak 03d00d495f build-sys: add CFLAGS and LDFLAGS for daemons and shared libs
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>
2013-08-27 11:49:01 +02:00
Sami Kerola f014c1c259 docs: remove repeated words [checkmans.sh]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:48 +02:00
Karel Zak a61cac5b64 libuuid: use O_CLOEXEC
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-03 16:13:55 +02:00
Karel Zak d4baf92e50 build-sys: expand paths at make time
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>
2012-08-15 02:06:53 +02:00
Karel Zak 922e6775e0 build-sys: move tests to check_PROGRAMS
Thanks to Mike Frysinger.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-30 17:59:16 +02:00
Karel Zak aa8135f81b build-sys: add minisg COPYING files
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-27 00:56:28 +02:00
Sami Kerola 80c51185d5 uuidd: use run configured state directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-10 12:59:38 +02:00
Karel Zak b36a2f2d47 build-sys: create static uuid_generate_*.3 files
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>
2012-06-26 20:50:54 +02:00
Karel Zak f38e5ff355 build-sys: cleanup .gitignore files
- move all binaries to top-level .gitignore
 - remove unnecessary */.gitignore files

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:50:54 +02:00
Karel Zak 3632ce21b7 build-sys: convert libuuid/ to module
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 17:37:37 +02:00
Karel Zak 1425948c8c uuidd: move from /var/run/uuidd to /run/uuidd
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-18 15:46:20 +02:00
Karel Zak 949b61c2b2 libuuid: move clock.txt path to header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-18 15:36:00 +02:00
Petr Uzel 96ce175801 libuuid: use max() from c.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:56:51 +02:00
Petr Uzel f80e9bc30a libuuid: move read_all to include/all-io.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15 11:32:36 +02:00
Petr Uzel c544aa2c25 libuuid: avoid double open and leaking fd (reworked)
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>
2012-05-10 11:43:49 +02:00
Petr Uzel 6126f7a53c libuuid: avoid double open and leaking descriptor
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>
2012-05-04 15:14:24 +02:00
Petr Uzel ea4f8845f0 libuuid: don't exec uuidd
Executing the daemon from the shared library is not quite elegant
solution. Drop this functionality and require uuidd (should it be
needed) to be started from the initscript or by socket-activation.

References: http://www.spinics.net/lists/util-linux-ng/msg05967.html

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:14:18 +02:00
Petr Uzel 7ec85b5b71 libuuid: use EXIT_FAILURE
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:14:14 +02:00
Petr Uzel e584fa80d7 libuuid: fix typo in uuid_compare manpage
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:42 +02:00
Karel Zak 94988fc902 libuuid: use get_fd_tabsize()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-23 14:00:18 +02:00
Davidlohr Bueso b2244df618 libuuid: use randutils
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-10 13:15:35 +02:00
Sami Kerola f06b43285d build-sys: enhance readability of the autotools files
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>
2012-02-28 13:29:35 +01:00
Karel Zak 8890b9138b libuuid: fix includes in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-03 12:32:51 +01:00
maximilian attems 8f4bdfaced libuuid: add limits.h include for OPEN_MAX
Needed as definition for usage in close_all_fds().
Noticed on klibc build.

Signed-off-by: maximilian attems <max@stro.at>
2011-09-07 07:45:52 +02:00
Sami Kerola ce0efc40a1 docs: remove duplicated text
Duplicate text is dealt by referring to license files. The `pg'
command does not need separated license file because the source
file has same text at top of it.

http://www.spinics.net/lists/util-linux-ng/msg05069.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-08-30 19:50:34 +02:00
Sami Kerola f98d4f766e docs: Documentation directory added
Move readme, licence, change log, relese notes and other
supplementary files to a Documentation directory. This commit
does not change contents of any other but few Makefile.am files.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-08-12 20:19:52 +02:00
Karel Zak 83d20837dc build-sys: use top-level directory for libuuid rather than shlibs/uuid
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-09 21:54:05 +02:00