containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.77k stars 2.32k forks source link

Podman on windows looks in too many (wrong) places for configuration files #22875

Open Tyler-IN opened 2 months ago

Tyler-IN commented 2 months ago

Issue Description

Using ProcMon one can easily monitor process read attempts.

Some paths are not appropriately joined for the roaming app data or program data resulting in missing \ in the 5.1.0-rc1, I will try the release build too.

Probably don't search in C:\usr\share\containers and C:\etc\containers on Windows builds

I think <home>\.config\containers should be fine.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Launch ProcMan and configure filters to capture file activity with 'process name is podman.exe' and 'path ends with .conf' as filters.
  2. Execute podman.exe
  3. Observe captured results in ProcMon.

Describe the results you received

The files being hunted are containers.conf and storage.conf...

Describe the results you expected

Not ... this.

podman info output

OS: windows/amd64
provider: wsl
version: 5.1.0-rc1

Cannot connect to Podman. (I have the machine shut down at the moment.)

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Tyler-IN commented 2 months ago

Upgraded to released v5.1.0, problem persists.

It is also checking in D:\etc and D:\usr\share\containers for some reason.

It appears to be discarding paths from the config, maybe needs a specific format... I'm going to try environment variables next.

rhatdan commented 2 months ago

Podman is searching for storage.conf in those directories. This should not be happening in Windows, but it is quite difficult to fix.

ppoi commented 2 months ago

5.0.3: ~\AppData\Roaming\containers 5.1.0: ~\AppData\Roamingcontainers

I think that 5.1.0's configuration folder path building process is wrong.

Tyler-IN commented 2 months ago

I investigated fixing it, fixed it in a local copy; mentioned the issue in https://github.com/containers/storage/issues/1943

Just needs to not use dumb paths on Windows and join paths with the right functions.

Might PR if I have time to ensure red tape is not an concern.

Hopefully you guys can fix it "the right way" though. 👍

github-actions[bot] commented 1 month ago

A friendly reminder that this issue had no activity for 30 days.