Commit e285186
committed
PMM-15316 Require group r-x on the secrets dir
The setgid check tested the setgid bit and gid 0 but not whether group 0
could reach the directory at all, so a gid-0 mode-2700 /srv/sep passed it
and published four files SEP cannot open. Verified: at 2700 a uid in group
0 gets EACCES on open and on list; group execute alone (2710) opens by
name but still cannot list, so the mask requires r-x rather than x.
Group write stays out of the mask - only the publishing uid writes here,
which the -w test above already answers - so a 2750 directory, which
works, is not rejected along with the broken ones.
Compare the masked mode against $((8#2050)) rather than the 8#2050
literal: test does not arithmetic-expand its operands, so the literal
form makes [ error out, and inside an || list that error reads as a
false condition and disables the check entirely.
Signed-off-by: Yan Orestes <yan.orestes@percona.com>1 parent fa8c2d8 commit e285186
2 files changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
179 | | - | |
180 | | - | |
| 182 | + | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
0 commit comments