🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
2 messages
2 total messages Started by David Kalnischkies Thu, 08 Oct 2026 07:30
Bug#1150291: apt: sqv method passes an invalid --policy-as-of date on 29 February
#116
Author: David Kalnischkies
Date: Thu, 08 Oct 2026 07:30
73 lines
4988 bytes
--6yzo42hp2ng3olz7
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: Bug#1150291: apt: sqv method passes an invalid --policy-as-of
 date on 29 February
MIME-Version: 1.0

Hi,

that is an interesting find!
(And some sad code)

Am Wed, Oct 07, 2026 at 11:47:19PM -0600, schrieb Christian No=C3=A9 Ramos =
L=C3=B3pez:
> Two things would avoid it: computing the date with a calendar, or
> passing "+1y", which sqv accepts as an offset (--policy-as-of +1y
> exits 0 here).

The former should be relatively easy (as far as dates are concerned)
with what is available via <chrono> in C++20 and above (nowadays).


The second option seems (at least for now) to be a usage error itself
as the documentation (sqv manpage) for --policy-as-of says
| The time is expressed as an ISO 8601 formatted timestamp.

And earlier it expressed in general:
| The TIMESTAMPs must be given in ISO 8601 format

I presume that +1y works stems from --time which says:
| Set the reference time as an ISO 8601 formatted timestamp or
| relative offset. [=E2=80=A6] This time is also used as the default
| value for --not-after and --policy-as-of [=E2=80=A6]

"relative offset" does not seem defined through.

Aside: I /suppose/ "PY1" would be a valid ISO 8601 (duration),
but I haven't dared to try how sqv would react.


Maybe its just me, but I would prefer the former (even if documentation
of sqv is changed) as the wording --policy-as-of highly suggests an
exact date for me=E2=80=A6 even if I realize as of 5 seconds later that this
might be a valid way of speaking, too.


Best regards

David Kalnischkies

--6yzo42hp2ng3olz7
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmrHQscACgkQMRvlz3HQ
eIOg2Q/+N7LmrPt4UOxfyPhp9d5haTO5DxZ5Vt0ruQr0V4MLkJ2yftKBYrLcTIUb
f5Cl+YaCXLSu+rTBsOxDyFV/V2+at3LnWQLGSu9jRbyzImdJAP2SRIXvn9qaWV/r
i1/h5Q9Eu/QBAkZLl2Mdqi/YZHkA/EEwZf41Eay5U5PFOcS8Eb/QdfA6qLcaYn1Z
p75t/HDyNm0Uvj4yRua+K2OmjnRoS+/Km+xiIjNeACrAEgMA5vNirlBrPUSRmLAt
rdkzqK/jak1ZsF1ftmLHZgnz3OqMajB9d4UUOCHuynYf8Nt4E/fC5DNBLnn0srXk
xtdabvQsSwrVOPqMB+R5T/dzcEMVg1BtXvThvioYtgRQ92Qm/MYXgqdwiD9aNO/3
vNn4Nz3ddk1qBZyuXeFxH6kyp+FnQU9cAF3TZ9bkLdNXtXhF8KANI+cIm1guqwW8
vl3E468T5Z4h+PogKVlgYHPaLPRnu6kLiA8hXtnjC79xyCdb3g2fp3xaztY+L42Y
E029ByA/3l20gchFO6vFWNf0CP84JDBrskG3zyewYypcH84tJba6QLW+wXRclgf9
rK1Dh/4kYZ6Ww8OZGH18xTgruQ2O8yzIxQWUhO7tTxV4E/nKj56gGJdGT68z73yi
MqE1eleZtdthtJtf3f9mMIYE2HV57ltekFyE2sClYrUQ+ttkIqo=
=I0dl
-----END PGP SIGNATURE-----

--6yzo42hp2ng3olz7--
Bug#1150291: apt: sqv method passes an invalid --policy-as-of date on 29 February
#623
Author: Julian Andres Klode
Date: Mon, 12 Oct 2026 19:20
51 lines
4246 bytes
On Thu, Oct 08, 2026 at 09:14:23AM +0200, David Kalnischkies wrote:
> Hi,
> 
> that is an interesting find!
> (And some sad code)
> 
> Am Wed, Oct 07, 2026 at 11:47:19PM -0600, schrieb Christian Noé Ramos López:
> > Two things would avoid it: computing the date with a calendar, or
> > passing "+1y", which sqv accepts as an offset (--policy-as-of +1y
> > exits 0 here).
> 
> The former should be relatively easy (as far as dates are concerned)
> with what is available via <chrono> in C++20 and above (nowadays).
> 
> 
> The second option seems (at least for now) to be a usage error itself
> as the documentation (sqv manpage) for --policy-as-of says
> | The time is expressed as an ISO 8601 formatted timestamp.
> 
> And earlier it expressed in general:
> | The TIMESTAMPs must be given in ISO 8601 format
> 
> I presume that +1y works stems from --time which says:
> | Set the reference time as an ISO 8601 formatted timestamp or
> | relative offset. […] This time is also used as the default
> | value for --not-after and --policy-as-of […]
> 
> "relative offset" does not seem defined through.
> 
> Aside: I /suppose/ "PY1" would be a valid ISO 8601 (duration),
> but I haven't dared to try how sqv would react.
> 
> 
> Maybe its just me, but I would prefer the former (even if documentation
> of sqv is changed) as the wording --policy-as-of highly suggests an
> exact date for me… even if I realize as of 5 seconds later that this
> might be a valid way of speaking, too.

Yes we actually want to use midnight here. I'm not sure if the best
approach is to the the 1 year from now or to truncate the day field
until it produces a valid date, such that 02-29 truncates to 02-28
rather than extends to 03-01 (semantically preserving the end of
month).

I guess it's easier though to do the chrono change and perhaps
that's what we should do yeah.
-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads