From c10613bec79f00a3907ef85ef69b721b7f16c9e7 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Wed, 22 Jul 2026 14:58:05 +0200 Subject: [PATCH] secboot: disable timeout in systemd-ask-password --- secboot/auth_requestor.go | 1 + secboot/auth_requestor_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/secboot/auth_requestor.go b/secboot/auth_requestor.go index d7054ff0fb4..22c10387013 100644 --- a/secboot/auth_requestor.go +++ b/secboot/auth_requestor.go @@ -73,6 +73,7 @@ func (r *systemdAuthRequestor) RequestUserCredential(ctx context.Context, name, args = append(args, "--icon", "drive-harddisk") args = append(args, "--id", filepath.Base(os.Args[0])+":"+path) + args = append(args, "--timeout=0") if enableCredential { args = append(args, "--credential=snapd.fde.password") diff --git a/secboot/auth_requestor_test.go b/secboot/auth_requestor_test.go index fa2683cdfdc..27b898b3b4d 100644 --- a/secboot/auth_requestor_test.go +++ b/secboot/auth_requestor_test.go @@ -87,7 +87,7 @@ func (s *authRequestorSuite) TestRequestPassphrase(c *C) { c.Check(input, Equals, "thepassphrase") c.Check(s.systemdAskPasswordCmd.Calls(), DeepEquals, [][]string{ - {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, + {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--timeout=0", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, }) } @@ -101,7 +101,7 @@ func (s *authRequestorSuite) TestRequestPassphraseOldSystemd(c *C) { c.Check(input, Equals, "thepassphrase") c.Check(s.systemdAskPasswordCmd.Calls(), DeepEquals, [][]string{ - {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "Enter passphrase for some-volume (some-device):"}, + {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--timeout=0", "Enter passphrase for some-volume (some-device):"}, }) } @@ -114,7 +114,7 @@ func (s *authRequestorSuite) TestRequestPassphraseFailure(c *C) { c.Assert(err, ErrorMatches, "cannot execute systemd-ask-password: exit status 1") c.Check(s.systemdAskPasswordCmd.Calls(), DeepEquals, [][]string{ - {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, + {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--timeout=0", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, }) } @@ -127,7 +127,7 @@ func (s *authRequestorSuite) TestRequestPassphraseMissingNewLine(c *C) { c.Assert(err, ErrorMatches, "systemd-ask-password output is missing terminating newline") c.Check(s.systemdAskPasswordCmd.Calls(), DeepEquals, [][]string{ - {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, + {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--timeout=0", "--credential=snapd.fde.password", "Enter passphrase for some-volume (some-device):"}, }) } @@ -141,6 +141,6 @@ func (s *authRequestorSuite) TestRequestRecoveryKey(c *C) { c.Check(input, Equals, "00001-00002-00003-00004-00005-00006-00007-00008") c.Check(s.systemdAskPasswordCmd.Calls(), DeepEquals, [][]string{ - {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--credential=snapd.fde.password", "Enter recovery key for some-volume (some-device):"}, + {"systemd-ask-password", "--icon", "drive-harddisk", "--id", "secboot.test:some-device", "--timeout=0", "--credential=snapd.fde.password", "Enter recovery key for some-volume (some-device):"}, }) }