Commit Graph
3 Commits
Author SHA1 Message Date
Nick Craig-Wood 14dc9c5dba fs: log an error if a backend saves config which has no config option
Config saved by a backend with no matching config option isn't
redacted by rclone config redacted, and can't be set with flags or
environment variables.

This logs an internal error when that happens and panics when running
tests so these are caught by the integration tests.

Keys supplied by the user with rclone config create and update are
still saved without checking.
2026-11-21 11:30:22 +00:00
Nick Craig-Wood 6a0f081380 fs: stop writing config for on the fly and environment variable remotes into the config file
When a backend saved config, for example a refreshed OAuth token, for
a remote which wasn't in the config file, a section with just that
value was created in the config file for environment variable remotes
and the config file was rewritten for on the fly remotes.

Config is now only saved if the remote is in the config file.
2026-10-08 10:53:05 +01:00
Pastalikek65 adc7f2ebfa config: redact env var config values in logs
Before this change the environment variable getters in fs/configmap.go
logged the option value with %q, so a password set via
RCLONE_CONFIG_remote_pass (or RCLONE_remote_pass) was printed in full
to the debug log. Values from the config file were already redacted,
which made the leak easy to miss.

This change routes both getters through fs.RedactOptionValue, which
looks up the option in the backend's option list: options marked
IsPassword or Sensitive log as XXX, unknown options are conservatively
redacted, and --dump auth still shows the value for debugging.

Fixes #5794
2026-08-13 20:10:41 +02:00