[Bugs] [Bug 1356998] syscalls: readdir_r() is deprecated in newer glibc

bugzilla at redhat.com bugzilla at redhat.com
Mon Jul 18 11:59:46 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1356998



--- Comment #5 from Vijay Bellur <vbellur at redhat.com> ---
COMMIT: http://review.gluster.org/14838 committed in master by Jeff Darcy
(jdarcy at redhat.com) 
------
commit 561746080b0b7154bfb3bdee20d426cf2ef7db17
Author: Kaleb S. KEITHLEY <kkeithle at redhat.com>
Date:   Thu Jul 7 08:51:08 2016 -0400

    core: use readdir(3) with glibc, and associated cleanup

    Starting with glibc-2.23 (i.e. what's in Fedora 25), readdir_r(3)
    is marked as deprecated. Specifically the function decl in <dirent.h>
    has the deprecated attribute, and now warnings are thrown during the
    compile on Fedora 25 builds.

    The readdir(_r)(3) man page (on Fedora 25 at least) and World+Dog say
    that glibc's readdir(3) is, and always has been, MT-SAFE as long as
    only one thread is accessing the directory object returned by opendir().
    World+Dog also says there is a potential buffer overflow in readdir_r().
    World+Dog suggests that it is preferable to simply use readdir(). There's
    an implication that eventually readdir_r(3) will be removed from glibc.
    POSIX has, apparently deprecated it in the standard, or even removed it
    entirely.

    Over and above that, our source near the various uses of readdir(_r)(3)
    has a few unsafe uses of strcpy()+strcat().

    (AFAIK nobody has looked at the readdir(3) implemenation in *BSD to see
    if the same is true on those platforms, and we can't be sure of MacOS
    even though we know it's based on *BSD.)

    Change-Id: I5481f18ba1eebe7ee177895eecc9a80a71b60568
    BUG: 1356998
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle at redhat.com>
    Reviewed-on: http://review.gluster.org/14838
    Smoke: Gluster Build System <jenkins at build.gluster.org>
    Reviewed-by: Niels de Vos <ndevos at redhat.com>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
    NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
    Reviewed-by: Kotresh HR <khiremat at redhat.com>
    Reviewed-by: Jeff Darcy <jdarcy at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=THS2pUXMt6&a=cc_unsubscribe


More information about the Bugs mailing list