Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env-file with # Character in value #20255

Closed
networkRob opened this issue Oct 4, 2023 · 1 comment
Closed

env-file with # Character in value #20255

networkRob opened this issue Oct 4, 2023 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@networkRob
Copy link

Issue Description

In an env-file that contains several environment variables to mount into a container. One could be a password. If the env Variable value contains a #, the # and following characters are ignored.

This is only seen in 4.7.0 and not in previous releases.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create an env file named test.env with the following contents DB_PASSWORD=thisIs*a#Test
  2. Run an container and mount the env file with --env-file. podman run -it --rm --env-file test.env fedora:38 printenv | grep DB_PASSWORD

Describe the results you received

In 4.7.0, any value in the env vars file, if a # is part of the value, it will remove any values after the #

~ » cat test.env                                                                                                                                                                                                                                                  rmartin@CMP-01
DB_PASSWORD=thisIs*a#Test
~ » podman run -it --rm --env-file test.env fedora:38 printenv | grep DB_PASSWORD                                                                                                                                                                                 rmartin@CMP-01
DB_PASSWORD=thisIs*a

Describe the results you expected

In a Podman 4.6.2 release, the full value is present:

~ » cat test.env                                                                                                                                                                                                                                                  rmartin@CMP-02
DB_PASSWORD=thisIs*a#Test
~ » podman run -it --rm --env-file test.env fedora:38 printenv | grep DB_PASSWORD                                                                                                                                                                                 rmartin@CMP-02
DB_PASSWORD=thisIs*a#Test

podman info output

~ » podman info                                                                                                                                                                                                                                             125 ↵ rmartin@CMP-01
host:
  arch: amd64
  buildahVersion: 1.32.0
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.7-2.fc38.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.7, commit: '
  cpuUtilization:
    idlePercent: 69.16
    systemPercent: 9.77
    userPercent: 21.07
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: server
    version: "38"
  eventLogger: journald
  freeLocks: 2032
  hostname: CMP-01.networkrob.com
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.5.5-200.fc38.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 9307136000
  memTotal: 66798125056
  networkBackend: cni
  networkBackendInfo:
    backend: cni
    dns:
      package: podman-plugins-4.6.2-3.fc38.x86_64
      path: /usr/libexec/cni/dnsname
      version: |-
        CNI dnsname plugin
        version: 1.3.1
        commit: unknown
    package: |-
      containernetworking-plugins-1.3.0-2.fc38.x86_64
      podman-plugins-4.6.2-3.fc38.x86_64
    path: /usr/libexec/cni
  ociRuntime:
    name: crun
    package: crun-1.9-1.fc38.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.9
      commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20230908.g05627dc-1.fc38.x86_64
    version: |
      pasta 0^20230908.g05627dc-1.fc38.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.1-1.fc38.x86_64
    version: |-
      slirp4netns version 1.2.1
      commit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8587046912
  swapTotal: 8589930496
  uptime: 0h 58m 39.00s
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/rmartin/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/rmartin/.local/share/containers/storage
  graphRootAllocated: 1998694907904
  graphRootUsed: 558928805888
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 36
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/rmartin/.local/share/containers/storage/volumes
version:
  APIVersion: 4.7.0
  Built: 1695839078
  BuiltTime: Wed Sep 27 13:24:38 2023
  GitCommit: ""
  GoVersion: go1.20.8
  Os: linux
  OsArch: linux/amd64
  Version: 4.7.0


### Podman in a container

No

### Privileged Or Rootless

None

### Upstream Latest Release

Yes

### Additional environment details

Behavior is seen running rootful and rootless

### Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
@networkRob networkRob added the kind/bug Categorizes issue or PR as related to a bug. label Oct 4, 2023
@Luap99
Copy link
Member

Luap99 commented Oct 4, 2023

Lets keep the discussion in one place: #19565.

@Luap99 Luap99 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants