Commit ecabd2b
committed
fix(encryption): handle legacy string-typed appconfig on upgrade boot
Manager::isEnabled() and EncryptionWrapper::wrap() are both called during
OC::init() bootstrap, before occ upgrade has had a chance to run the
RetypeEncryptionConfigKeys repair step. If encryption_enabled or
encryptHomeStorage were previously stored as VALUE_STRING, the new
getValueBool() calls throw AppConfigTypeConflictException and prevent the
server from booting at all - making occ upgrade unrunnable.
Add a catch(AppConfigTypeConflictException) fallback to both callers that
reads the raw string value and interprets it the legacy way ('yes'/'1' →
true). This fallback only fires in the upgrade window between extracting
new code and running occ upgrade; once the repair step has re-typed the
rows it is never reached again.
Also strengthen RetypeEncryptionConfigKeysTest setUp() to delete both
keys before each test, so real-DB residue from occ invocations in the
same process cannot pollute the absence-check test.
Signed-off-by: Stephen Cuppett <steve@cuppett.com>1 parent ca59998 commit ecabd2b
3 files changed
Lines changed: 30 additions & 3 deletions
File tree
- lib/private/Encryption
- tests/lib/Repair
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
106 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
0 commit comments