Skip to content
  • Dyre Tjeldvoll's avatar
    e5605ed3
    Bug#11762203: GETPWNAM USED IN A THREADED CODE · e5605ed3
    Dyre Tjeldvoll authored
    Problem: The POSIX functions getpwnam() and getpwuid() are not
    guaranteed to be thread safe. And as the synopsis indicates, they were
    being called after the server has spawned additional threads.
    
    Solution: Write wrapper functions around the thread-safe versions
    getpwnam_r() and getpwuid_r() which returns the passwd information in
    an object with value semantics so that it can be safely copied,
    assigned and stored.
    
    Change-Id: I8aebe94c46f5d8be69a129dd89c40f181ad16187
    (cherry picked from commit 741add8e7570834614ff8b8317d0911a9a320861)
    e5605ed3
    Bug#11762203: GETPWNAM USED IN A THREADED CODE
    Dyre Tjeldvoll authored
    Problem: The POSIX functions getpwnam() and getpwuid() are not
    guaranteed to be thread safe. And as the synopsis indicates, they were
    being called after the server has spawned additional threads.
    
    Solution: Write wrapper functions around the thread-safe versions
    getpwnam_r() and getpwuid_r() which returns the passwd information in
    an object with value semantics so that it can be safely copied,
    assigned and stored.
    
    Change-Id: I8aebe94c46f5d8be69a129dd89c40f181ad16187
    (cherry picked from commit 741add8e7570834614ff8b8317d0911a9a320861)
Loading