Project

General

Profile

Actions

Bug #5293

open

cppcheck: "portability" warnings: non thread-safe functions

Added by Victor Julien over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

src/log-pcap.c:815:32: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
        struct dirent *entry = readdir(dir);
                               ^
src/source-pcap-file-directory-helper.c:320:19: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
    while ((dir = readdir(pv->directory)) != NULL) {
                  ^
src/source-pcap-file-directory-helper.c:505:39: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
    uint32_t poll_seconds = (uint32_t)localtime(&ptv->poll_interval)->tm_sec;
                                      ^
src/util-plugin.c:113:29: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [readdirCalled]
            while ((entry = readdir(dir)) != NULL) {
                            ^
src/util-privs.c:160:14: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [getpwuidCalled]
        pw = getpwuid(userid);
             ^
src/util-privs.c:166:14: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [getpwnamCalled]
        pw = getpwnam(user_name);
             ^
src/util-privs.c:183:18: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [getgrnamCalled]
            gp = getgrnam(group_name);
                 ^
src/util-privs.c:224:14: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [getgrnamCalled]
        gp = getgrnam(group_name);
             ^

No data to display

Actions

Also available in: Atom PDF