]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Use distro information for safety checks
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 15:46:41 +0000 (15:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 15:47:24 +0000 (15:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index c033b7dcb22aaf0eca0a4eafdadcf819e93e4370..e37d4fdafc87bce7b4ea520db5c21b3036fb7388 100644 (file)
@@ -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;