summaryrefslogtreecommitdiffstats
path: root/libuuid/src/gen_uuid.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: fix some printf format stringsRuediger Meier2016-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libuuid: fix buffer overflow with long pathsKarel Zak2015-09-301-1/+6
| | | | | | | | | | 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>
* libuuid: return correct value for uuid_generate_time_safeRomain Bouvier2015-06-181-0/+3
| | | | | | | | | | 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>
* libuuid: remove _SVID_SOURCE pre-processor definitionSami Kerola2014-10-011-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | 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>
* libuuid: use O_CLOEXECKarel Zak2013-04-031-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libuuid: move clock.txt path to header fileKarel Zak2012-06-181-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libuuid: use max() from c.hPetr Uzel2012-05-231-3/+1Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: move read_all to include/all-io.hPetr Uzel2012-05-151-25/+1Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: avoid double open and leaking fd (reworked)Petr Uzel2012-05-101-10/+18
| | | | | | | | | | | | | | This reverts commit 6126f7a53c57485a9a29ddd772765695f23c92e6 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>
* libuuid: avoid double open and leaking descriptorPetr Uzel2012-05-041-7/+10
| | | | | | | | | | | | | 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>
* libuuid: don't exec uuiddPetr Uzel2012-05-041-45/+3Star
| | | | | | | | | | 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>
* libuuid: use EXIT_FAILUREPetr Uzel2012-05-041-1/+1
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libuuid: use get_fd_tabsize()Karel Zak2012-04-231-14/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libuuid: use randutilsDavidlohr Bueso2012-04-101-94/+5Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* libuuid: add limits.h include for OPEN_MAXmaximilian attems2011-09-071-0/+1
| | | | | | | Needed as definition for usage in close_all_fds(). Noticed on klibc build. Signed-off-by: maximilian attems <max@stro.at>
* build-sys: use top-level directory for libuuid rather than shlibs/uuidKarel Zak2011-06-091-0/+709
Signed-off-by: Karel Zak <kzak@redhat.com>