Commit 8798dd1
committed
api,connectors: honour operation-level _temp_dir in askpass helpers
Closes #1623. The SUDO_ASKPASS / SU_ASKPASS helper script is now placed
under the same directory the caller requested, fixing the case where an
operation-level _temp_dir (or a per-host default cascaded through the
_temp_dir global argument on host.data) was respected for file ops but
ignored by the internal askpass helpers.
Resolution order (unchanged outside the askpass path):
1. Operation-level _temp_dir (explicit caller)
2. config.TEMP_DIR / host.data._temp_dir via the existing
global-argument cascade
3. TmpDir fact (_get_temp_directory only)
4. config.DEFAULT_TEMP_DIR
Changes:
- _ensure_askpass_set_for_host accepts a temp_dir override and tracks
the resolved directory next to the cached path; if a later call
resolves a different temp_dir the cached path is invalidated so the
script gets regenerated under the correct directory.
- make_unix_command_for_host threads _temp_dir through to the askpass
helpers so the op-level override takes effect.
Tests cover the askpass path for default, config, and op-level temp
directories, cache invalidation on temp_dir change, and the full path
through make_unix_command_for_host. Tests use unique hostnames to
avoid sharing the process-global memoize cache on _get_temp_directory.1 parent 0e8c348 commit 8798dd1
2 files changed
Lines changed: 133 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | | - | |
288 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
289 | 293 | | |
290 | 294 | | |
291 | | - | |
292 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
293 | 311 | | |
294 | | - | |
| 312 | + | |
| 313 | + | |
295 | 314 | | |
296 | 315 | | |
297 | 316 | | |
| |||
304 | 323 | | |
305 | 324 | | |
306 | 325 | | |
| 326 | + | |
307 | 327 | | |
308 | 328 | | |
309 | 329 | | |
| |||
312 | 332 | | |
313 | 333 | | |
314 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
315 | 340 | | |
316 | 341 | | |
317 | 342 | | |
| |||
321 | 346 | | |
322 | 347 | | |
323 | 348 | | |
324 | | - | |
| 349 | + | |
325 | 350 | | |
326 | 351 | | |
327 | 352 | | |
328 | 353 | | |
329 | 354 | | |
330 | | - | |
| 355 | + | |
331 | 356 | | |
332 | 357 | | |
333 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 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 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
0 commit comments