Skip to content

Commit 981e532

Browse files
Merge pull request #19205 from openshift-cherrypick-robot/cherry-pick-19196-to-v4.6
[v4.6] system service: unset listen fds on tcp
2 parents c27903d + ff71df0 commit 981e532

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/podman/system/service_abi.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ func restService(flags *pflag.FlagSet, cfg *entities.PodmanConfig, opts entities
9696
libpodRuntime.SetRemoteURI(uri.String())
9797
}
9898

99+
// bugzilla.redhat.com/show_bug.cgi?id=2180483:
100+
//
101+
// Disable leaking the LISTEN_* into containers which
102+
// are observed to be passed by systemd even without
103+
// being socket activated as described in
104+
// https://access.redhat.com/solutions/6512011.
105+
for _, val := range []string{"LISTEN_FDS", "LISTEN_PID", "LISTEN_FDNAMES"} {
106+
if err := os.Unsetenv(val); err != nil {
107+
return fmt.Errorf("unsetting %s: %v", val, err)
108+
}
109+
}
110+
99111
// Set stdin to /dev/null, so shortnames will not prompt
100112
devNullfile, err := os.Open(os.DevNull)
101113
if err != nil {

0 commit comments

Comments
 (0)