Skip to content

Commit

Permalink
Merge pull request #19205 from openshift-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-19196-to-v4.6

[v4.6] system service: unset listen fds on tcp
  • Loading branch information
openshift-merge-robot authored Jul 12, 2023
2 parents c27903d + ff71df0 commit 981e532
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/podman/system/service_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ func restService(flags *pflag.FlagSet, cfg *entities.PodmanConfig, opts entities
libpodRuntime.SetRemoteURI(uri.String())
}

// bugzilla.redhat.com/show_bug.cgi?id=2180483:
//
// Disable leaking the LISTEN_* into containers which
// are observed to be passed by systemd even without
// being socket activated as described in
// https://access.redhat.com/solutions/6512011.
for _, val := range []string{"LISTEN_FDS", "LISTEN_PID", "LISTEN_FDNAMES"} {
if err := os.Unsetenv(val); err != nil {
return fmt.Errorf("unsetting %s: %v", val, err)
}
}

// Set stdin to /dev/null, so shortnames will not prompt
devNullfile, err := os.Open(os.DevNull)
if err != nil {
Expand Down

0 comments on commit 981e532

Please sign in to comment.