Offline trigger silently replaces an existing /system-update link from another tool (dnf5 offline)

Abierto Apto para principiantes
#1,040 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c
Área
backend

Línea de trabajo

Empieza por lib/pk-offline-private.c, especialmente por pk_offline_auth_trigger_prepared_file() alrededor de la línea 252, donde el issue indica que se desvincula el trigger existente antes de crear un nuevo enlace simbólico. Revisa las pruebas del trigger offline y añade cobertura para un enlace /system-update existente que apunte fuera de PackageKit. Se considera terminado cuando el trigger se niegue a reemplazar ese enlace o advierta antes de hacerlo, y una prueba cubra ese comportamiento.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary
When /system-update already points to a dnf5 offline transaction, pkcon offline-trigger (or the D-Bus Trigger() call used by Discover) unlinks it and links it to /var/lib/PackageKit/prepared-update without looking at the old target. The dnf5 stage is dropped with no error or warning, and the next boot installs PackageKit's set instead.

Versions
PackageKit 1.4.0 (source read at the v1.4.0 tag), Fedora 44, dnf5 backend, dnf5 offline for the other stage.

Steps to reproduce

  1. sudo dnf5 upgrade --offline -y. ls -l /system-update shows -> /usr/lib/sysimage/libdnf5/offline.
  2. sudo pkcon -y update --only-download
  3. sudo pkcon offline-trigger exits 0.
  4. ls -l /system-update now shows -> /var/lib/PackageKit/prepared-update.
  5. Reboot. PackageKit's offline service installs its own set; dnf5's offline service finds no trigger and exits.

Expected
The trigger refuses, or at least warns, when /system-update exists and is not PackageKit's own link, so the user knows a different prepared update is being replaced.

Actual
The other tool's link is replaced silently and Trigger() reports success.

Source
lib/pk-offline-private.c:252 in pk_offline_auth_trigger_prepared_file() calls g_unlink() on the trigger file and then symlink(), with no check of what the old link pointed to.

Lenguaje dominante
C
Estrellas
360
Forks
196
Merge medio
21 h 50 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PackageKit/PackageKit

Todos los issues de PackageKit/PackageKit

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.