• Emanuele Aina's avatar
    Make the homedir overridable with the NSS_UNKNOWN_HOME env var · 2017608f
    Emanuele Aina authored
    By default `libnss-unknown` violates the assumption that the result of
    calling `getpwent()`/`getpwuid()` does not change when the environment
    changes as the value for the `pw_dir` field depends on the `$HOME` var.
    
    For instance the `posix/wordexp-test` test in the glibc testsuite
    breaks with `libnss-unknown`:
    
    * the call to `getpwuid()` with `HOME=/dummy/home` returns
      `/dummy/home` due to `libnss-unknown`
    * `unsetenv ("HOME")` is called
    * any call to `getpwuid()` will now return `/` due to
      `libnss-unknown` as no `$HOME` is set
    * test fails because results don't match
    
    Setting `NSS_UNKNOWN_HOME` before running the test will get rid of the
    dependency between `getpwuid()` and `$HOME`.
    Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
    2017608f
resolve-unknown-current-user.t 2 KB