Skip to content

Commit d1415bc

Browse files
snap for release 02/11/2023
2 parents c0958b0 + 20f96bc commit d1415bc

211 files changed

Lines changed: 7453 additions & 5000 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
/SPECS/kernel-headers/* @microsoft/cbl-mariner-kernel
2222
/SPECS/kernel-mshv/* @microsoft/cbl-mariner-kata-containers
2323
/SPECS/kernel-uvm/* @microsoft/cbl-mariner-kata-containers
24-
/SPECS/kernel-uvm-cvm/* @microsoft/cbl-mariner-kata-containers
2524
/SPECS-SIGNED/kernel-signed/* @microsoft/cbl-mariner-kernel
2625
/SPECS-SIGNED/kernel-hci-signed/* @microsoft/cbl-mariner-kernel
2726
/SPECS-SIGNED/kernel-azure-signed/* @microsoft/cbl-mariner-kernel

SPECS-EXTENDED/buildah/buildah.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Summary: A command line tool used for creating OCI Images
2222
Name: buildah
2323
Version: 1.18.0
24-
Release: 21%{?dist}
24+
Release: 22%{?dist}
2525
License: ASL 2.0
2626
Vendor: Microsoft Corporation
2727
Distribution: Mariner
@@ -123,6 +123,9 @@ cp imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
123123
%{_datadir}/%{name}/test
124124

125125
%changelog
126+
* Fri Feb 02 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.18.0-22
127+
- Bump release to rebuild with go 1.21.6
128+
126129
* Wed Oct 18 2023 Minghe Ren <mingheren@microsoft.com> - 1.18.0-21
127130
- Bump release to rebuild against glibc 2.35-6
128131

SPECS-EXTENDED/containernetworking-plugins/containernetworking-plugins.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
Name: %{project}-%{repo}
2626
Version: 1.1.1
27-
Release: 13%{?dist}
27+
Release: 14%{?dist}
2828
Summary: Libraries for writing CNI plugin
2929
License: ASL 2.0 and BSD and MIT
3030
Vendor: Microsoft Corporation
@@ -129,6 +129,9 @@ install -p plugins/ipam/dhcp/systemd/cni-dhcp.socket %{buildroot}%{_unitdir}
129129
%{_unitdir}/cni-dhcp.socket
130130

131131
%changelog
132+
* Fri Feb 02 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.1.1-14
133+
- Bump release to rebuild with go 1.21.6
134+
132135
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.1.1-13
133136
- Bump release to rebuild with go 1.20.9
134137

SPECS-EXTENDED/delve/delve.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Vendor: Microsoft Corporation
22
Distribution: Mariner
33
Name: delve
44
Version: 1.5.0
5-
Release: 16%{?dist}
5+
Release: 17%{?dist}
66
Summary: A debugger for the Go programming language
77

88
License: MIT
@@ -72,6 +72,9 @@ done
7272

7373

7474
%changelog
75+
* Fri Feb 02 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.5.0-17
76+
- Bump release to rebuild with go 1.21.6
77+
7578
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.5.0-16
7679
- Bump release to rebuild with go 1.20.9
7780

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
From 6ff47454ff413e3033a77d4d9c09b914c78ab3a0 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
3+
Date: Wed, 7 Dec 2022 22:56:47 +0100
4+
Subject: [PATCH] Add unit test parts for new autodetection
5+
6+
Use new enum to specify forced present or missing .local SOA record. Use
7+
from production code auto value, but use forced values from unit test.
8+
Add few different results to unit test.
9+
---
10+
src/nss.c | 3 ++-
11+
src/util.c | 7 +++++--
12+
src/util.h | 9 ++++++++-
13+
tests/check_util.c | 18 ++++++++++++++++++
14+
4 files changed, 33 insertions(+), 4 deletions(-)
15+
16+
diff --git a/src/nss.c b/src/nss.c
17+
index 7f9230e..2e1a90b 100644
18+
--- a/src/nss.c
19+
+++ b/src/nss.c
20+
@@ -118,7 +118,8 @@ enum nss_status _nss_mdns_gethostbyname_impl(const char* name, int af,
21+
#ifndef MDNS_MINIMAL
22+
mdns_allow_file = fopen(MDNS_ALLOW_FILE, "r");
23+
#endif
24+
- result = verify_name_allowed_with_soa(name, mdns_allow_file);
25+
+ result = verify_name_allowed_with_soa(name, mdns_allow_file,
26+
+ TEST_LOCAL_SOA_AUTO);
27+
#ifndef MDNS_MINIMAL
28+
if (mdns_allow_file)
29+
fclose(mdns_allow_file);
30+
diff --git a/src/util.c b/src/util.c
31+
index 4eacf07..0a1c28a 100644
32+
--- a/src/util.c
33+
+++ b/src/util.c
34+
@@ -55,14 +55,17 @@ int ends_with(const char* name, const char* suffix) {
35+
return strcasecmp(name + ln - ls, suffix) == 0;
36+
}
37+
38+
-use_name_result_t verify_name_allowed_with_soa(const char* name, FILE* mdns_allow_file) {
39+
+use_name_result_t verify_name_allowed_with_soa(const char* name,
40+
+ FILE* mdns_allow_file,
41+
+ test_local_soa_t test) {
42+
switch (verify_name_allowed(name, mdns_allow_file)) {
43+
case VERIFY_NAME_RESULT_NOT_ALLOWED:
44+
return USE_NAME_RESULT_SKIP;
45+
case VERIFY_NAME_RESULT_ALLOWED:
46+
return USE_NAME_RESULT_AUTHORITATIVE;
47+
case VERIFY_NAME_RESULT_ALLOWED_IF_NO_LOCAL_SOA:
48+
- if (local_soa())
49+
+ if (test == TEST_LOCAL_SOA_YES ||
50+
+ (test == TEST_LOCAL_SOA_AUTO && local_soa()) )
51+
/* Make multicast resolution not authoritative for .local zone.
52+
* Allow continuing to unicast resolution after multicast had not worked. */
53+
return USE_NAME_RESULT_OPTIONAL;
54+
diff --git a/src/util.h b/src/util.h
55+
index 76809d4..80527e3 100644
56+
--- a/src/util.h
57+
+++ b/src/util.h
58+
@@ -67,6 +67,12 @@ typedef enum {
59+
USE_NAME_RESULT_OPTIONAL,
60+
} use_name_result_t;
61+
62+
+typedef enum {
63+
+ TEST_LOCAL_SOA_NO,
64+
+ TEST_LOCAL_SOA_YES,
65+
+ TEST_LOCAL_SOA_AUTO,
66+
+} test_local_soa_t;
67+
+
68+
// Returns true if we should try to resolve the name with mDNS.
69+
//
70+
// If mdns_allow_file is NULL, then this implements the "local" SOA
71+
@@ -78,7 +84,8 @@ typedef enum {
72+
// The two heuristics described above are disabled if mdns_allow_file
73+
// is not NULL.
74+
use_name_result_t verify_name_allowed_with_soa(const char* name,
75+
- FILE* mdns_allow_file);
76+
+ FILE* mdns_allow_file,
77+
+ test_local_soa_t test);
78+
79+
typedef enum {
80+
VERIFY_NAME_RESULT_NOT_ALLOWED,
81+
diff --git a/tests/check_util.c b/tests/check_util.c
82+
index d600a2e..36f1008 100644
83+
--- a/tests/check_util.c
84+
+++ b/tests/check_util.c
85+
@@ -50,6 +50,24 @@ START_TEST(test_verify_name_allowed_minimal) {
86+
VERIFY_NAME_RESULT_NOT_ALLOWED);
87+
ck_assert_int_eq(verify_name_allowed(".", NULL),
88+
VERIFY_NAME_RESULT_NOT_ALLOWED);
89+
+
90+
+ ck_assert_int_eq(verify_name_allowed_with_soa(".", NULL, TEST_LOCAL_SOA_YES),
91+
+ USE_NAME_RESULT_SKIP);
92+
+ ck_assert_int_eq(verify_name_allowed_with_soa(".", NULL, TEST_LOCAL_SOA_NO),
93+
+ USE_NAME_RESULT_SKIP);
94+
+ ck_assert_int_eq(verify_name_allowed_with_soa(".", NULL, TEST_LOCAL_SOA_AUTO),
95+
+ USE_NAME_RESULT_SKIP);
96+
+ ck_assert_int_eq(verify_name_allowed_with_soa("example3.sub.local",
97+
+ NULL, TEST_LOCAL_SOA_YES), USE_NAME_RESULT_SKIP);
98+
+ ck_assert_int_eq(verify_name_allowed_with_soa("example4.sub.local",
99+
+ NULL, TEST_LOCAL_SOA_NO), USE_NAME_RESULT_SKIP);
100+
+ ck_assert_int_eq(verify_name_allowed_with_soa("example4.sub.local",
101+
+ NULL, TEST_LOCAL_SOA_AUTO), USE_NAME_RESULT_SKIP);
102+
+ ck_assert_int_eq(verify_name_allowed_with_soa("example1.local",
103+
+ NULL, TEST_LOCAL_SOA_YES), USE_NAME_RESULT_OPTIONAL);
104+
+ ck_assert_int_eq(verify_name_allowed_with_soa("example2.local",
105+
+ NULL, TEST_LOCAL_SOA_NO), USE_NAME_RESULT_AUTHORITATIVE);
106+
+ /* TEST_LOCAL_SOA_AUTO would test actual DNS on host, skip that. */
107+
}
108+
END_TEST
109+
110+
--
111+
2.38.1
112+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
From 0cbe3ff2a64cdddbfb3884ccbe28be9f08077614 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
3+
Date: Tue, 6 Dec 2022 20:39:27 +0100
4+
Subject: [PATCH] Change .local domain heuristic
5+
6+
Previous way skipped all multicast queries when unicast DNS contains
7+
local. SOA record. Change that behaviour and always request multicast
8+
name. But if local SOA is present, then make missing multicast optional
9+
and continue to DNS plugin. That would make names ending with .local to
10+
take longer resolve on unicast DNS, but should still deliver the answer.
11+
---
12+
src/nss.c | 11 ++++++++---
13+
src/util.c | 15 ++++++++++-----
14+
src/util.h | 9 ++++++++-
15+
3 files changed, 26 insertions(+), 9 deletions(-)
16+
17+
diff --git a/src/nss.c b/src/nss.c
18+
index 93d140a..7f9230e 100644
19+
--- a/src/nss.c
20+
+++ b/src/nss.c
21+
@@ -85,8 +85,8 @@ enum nss_status _nss_mdns_gethostbyname_impl(const char* name, int af,
22+
userdata_t* u, int* errnop,
23+
int* h_errnop) {
24+
25+
- int name_allowed;
26+
FILE* mdns_allow_file = NULL;
27+
+ use_name_result_t result;
28+
29+
#ifdef NSS_IPV4_ONLY
30+
if (af == AF_UNSPEC) {
31+
@@ -118,13 +118,13 @@ enum nss_status _nss_mdns_gethostbyname_impl(const char* name, int af,
32+
#ifndef MDNS_MINIMAL
33+
mdns_allow_file = fopen(MDNS_ALLOW_FILE, "r");
34+
#endif
35+
- name_allowed = verify_name_allowed_with_soa(name, mdns_allow_file);
36+
+ result = verify_name_allowed_with_soa(name, mdns_allow_file);
37+
#ifndef MDNS_MINIMAL
38+
if (mdns_allow_file)
39+
fclose(mdns_allow_file);
40+
#endif
41+
42+
- if (!name_allowed) {
43+
+ if (result == USE_NAME_RESULT_SKIP) {
44+
*errnop = EINVAL;
45+
*h_errnop = NO_RECOVERY;
46+
return NSS_STATUS_UNAVAIL;
47+
@@ -137,6 +137,11 @@ enum nss_status _nss_mdns_gethostbyname_impl(const char* name, int af,
48+
case AVAHI_RESOLVE_RESULT_HOST_NOT_FOUND:
49+
*errnop = ETIMEDOUT;
50+
*h_errnop = HOST_NOT_FOUND;
51+
+ if (result == USE_NAME_RESULT_OPTIONAL) {
52+
+ /* continue to dns plugin if DNS .local zone is detected. */
53+
+ *h_errnop = TRY_AGAIN;
54+
+ return NSS_STATUS_UNAVAIL;
55+
+ }
56+
return NSS_STATUS_NOTFOUND;
57+
58+
case AVAHI_RESOLVE_RESULT_UNAVAIL:
59+
diff --git a/src/util.c b/src/util.c
60+
index d5e0290..4eacf07 100644
61+
--- a/src/util.c
62+
+++ b/src/util.c
63+
@@ -55,16 +55,21 @@ int ends_with(const char* name, const char* suffix) {
64+
return strcasecmp(name + ln - ls, suffix) == 0;
65+
}
66+
67+
-int verify_name_allowed_with_soa(const char* name, FILE* mdns_allow_file) {
68+
+use_name_result_t verify_name_allowed_with_soa(const char* name, FILE* mdns_allow_file) {
69+
switch (verify_name_allowed(name, mdns_allow_file)) {
70+
case VERIFY_NAME_RESULT_NOT_ALLOWED:
71+
- return 0;
72+
+ return USE_NAME_RESULT_SKIP;
73+
case VERIFY_NAME_RESULT_ALLOWED:
74+
- return 1;
75+
+ return USE_NAME_RESULT_AUTHORITATIVE;
76+
case VERIFY_NAME_RESULT_ALLOWED_IF_NO_LOCAL_SOA:
77+
- return !local_soa();
78+
+ if (local_soa())
79+
+ /* Make multicast resolution not authoritative for .local zone.
80+
+ * Allow continuing to unicast resolution after multicast had not worked. */
81+
+ return USE_NAME_RESULT_OPTIONAL;
82+
+ else
83+
+ return USE_NAME_RESULT_AUTHORITATIVE;
84+
default:
85+
- return 0;
86+
+ return USE_NAME_RESULT_SKIP;
87+
}
88+
}
89+
90+
diff --git a/src/util.h b/src/util.h
91+
index 218c094..76809d4 100644
92+
--- a/src/util.h
93+
+++ b/src/util.h
94+
@@ -61,6 +61,12 @@ char* buffer_strdup(buffer_t* buf, const char* str);
95+
int set_cloexec(int fd);
96+
int ends_with(const char* name, const char* suffix);
97+
98+
+typedef enum {
99+
+ USE_NAME_RESULT_SKIP,
100+
+ USE_NAME_RESULT_AUTHORITATIVE,
101+
+ USE_NAME_RESULT_OPTIONAL,
102+
+} use_name_result_t;
103+
+
104+
// Returns true if we should try to resolve the name with mDNS.
105+
//
106+
// If mdns_allow_file is NULL, then this implements the "local" SOA
107+
@@ -71,7 +77,8 @@ int ends_with(const char* name, const char* suffix);
108+
//
109+
// The two heuristics described above are disabled if mdns_allow_file
110+
// is not NULL.
111+
-int verify_name_allowed_with_soa(const char* name, FILE* mdns_allow_file);
112+
+use_name_result_t verify_name_allowed_with_soa(const char* name,
113+
+ FILE* mdns_allow_file);
114+
115+
typedef enum {
116+
VERIFY_NAME_RESULT_NOT_ALLOWED,
117+
--
118+
2.38.1
119+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"Signatures": {
3+
"nss-mdns-0.15.1.tar.gz": "ddf71453d7a7cdc5921fe53ef387b24fd0c3c49f4dcf94a2a437498596761a21"
4+
}
5+
}

0 commit comments

Comments
 (0)