patch-ext_etc_etc_c 799 B

12345678910111213141516171819202122232425
  1. $OpenBSD: patch-ext_etc_etc_c,v 1.1 2016/07/15 15:39:04 jeremy Exp $
  2. Use shadow versions of password functions.
  3. --- ext/etc/etc.c.orig Tue Jul 12 11:14:25 2016
  4. +++ ext/etc/etc.c Tue Jul 12 11:15:05 2016
  5. @@ -187,7 +187,7 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
  6. else {
  7. uid = getuid();
  8. }
  9. - pwd = getpwuid(uid);
  10. + pwd = getpwuid_shadow(uid);
  11. if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %d", (int)uid);
  12. return setup_passwd(pwd);
  13. #else
  14. @@ -217,7 +217,7 @@ etc_getpwnam(VALUE obj, VALUE nam)
  15. struct passwd *pwd;
  16. SafeStringValue(nam);
  17. - pwd = getpwnam(RSTRING_PTR(nam));
  18. + pwd = getpwnam_shadow(RSTRING_PTR(nam));
  19. if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %"PRIsVALUE, nam);
  20. return setup_passwd(pwd);
  21. #else