getpwnam -> getpwnam_shadow

This commit is contained in:
jasper
2015-11-19 15:01:47 +00:00
parent bb2c751613
commit 6de6fdd75b
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.10 2015/10/09 07:06:35 jasper Exp $
# $OpenBSD: Makefile,v 1.11 2015/11/19 15:01:47 jasper Exp $
COMMENT = module to access shadow passwords
DISTNAME = ruby-shadow-2.5.0
PKGNAME = ${DISTNAME:S/ruby-//}
REVISION = 0
CATEGORIES = sysutils
MAINTAINER = Jasper Lievisse Adriaanse <jasper@openbsd.org>
@@ -0,0 +1,15 @@
$OpenBSD: patch-pwd_shadow_c,v 1.6 2015/11/19 15:01:47 jasper Exp $
--- pwd/shadow.c.orig Thu Nov 19 15:51:37 2015
+++ pwd/shadow.c Thu Nov 19 15:56:27 2015
@@ -92,7 +92,11 @@ rb_shadow_getspnam(VALUE self, VALUE name)
if( TYPE(name) != T_STRING )
rb_raise(rb_eException,"argument must be a string.");
+#ifdef __OpenBSD__
+ entry = getpwnam_shadow(StringValuePtr(name));
+#else
entry = getpwnam(StringValuePtr(name));
+#endif
if( entry == NULL )
return Qnil;