Repository navigation
Commit f2f3409
plugins/auth/pam: expose sudo prompt to PAM via SUDO_PROMPT env
Some PAM implementations do not use PAM conversations and instead
present their own native client UI. In those cases, modules cannot
infer sudo's custom prompt text from the conversation callback path.
Set SUDO_PROMPT in the PAM environment before pam_authenticate(),
so modules that render their own UI can combine:
- PAM service identity (from the PAM transaction)
- sudo's resolved prompt string (SUDO_PROMPT)
to display a consistent, context-aware prompt.
To avoid stale state, clear SUDO_PROMPT before authentication starts
and clear it again after pam_authenticate() returns.
Allowing PAM modules in the stack to read (and potentially change)
SUDO_PROMPT does not introduce a new trust boundary concern:
PAM modules already control the conversation flow and can provide
their own prompt text/messages through the standard PAM conversation
mechanism.1 parent cb6ea72 commit f2f3409
1 file changed
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
316 | 349 | | |
317 | 350 | | |
318 | 351 | | |
319 | 352 | | |
320 | 353 | | |
321 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
322 | 363 | | |
323 | 364 | | |
324 | 365 | | |
| |||
0 commit comments