Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Pirogov
aports
Commits
20745a97
Commit
20745a97
authored
7 years ago
by
Ariadne Conill
Browse files
Options
Downloads
Patches
Plain Diff
main/musl: make alpine + kubernetes DNS great again
parent
c550d9a4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main/musl/1000-resolv.conf-shenanigans.patch
+67
-0
67 additions, 0 deletions
main/musl/1000-resolv.conf-shenanigans.patch
main/musl/APKBUILD
+3
-1
3 additions, 1 deletion
main/musl/APKBUILD
with
70 additions
and
1 deletion
main/musl/1000-resolv.conf-shenanigans.patch
0 → 100644
+
67
−
0
View file @
20745a97
From b5fd71a0dfb8e7e32a46458abe701f7cd8ebc77b Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Fri, 30 Mar 2018 10:45:01 +0000
Subject: [PATCH] resolv.conf parser: concatenate multiple search domain lines
Programs such as Docker and Kubernetes write multiple domain search lines, such as
search serious-business.big-data.prod.foo.com
search big-data.prod.foo.com
search prod.foo.com
instead of
search serious-business.big-data.prod.foo.com big-data.prod.foo.com prod.foo.com
Accordingly, we concatenate the namelist together so that the search path is
not truncated.
(Sorry, not sorry, for ruining the "omg Alpine sucks at DNS" talk at Kubecon)
---
src/network/lookup_name.c | 2 +-
src/network/resolvconf.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c
index 209c20f0..c83c11c5 100644
--- a/src/network/lookup_name.c
+++ b/src/network/lookup_name.c
@@ -172,7 +172,7 @@
static int name_from_dns(struct address buf[static MAXADDRS], char canon[static
static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family)
{
- char search[256];
+ char search[2048];
struct resolvconf conf;
size_t l, dots;
char *p, *z;
diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c
index 4c3e4c4b..72ed4082 100644
--- a/src/network/resolvconf.c
+++ b/src/network/resolvconf.c
@@ -9,6 +9,7 @@
int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
{
char line[256];
unsigned char _buf[256];
+ char *search_base = search;
FILE *f, _f;
int nns = 0;
@@ -74,9 +75,13 @@
int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
continue;
for (p=line+7; isspace(*p); p++);
size_t l = strlen(p);
+ ptrdiff_t m = search - search_base;
/* This can never happen anyway with chosen buffer sizes. */
- if (l >= search_sz) continue;
+ if (l + m >= search_sz) continue;
memcpy(search, p, l+1);
+ /* We concatenate the search list as domain1 domain2\0 */
+ search += l;
+ *search++ = ' ';
}
__fclose_ca(f);
--
2.16.2
This diff is collapsed.
Click to expand it.
main/musl/APKBUILD
+
3
−
1
View file @
20745a97
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname
=
musl
pkgname
=
musl
pkgver
=
1.1.19
pkgver
=
1.1.19
pkgrel
=
1
pkgrel
=
2
pkgdesc
=
"the musl c library (libc) implementation"
pkgdesc
=
"the musl c library (libc) implementation"
url
=
"http://www.musl-libc.org/"
url
=
"http://www.musl-libc.org/"
arch
=
"all"
arch
=
"all"
...
@@ -19,6 +19,7 @@ esac
...
@@ -19,6 +19,7 @@ esac
source
=
"http://www.musl-libc.org/releases/musl-
$pkgver
.tar.gz
source
=
"http://www.musl-libc.org/releases/musl-
$pkgver
.tar.gz
0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
1000-resolv.conf-shenanigans.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
handle-aux-at_base.patch
handle-aux-at_base.patch
...
@@ -147,6 +148,7 @@ compat() {
...
@@ -147,6 +148,7 @@ compat() {
sha512sums
=
"abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz
sha512sums
=
"abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz
7a6480c454ad25d156727818cf61961880e526abcb00382ed81e40256ac5b06af546837652e47187132d64c261d9f01ce91a952762afd439a8faf5825306a880 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
7a6480c454ad25d156727818cf61961880e526abcb00382ed81e40256ac5b06af546837652e47187132d64c261d9f01ce91a952762afd439a8faf5825306a880 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
1c649ebd4814ee22364d8766fdf93732e0c0c54361fcfcc994be254b52e9beb276fca5031a1cef9d4f971c96dc3d3774a1738ba3a38263d8e139ea3947c9b7c3 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
1c649ebd4814ee22364d8766fdf93732e0c0c54361fcfcc994be254b52e9beb276fca5031a1cef9d4f971c96dc3d3774a1738ba3a38263d8e139ea3947c9b7c3 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
1d1623ceb8c6c873356ce59c60fd5f15960895daa0257a85fdcb296ce64f2232ac43112b4e4ad93fe803a733777319aade7222d9340815ac1154e011d8f634e2 1000-resolv.conf-shenanigans.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment