Commit 0eaaa45
committed
Fix handling of too long label and subsystem fields
These LUKS2 labels are stored in the binary header area that has limited size.
While we have been silently truncating strings here, it is something that
is not expected, as the final label is then different than expected.
Let's fix the code to explicitly print and return error here.
Also remove the comment about duplicate check. It is incorrect optimization,
as some users will expect a real write on disk, we should no skip it.
Fixes: #9581 parent 3a8feb8 commit 0eaaa45
File tree
3 files changed
+11
-1
lines changed- lib/luks2
- tests
3 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
1275 | | - | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1276 | 1280 | | |
1277 | 1281 | | |
1278 | 1282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4059 | 4059 | | |
4060 | 4060 | | |
4061 | 4061 | | |
| 4062 | + | |
4062 | 4063 | | |
4063 | 4064 | | |
4064 | 4065 | | |
| |||
4089 | 4090 | | |
4090 | 4091 | | |
4091 | 4092 | | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
4092 | 4096 | | |
4093 | 4097 | | |
4094 | 4098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
| 1281 | + | |
| 1282 | + | |
1281 | 1283 | | |
1282 | 1284 | | |
1283 | 1285 | | |
| |||
0 commit comments