Title: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads · Issue #6404 · developing-today/code · GitHub
Open Graph Title: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads · Issue #6404 · developing-today/code
X Title: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads · Issue #6404 · developing-today/code
Description: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads Summary fleet-config filters an empty HOME (it falls back to ".", tracked separately as #5737) and trea...
Open Graph Description: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads Summary fleet-config filters an empty HOME (it falls back to "....
X Description: fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads Summary fleet-config filters an empty HOME (it falls back to &q...
Opengraph URL: https://github.com/developing-today/code/issues/6404
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads","articleBody":"# fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads\n\n## Summary\n\n`fleet-config` filters an *empty* `HOME` (it falls back to `\".\"`, tracked separately as #5737) and treats empty or relative XDG bases as the hazards they are (#5473 closed; #6396 open for relative XDG), but a *non-empty relative* `HOME` is used verbatim as the anchor for every home-relative resolution in the crate. With `HOME=relhome`, `Config::file_path()` returns the relative path `relhome/.config/fleet/fleet.toml`, and `Config::load()` loads a `fleet.toml` planted under the process's current working directory. The state dir, the shims dir under it, the broker socket, and both token-file paths resolve CWD-relative the same way.\n\nThis is a distinct trigger from the filed siblings: #5737 covers HOME *unset/empty* (the `\".\"` fallback); #6396 covers relative *XDG* bases with HOME present and correct (and explicitly puts the HOME cases out of its scope). Neither covers HOME itself being set to a relative path.\n\n## Evidence (file:line, origin/main @ 28719695372b; fleet-config lib.rs is byte-identical between laptop HEAD 1dae17e457 and origin/main, md5-verified this run)\n\n- `pkgs/fleet/crates/fleet-config/src/lib.rs:225-227` — `home_dir()`: `env_path(\"HOME\").unwrap_or_else(|| PathBuf::from(\".\"))`. `env_path`/`non_empty_path` (:217-223) filter only the empty case; a relative value passes through unchanged.\n- `pkgs/fleet/crates/fleet-config/src/lib.rs:252-263` — `file_path_from` joins `.config/fleet/fleet.toml` onto that home value; a relative home stays relative.\n- `pkgs/fleet/crates/fleet-config/src/lib.rs:442-445` — `state_dir_from` joins `.local/state/fleet` onto the same home; `shims_dir()` is `state_dir()/shims`.\n- `pkgs/fleet/crates/fleet-config/src/lib.rs:302-320` — `broker_socket_from` resolves the default `.cache/laptop-agent/broker.sock` under the same home via `resolve_under`; `default_token_file()` (:385) and `secrets_token_file()` (:430) resolve under it too.\n\n## Verification (this run, laptop, real fleet-config crate)\n\nProbe `~/git/fleet/probe-fleet-config-empty-rel` (path-depends on the real `fleet-config` crate; `paths` bin prints `file_path`/`state_dir`, loads via `Config::load()`, and reports domain flags):\n\n- From a scratch CWD containing a planted `relhome/.config/fleet/fleet.toml` (`[domains] planted = false`), with `HOME=relhome` and XDG/FLEET_CONFIG unset:\n - `file_path=relhome/.config/fleet/fleet.toml` (relative)\n - `state_dir=relhome/.local/state/fleet`\n - `broker_socket=relhome/.cache/laptop-agent/broker.sock`\n - `planted_enabled=false` — **the planted CWD config was loaded** (an unknown domain defaults to enabled; `false` can only come from the planted file)\n - `queue_enabled=true` (control domain untouched)\n- Same relative `HOME=relhome` from a CWD with no `relhome` tree: `planted_enabled=true` — defaults rule; the load follows the CWD-relative path, not any fixed location.\n- Control, absolute `HOME=\u003cscratch>/abshome`: all paths anchor at the absolute home; its own config loads as expected.\n\n## Why it matters\n\n- A fleet process launched with a relative HOME (a wrapper script, a templated systemd unit with `HOME=.` or a relative `WorkingDirectory`-style spelling, a container entrypoint) silently reads its configuration — including the `[domains]` disable lever the crate docs call an incident lever — from whoever controls its working directory: the exact planted-config hazard #5473 closed for the empty-XDG spelling and #6396 filed for the relative-XDG spelling.\n- State, shims, socket, and token-file paths landing CWD-relative means two processes in different directories keep different state and talk to different sockets, with no error anywhere.\n\n## Acceptance criteria\n\n- A relative `HOME` is not used as a resolution anchor: it is treated as unset for anchoring purposes (so the existing #5737 fallback decision governs what happens next), or resolution otherwise fails closed with a loud error — triage picks the shape, consistent with #5737/#6396.\n- A planted `./\u003crelative-home>/.config/fleet/fleet.toml` in the working directory is never loaded.\n- Pinning tests cover a relative HOME for `file_path`, `state_dir`, and `broker_socket` alongside the existing empty-value tests (`env_paths_ignore_empty_values_and_resolve_under_home`, lib.rs:577).\n- Behavior with an absolute HOME is unchanged; existing fleet-config tests stay green.\n- Out of scope: HOME unset/empty (#5737), relative XDG bases (#6396), and `FLEET_CONFIG` itself (an explicit per-file override a user may deliberately spell relative).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-06T00:46:06Z","url":"https://github.com/developing-today/code/issues/6404"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4fb26dfd-6006-cf41-c88f-1d4aa50c4144 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6FE:C802B:AA46EE:E38A10:6B0642BB |
| html-safe-nonce | 195cf99b3962c3dd807b9dc01594383a71ec44f21b230813c179eb85d453c6c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkZFOkM4MDJCOkFBNDZFRTpFMzhBMTA6NkIwNjQyQkIiLCJ2aXNpdG9yX2lkIjoiMTI1ODA3MzAxNzQ1NjkzNTYxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f701da557eebe79c01256896dccc905c083c24b83c362cb38cf63a2760d128a5 |
| hovercard-subject-tag | issue:6234420787 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6404/issue_layout |
| twitter:image | https://opengraph.githubassets.com/667d4e15eda7d839ce453ce634b6bef469e225c95dc6ddbf47a8e3f020351ebd/developing-today/code/issues/6404 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/667d4e15eda7d839ce453ce634b6bef469e225c95dc6ddbf47a8e3f020351ebd/developing-today/code/issues/6404 |
| og:image:alt | fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads Summary fleet-config filters an empty HOME (it falls back to ".... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width