Commit 9e6c625
committed
fix(users): harden password hash handling in ModifyPasswd
Validate password crypt hashes before invoking chpasswd to reject
invalid characters and malformed input per crypt(5).
Also improve process isolation and sensitive data handling by clearing
the child environment, switching to an explicit stdin pipe flow, and
zeroing the temporary password buffer after use.
Additionally, avoid exposing detailed backend errors to callers to
reduce information disclosure risks.
Signed-off-by: ComixHe <heyuming@deepin.org>1 parent 9befeaa commit 9e6c625
1 file changed
Lines changed: 58 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
160 | 182 | | |
161 | | - | |
| 183 | + | |
162 | 184 | | |
163 | 185 | | |
164 | 186 | | |
165 | 187 | | |
166 | 188 | | |
167 | 189 | | |
168 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
169 | 195 | | |
170 | | - | |
171 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
172 | 202 | | |
173 | 203 | | |
174 | 204 | | |
175 | 205 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
179 | 231 | | |
180 | 232 | | |
181 | 233 | | |
| |||
0 commit comments