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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user