s3cmd icon indicating copy to clipboard operation
s3cmd copied to clipboard

s3cmd violates XDG basedir spec on linux

Open sandys opened this issue 10 years ago • 4 comments

according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

s3cmd is storing all config files in the home directory and violating the spec.

sandys avatar Oct 27 '15 18:10 sandys

@mdomsch What do you think? should we change that to be the default?

fviard avatar Nov 19 '15 00:11 fviard

I don't have a strong opinion. $HOME/.s3cfg (and that pattern) has been around far longer than the 2010 XDG spec, and it's voluntary. There isn't a huge reason we should have to follow that - think of it more like a recommendation. We also have people asking if we could get credentials out of ~/.aws/config.

If someone felt strongly about doing it, allowing use of ~/.s3cfg, or either of these other XDG recommendations, I'd be fine with that. If they wanted to remove ~/.s3cfg and force users to move their config files, I'd reject.

On Wed, Nov 18, 2015 at 4:25 PM, Florent Viard [email protected] wrote:

@mdomsch https://github.com/mdomsch What do you think? should we change that to be the default?

— Reply to this email directly or view it on GitHub https://github.com/s3tools/s3cmd/issues/658#issuecomment-157907975.

mdomsch avatar Nov 19 '15 00:11 mdomsch

I believe the ideal behavior would be:

  • If no s3cfg file exists (neither in $XDG_CONFIG_HOME, or as $HOME/.s3cfg), create it in $XDG_CONFIG_HOME.
  • if the $XDG_CONFIG_HOME/s3cmd/config file exists, use it.
  • if the $HOME/.s3cfg file exists, use it.

@fviard, @mdomsch, what do you guys think? I would be willing to work on that next month if you agree.

gahag avatar Nov 11 '19 13:11 gahag

This is issue is quite old, but I'd be willing to work on it if the maintainers still have this position.

It's not uncommon to have a read-only home directory, with XDG environments variables pointing to actually RW paths.

r0one avatar Nov 03 '25 08:11 r0one