Commit 18d9373b authored by Guillem Jover's avatar Guillem Jover

u-a: Only warn for now on out of range priorities on --install

There seems to be packages using priorities > INT_MAX, which although
bogus as they were previously overflowing the int used to store them,
that would cause installation failures when upgrading from squeeze.

Turn this into a warning for now and clamp the values, which will be
switched back to an error after wheezy, in dpkg 1.17.x.

Closes: #676874
parent eb3efdf5
dpkg (1.16.4.3) UNRELEASED; urgency=low
* On «update-alternatives --install» only warn for now on out of range
priorities and clamp the values, as there seems to be packages using
priorities > INT_MAX, which although bogus as they were previously
overflowing the int used to store them, that would cause installation
failures when upgrading from squeeze. This will be reverted to an
error after wheezy. Closes: #676874
-- Guillem Jover <guillem@debian.org> Sun, 10 Jun 2012 23:17:40 +0200
dpkg (1.16.4.2) unstable; urgency=low
* Check correctly for out of range negative field width values in dpkg-query
......
......@@ -2476,8 +2476,13 @@ main(int argc, char **argv)
prio = strtol(prio_str, &prio_end, 10);
if (prio_str == prio_end || *prio_end != '\0')
badusage(_("priority must be an integer"));
if (prio < INT_MIN || prio > INT_MAX || errno == ERANGE)
badusage(_("priority is out of range"));
if (prio < INT_MIN || prio > INT_MAX || errno == ERANGE) {
/* XXX: Switch back to error on 1.17.x. */
prio = clamp(prio, INT_MIN, INT_MAX);
warning(_("priority is out of range: "
"%s clamped to %ld"),
prio_str, prio);
}
a = alternative_new(argv[i + 2]);
inst_alt = alternative_new(argv[i + 2]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment