From: Michael Tremer Date: Tue, 6 Apr 2021 15:46:41 +0000 (+0000) Subject: pakfire: Use distro information for safety checks X-Git-Tag: 0.9.28~1285^2~431 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ade517c7cdc72e40a2e9c55f7c50c30fc311fe7;p=pakfire.git pakfire: Use distro information for safety checks Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index c033b7dcb..e37d4fdaf 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -382,11 +382,7 @@ static int pakfire_safety_checks(Pakfire pakfire) { if (strcmp(pakfire->path, "/") != 0) return 0; - char* path = pakfire_make_path(pakfire, "/etc/ipfire-release"); - if (!path) - return 1; - - if (!pakfire_path_exists(path)) { + if (strcmp(pakfire->distro.id, "ipfire") != 0) { ERROR(pakfire, "Not an IPFire system\n"); errno = EPERM; return 1;