1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
package slackware_com
import (
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPackageEntryUnmarshalText(t *testing.T) {
tests := []struct {
Text string
Exp EntryItem
}{
{
Text: strings.TrimSpace(`
patches/packages/libX11-1.8.7-x86_64-1_slack15.0.txz: Upgraded.
This update fixes security issues:
libX11: out-of-bounds memory access in _XkbReadKeySyms().
libX11: stack exhaustion from infinite recursion in PutSubImage().
libX11: integer overflow in XCreateImage() leading to a heap overflow.
For more information, see:
https://lists.x.org/archives/xorg-announce/2023-October/003424.html
https://www.cve.org/CVERecord?id=CVE-2023-43785
https://www.cve.org/CVERecord?id=CVE-2023-43786
https://www.cve.org/CVERecord?id=CVE-2023-43787
(* Security fix *)`),
Exp: &PathUpgraded{
Path: "patches/packages/libX11-1.8.7-x86_64-1_slack15.0.txz",
Description: strings.TrimSpace(`
This update fixes security issues:
libX11: out-of-bounds memory access in _XkbReadKeySyms().
libX11: stack exhaustion from infinite recursion in PutSubImage().
libX11: integer overflow in XCreateImage() leading to a heap overflow.
For more information, see:
https://lists.x.org/archives/xorg-announce/2023-October/003424.html
https://www.cve.org/CVERecord?id=CVE-2023-43785
https://www.cve.org/CVERecord?id=CVE-2023-43786
https://www.cve.org/CVERecord?id=CVE-2023-43787
(* Security fix *)`),
},
},
{
Text: strings.TrimSpace(`
####################################################################
# NOTICE OF INPENDING EOL (END OF LIFE) FOR OLD SLACKWARE VERSIONS #
# #
# Effective July 5, 2018, security patches will no longer be #
# provided for the following versions of Slackware (which will all #
# be more than 7 years old at that time): #
# Slackware 13.0, Slackware 13.1, Slackware 13.37. #
# If you are still running these versions you should consider #
# migrating to a newer version (preferably as recent as possible). #
# Alternately, you may make arrangements to handle your own #
# security patches. #
####################################################################`),
Exp: EndOfLifeNotice(strings.TrimSpace(`
####################################################################
# NOTICE OF INPENDING EOL (END OF LIFE) FOR OLD SLACKWARE VERSIONS #
# #
# Effective July 5, 2018, security patches will no longer be #
# provided for the following versions of Slackware (which will all #
# be more than 7 years old at that time): #
# Slackware 13.0, Slackware 13.1, Slackware 13.37. #
# If you are still running these versions you should consider #
# migrating to a newer version (preferably as recent as possible). #
# Alternately, you may make arrangements to handle your own #
# security patches. #
####################################################################`),
),
},
{
Text: strings.TrimSpace(`
kde/stellarsolver-2.5-x86_64-1.txz: Added.
This is required by kstars-3.6.7.`),
Exp: &PathAdded{
Path: "kde/stellarsolver-2.5-x86_64-1.txz",
Description: "This is required by kstars-3.6.7.",
},
},
{
Text: `l/at-spi2-atk-2.38.0-x86_64-3.txz: Removed.`,
Exp: &PathRemoved{
Path: "l/at-spi2-atk-2.38.0-x86_64-3.txz",
},
},
{
Text: `isolinux/initrd.img: Rebuilt.`,
Exp: &PathRebuild{
Path: "isolinux/initrd.img",
},
},
{
Text: `kernels/*: Upgraded.`,
Exp: &PathUpgraded{
Path: "kernels/*",
},
},
}
for _, test := range tests {
entry := ParseChangeLogEntry(test.Text)
assert.Equal(t, test.Exp, entry)
}
}
func MustTime(str string) time.Time {
ret, err := time.Parse(time.UnixDate, str)
if err != nil {
panic(err)
}
return ret
}
func TestDayEntryUnmarshalText(t *testing.T) {
tests := []struct {
Text []byte
Exp Entry
}{
{
Text: []byte(strings.TrimSpace(`
Fri Feb 18 05:29:00 UTC 2022
a/btrfs-progs-5.16.2-x86_64-1.txz: Upgraded.
a/kernel-generic-5.16.10-x86_64-1.txz: Upgraded.
k/kernel-source-5.16.10-noarch-1.txz: Upgraded.
AMD_PTDMA n -> m
Thanks to walecha.
n/php-7.4.28-x86_64-1.txz: Upgraded.
This update fixes bugs and a security issue:
UAF due to php_filter_float() failing for ints.
For more information, see:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21708
(* Security fix *)
x/libdrm-2.4.110-x86_64-1.txz: Upgraded.
`)),
Exp: Entry{
Time: MustTime("Fri Feb 18 05:29:00 UTC 2022"),
Items: []EntryItem{
&PathUpgraded{Path: "a/btrfs-progs-5.16.2-x86_64-1.txz"},
&PathUpgraded{Path: "a/kernel-generic-5.16.10-x86_64-1.txz"},
&PathUpgraded{
Path: "k/kernel-source-5.16.10-noarch-1.txz",
Description: strings.TrimSpace(`
AMD_PTDMA n -> m
Thanks to walecha.`,
),
},
&PathUpgraded{
Path: "n/php-7.4.28-x86_64-1.txz",
Description: strings.TrimSpace(`
This update fixes bugs and a security issue:
UAF due to php_filter_float() failing for ints.
For more information, see:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21708
(* Security fix *)`,
),
},
&PathUpgraded{
Path: "x/libdrm-2.4.110-x86_64-1.txz",
},
},
},
},
{
Text: []byte(strings.TrimSpace(`
Fri Apr 6 20:47:43 UTC 2018
####################################################################
# NOTICE OF INPENDING EOL (END OF LIFE) FOR OLD SLACKWARE VERSIONS #
# #
# Effective July 5, 2018, security patches will no longer be #
# provided for the following versions of Slackware (which will all #
# be more than 7 years old at that time): #
# Slackware 13.0, Slackware 13.1, Slackware 13.37. #
# If you are still running these versions you should consider #
# migrating to a newer version (preferably as recent as possible). #
# Alternately, you may make arrangements to handle your own #
# security patches. #
####################################################################
patches/packages/patch-2.7.4-i486-2_slack13.37.txz: Rebuilt.
Fix arbitrary shell execution possible with obsolete ed format patches.
For more information, see:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000156
(* Security fix *)`)),
Exp: Entry{
Time: MustTime("Fri Apr 6 20:47:43 UTC 2018"),
Items: []EntryItem{EndOfLifeNotice(strings.TrimSpace(`
####################################################################
# NOTICE OF INPENDING EOL (END OF LIFE) FOR OLD SLACKWARE VERSIONS #
# #
# Effective July 5, 2018, security patches will no longer be #
# provided for the following versions of Slackware (which will all #
# be more than 7 years old at that time): #
# Slackware 13.0, Slackware 13.1, Slackware 13.37. #
# If you are still running these versions you should consider #
# migrating to a newer version (preferably as recent as possible). #
# Alternately, you may make arrangements to handle your own #
# security patches. #
####################################################################`)),
&PathRebuild{
Path: "patches/packages/patch-2.7.4-i486-2_slack13.37.txz",
Description: strings.TrimSpace(`
Fix arbitrary shell execution possible with obsolete ed format patches.
For more information, see:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000156
(* Security fix *)`),
},
},
},
},
}
for _, test := range tests {
var entry Entry
err := entry.UnmarshalText(test.Text)
require.NoError(t, err)
assert.Equal(t, test.Exp, entry)
}
}
func TestOpenChangelog(t *testing.T) {
changelog, err := OpenChangeLog("testdata/ChangeLog.txt")
require.NoError(t, err)
//require.Len(t, changelog.Day, 20)
_ = changelog
}
|