1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 06:45:31 +01:00

secrets/create: remove pipe check and allow interactive stdin

Previously, `secret create` required stdin to be a pipe when using `-`,
blocking interactive stdin forcing users to use insecure patterns like
`echo "secret" | podman secret create <name>`.

Remove the pipe check to allow interactive stdin.

Closes #18591, #27879

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
This commit is contained in:
Danish Prakash
2026-01-14 13:10:25 +05:30
parent e1bb9dc194
commit 86a3b681d2
2 changed files with 24 additions and 7 deletions

View File

@@ -82,13 +82,6 @@ func create(_ *cobra.Command, args []string) error {
}
reader = strings.NewReader(envValue)
case path == "-" || path == "/dev/stdin":
stat, err := os.Stdin.Stat()
if err != nil {
return err
}
if (stat.Mode() & os.ModeNamedPipe) == 0 {
return errors.New("if `-` is used, data must be passed into stdin")
}
reader = os.Stdin
default:
file, err := os.Open(path)