RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1782408 - [RFE] podman exec support for --env-file
Summary: [RFE] podman exec support for --env-file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 8.2
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-11 15:04 UTC by Alex Schultz
Modified: 2020-07-21 15:32 UTC (History)
10 users (show)

Fixed In Version: podman-1.9.3 and newer
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-21 15:31:54 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3053 0 None None None 2020-07-21 15:32:28 UTC

Description Alex Schultz 2019-12-11 15:04:11 UTC
Description of problem:

podman exec currently only supports --env which could leak environment variables via ps and results in very long command lines if there are a bunch of vars. It would be beneficial for exec to support --env-file as well.


Version-Release number of selected component (if applicable):
any

How reproducible:
every time

Steps to Reproduce:
1.
[user@myhost ~]$ sudo podman exec --env VARI=foo -it -u root mysql /bin/bash
()[root@myhost /]#

2.
[user@myhost ~]$ ps aux | grep VARI
root      504494  0.0  0.0 241172  4600 pts/2    S+   15:00   0:00 sudo podman exec --env VARI=foo -it -u root mysql /bin/bash
root      504496  0.4  0.2 701452 42108 pts/2    Sl+  15:00   0:00 podman exec --env VARI=foo -it -u root mysql /bin/bash
centos    504613  0.0  0.0 112708   980 pts/4    S+   15:00   0:00 grep --color=auto VARI


Actual results:

--env shows up in cmd line

Expected results:

--env-file could be used to reduce the cmd line length (if lots of vars) and if there are sensitive variables.


Additional info:

Comment 1 Daniel Walsh 2019-12-11 15:18:59 UTC
Makes sense to me.  Could you open an Issue on github for this.  Should be a fairly easy thing to add.

Comment 2 Brent Baude 2019-12-11 15:22:32 UTC
upstream pr -> https://github.com/containers/libpod/pull/4677

Comment 3 Tom Sweeney 2019-12-11 20:36:29 UTC
Moving to Post and assigning to Jindrich as the PR in comment 2 has merged with the fix.

Comment 4 Jindrich Novy 2019-12-11 20:53:25 UTC
That PR is already a part of podman 1.6.4.

Comment 19 Joy Pu 2020-06-16 09:29:53 UTC
Test with podman-1.9.3-2.module+el8.2.1+6867+366c07d6.x86_64 and the env-file works, so set this to verified. Details:
# podman  run -d --name test busybox top
6450cad3a1f5200c60d3513f2085263344098502629756f9d953fb883fe095e2
#  podman exec --env-file envtest  -it test /bin/sh
/ # echo $a $b
hello world
/ # exit
# cat envtest 
a=hello
b=world

Comment 21 errata-xmlrpc 2020-07-21 15:31:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3053


Note You need to log in before you can comment on or make changes to this bug.