1. 13 9月, 2018 1 次提交
  2. 22 6月, 2017 1 次提交
  3. 16 6月, 2017 1 次提交
    • R
      set errno when getpw*_r, getgr*_r, and getspnam_r fail · 2d7d05f0
      Rich Felker 提交于
      these functions return an error code, and are not explicitly
      documented to set errno, but they are nonstandard and the historical
      implementations do set errno as well, and some applications expect
      this behavior. do likewise for compatibility.
      
      patch by Rudolph Pereira.
      2d7d05f0
  4. 14 7月, 2016 2 次提交
  5. 10 6月, 2015 1 次提交
    • R
      fix spurious errors from pwd/grp functions when nscd backend is absent · bd1eacea
      Rich Felker 提交于
      for several pwd/grp functions, the only way the caller can distinguish
      between a successful negative result ("no such user/group") and an
      internal error is by clearing errno before the call and checking errno
      afterwards. the nscd backend support code correctly simulated a
      not-found response on systems where such a backend is not running, but
      failed to restore errno.
      
      this commit also fixed an outdated/incorrect comment.
      bd1eacea
  6. 02 5月, 2015 1 次提交
    • R
      fix mishandling of ENOMEM return case in internal getgrent_a function · 58fa8569
      Rich Felker 提交于
      due to an incorrect return statement in this error case, the
      previously blocked cancellation state was not restored and no result
      was stored. this could lead to invalid (read) accesses in the caller
      resulting in crashes or nonsensical result data in the event of memory
      exhaustion.
      58fa8569
  7. 16 3月, 2015 3 次提交
    • R
      avoid sending huge names as nscd passwd/group queries · 4b5ca13f
      Rich Felker 提交于
      overly long user/group names are potentially a DoS vector and source
      of other problems like partial writes by sendmsg, and not useful.
      4b5ca13f
    • R
      simplify nscd lookup code for alt passwd/group backends · 49d1e7f9
      Rich Felker 提交于
      previously, a sentinel value of (FILE *)-1 was used to inform the
      caller of __nscd_query that nscd is not in use. aside from being an
      ugly hack, this resulted in duplicate code paths for two logically
      equivalent cases: no nscd, and "not found" result from nscd.
      
      now, __nscd_query simply skips closing the socket and returns a valid
      FILE pointer when nscd is not in use, and produces a fake "not found"
      response header. the caller is then responsible for closing the socket
      just like it would do if it had gotten a real "not found" response.
      49d1e7f9
    • J
      add alternate backend support for getgrouplist · 2894a44b
      Josiah Worcester 提交于
      This completes the alternate backend support that was previously added
      to the getpw* and getgr* functions. Unlike those, though, it
      unconditionally queries nscd. Any groups from nscd that aren't in the
      /etc/groups file are added to the returned list, and any that are
      present in the file are ignored. The purpose of this behavior is to
      provide a view of the group database consistent with what is observed
      by the getgr* functions. If group memberships reported by nscd were
      honored when the corresponding group already has a definition in the
      /etc/groups file, the user's getgrouplist-based membership in the
      group would conflict with their non-membership in the reported
      gr_mem[] for the group.
      
      The changes made also make getgrouplist thread-safe and eliminate its
      clobbering of the global getgrent state.
      2894a44b
  8. 23 2月, 2015 3 次提交
    • J
      support alternate backends for the passwd and group dbs · 34b423d2
      Josiah Worcester 提交于
      when we fail to find the entry in the commonly accepted files,  we
      query a server over a Unix domain socket on /var/run/nscd/socket.
      the protocol used here is compatible with glibc's nscd protocol on
      most systems (all that use 32-bit numbers for all the protocol fields,
      which appears to be everything but Alpha).
      34b423d2
    • R
      fix spurious errors in refactored passwd/group code · 0afef1aa
      Rich Felker 提交于
      errno was treated as the error status when the return value of getline
      was negative, but this condition can simply indicate EOF and is not
      necessarily an error.
      
      the spurious errors caused by this bug masked the bug which was fixed
      in commit fc5a96c9.
      0afef1aa
    • R
      fix crashes in refactored passwd/group code · fc5a96c9
      Rich Felker 提交于
      the wrong condition was used in determining the presence of a result
      that needs space/copying for the _r functions. a zero return value
      does not necessarily mean success; it can also be a non-error negative
      result: no such user/group.
      fc5a96c9
  9. 13 2月, 2015 1 次提交
  10. 11 2月, 2015 1 次提交
  11. 22 1月, 2015 1 次提交
    • R
      fix erroneous return of partial username matches by getspnam[_r] · ecb60819
      Rich Felker 提交于
      when using /etc/shadow (rather than tcb) as its backend, getspnam_r
      matched any username starting with the caller-provided string rather
      than requiring an exact match. in practice this seems to have affected
      only systems where one valid username is a prefix for another valid
      username, and where the longer username appears first in the shadow
      file.
      ecb60819
  12. 12 12月, 2013 1 次提交
  13. 25 11月, 2013 2 次提交
  14. 24 11月, 2013 3 次提交
  15. 29 9月, 2013 1 次提交
  16. 19 7月, 2013 1 次提交
    • R
      change uid_t, gid_t, and id_t to unsigned types · 648c3b4e
      Rich Felker 提交于
      this change is both to fix one of the remaining type (and thus C++
      ABI) mismatches with glibc/LSB and to allow use of the full range of
      uid and gid values, if so desired.
      
      passwd/group access functions were not prepared to deal with unsigned
      values, so they too have been fixed with this commit.
      648c3b4e
  17. 05 4月, 2013 1 次提交
    • R
      add put*ent functions for passwd/group files and similar for shadow · ddfb267b
      Rich Felker 提交于
      since shadow does not yet support enumeration (getspent), the
      corresponding FILE-based get and put versions are also subbed out for
      now. this is partly out of laziness and partly because it's not clear
      how they should work in the presence of TCB shadow files. the stubs
      should make it possible to compile some software that expects them to
      exist, but such software still may not work properly.
      ddfb267b
  18. 18 2月, 2013 1 次提交
    • R
      add fgetgrent function · cac87295
      Rich Felker 提交于
      based on patch by Isaac Dunham, moved to its own file to avoid
      increasing bss on static linked programs not using this nonstandard
      function but using the standard getgrent function, and vice versa.
      cac87295
  19. 30 9月, 2012 1 次提交
  20. 02 2月, 2012 1 次提交
  21. 30 1月, 2012 1 次提交
  22. 28 9月, 2011 1 次提交
  23. 22 9月, 2011 1 次提交
  24. 30 6月, 2011 1 次提交
  25. 09 6月, 2011 1 次提交
  26. 21 4月, 2011 1 次提交
  27. 15 2月, 2011 1 次提交
  28. 12 2月, 2011 1 次提交