[Bug 856915] New: devel:libraries:c_c++/libgcrypt: Bug
https://bugzilla.novell.com/show_bug.cgi?id=856915
https://bugzilla.novell.com/show_bug.cgi?id=856915#c0
Summary: devel:libraries:c_c++/libgcrypt: Bug
Classification: openSUSE
Product: openSUSE.org
Version: unspecified
Platform: Other
OS/Version: Other
Status: ASSIGNED
Severity: Normal
Priority: P5 - None
Component: 3rd party software
AssignedTo: mvyskocil@suse.com
ReportedBy: tcech@suse.com
QAContact: opensuse-communityscreening@forge.provo.novell.com
CC: crrodriguez@opensuse.org
Found By: L3
Blocker: ---
I'm playing a bit with gnunet which was released few days ago. It requires
libgcrypt >= 1.6.0 so I took the version which was in devel:libraries:c_c++.
When I tried first run of gnunet-arm, it failed with weird message:
Fatal: can't open /dev/urandom: No such file or directory
Some digging revealed failure in open_device() function (libgcrypt):
#0 0x00007ffff75fc849 in raise () from /lib64/libc.so.6
#1 0x00007ffff75fdcd8 in abort () from /lib64/libc.so.6
#2 0x00007ffff72f3b04 in _gcry_logv (level=level@entry=40,
fmt=fmt@entry=0x7ffff73ae595 "can't open %s: %s\n",
arg_ptr=arg_ptr@entry=0x7fffffffd678) at misc.c:142
#3 0x00007ffff72f3e74 in _gcry_log_fatal (fmt=fmt@entry=0x7ffff73ae595 "can't
open %s: %s\n") at misc.c:230
#4 0x00007ffff73868ed in open_device (name=0x7ffff73adf1f "/dev/urandom",
retry=<optimized out>, fatal=1) at rndlinux.c:83
#5 0x00007ffff7386c88 in _gcry_rndlinux_gather_random (add=0x7ffff7383df0
https://bugzilla.novell.com/show_bug.cgi?id=856915
https://bugzilla.novell.com/show_bug.cgi?id=856915#c1
Michal Vyskocil
Lines 81-85 looks suspicious, these changes are from one chunk of libgcrypt-1.5.0-etc_gcrypt_rngseed-symlink.diff:
- if (fd == -1) - log_fatal ("can't open %s: %s\n", name, strerror(errno) ); + { + if (fatal) + log_fatal ("can't open %s: %s\n", name, strerror(errno) ); + return fd; + }
Is this really correct? It causes that lines 87+ are never run.
No, this code belongs to if (fd == -1) branch, so my bad. I've commited fixes version of it to d:l:c_c++/libgcrypt. The relevant part now look like - if (fd == -1 && retry) - { + if (fd == -1) { + if (retry) + { struct timeval tv; tv.tv_sec = 5; @@ -76,9 +78,14 @@ open_device (const char *name, int retry _gcry_random_progress ("wait_dev_random", 'X', 0, (int)tv.tv_sec); select (0, NULL, NULL, NULL, &tv); goto again; - } - if (fd == -1) - log_fatal ("can't open %s: %s\n", name, strerror(errno) ); + } + else + { + if (fatal) + log_fatal ("can't open %s: %s\n", name, strerror(errno) ); + return fd; + } + } So the return fd is called only if fd == -1 (and retry is not specified). This matches the original behavior. Please test. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=856915
https://bugzilla.novell.com/show_bug.cgi?id=856915#c2
Tomas Cech
https://bugzilla.novell.com/show_bug.cgi?id=856915
https://bugzilla.novell.com/show_bug.cgi?id=856915#c3
Michal Vyskocil
participants (1)
-
bugzilla_noreply@novell.com