aboutsummaryrefslogtreecommitdiffstats
path: root/main/go/default-sc-getpw-r-size-max.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-15 11:14:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-15 11:14:34 +0000
commit496d35cebf920bed938a4cde8995e43bfc693d21 (patch)
treef20d4d0a2077074d6a549ad229860cd8ce0290d7 /main/go/default-sc-getpw-r-size-max.patch
parent886cdb13df9d53858fead63397547357770eb638 (diff)
downloadaports-496d35cebf920bed938a4cde8995e43bfc693d21.tar.bz2
aports-496d35cebf920bed938a4cde8995e43bfc693d21.tar.xz
main/go: moved from testing
Diffstat (limited to 'main/go/default-sc-getpw-r-size-max.patch')
-rw-r--r--main/go/default-sc-getpw-r-size-max.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/go/default-sc-getpw-r-size-max.patch b/main/go/default-sc-getpw-r-size-max.patch
new file mode 100644
index 0000000000..48ba01b6f4
--- /dev/null
+++ b/main/go/default-sc-getpw-r-size-max.patch
@@ -0,0 +1,15 @@
+--- a/src/pkg/os/user/lookup_unix.go
++++ b/src/pkg/os/user/lookup_unix.go
+@@ -57,6 +57,12 @@
+ bufSize = 1024
+ } else {
+ bufSize = C.sysconf(C._SC_GETPW_R_SIZE_MAX)
++ // The musl alternative standard library on Linux
++ // return -1 as specified by POSIX if there are no
++ // hard limit on _SC_GETPW_R_SIZE_MAX.
++ if bufSize == -1 {
++ bufSize = 1024
++ }
+ if bufSize <= 0 || bufSize > 1<<20 {
+ return nil, fmt.Errorf("user: unreasonable _SC_GETPW_R_SIZE_MAX of %d", bufSize)
+ }