1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
pacman/lib
Dan McGee 39fd8bc318 Ensure dbpath is not null when populating sync database
We didn't do this sanity check before trying to open an archive. If
the alpm dbpath wasn't set, the sync database dbpath would be NULL,
causing us to hang indefinitely in archive_read_open_filename() rather
than erroring out.

We already have a corresponding check in local_db_populate().

The following program will test this case, and hangs before this patch
without the call to set_dbpath:

	int main(int argc, char *argv[]) {
		alpm_initialize();
		// alpm_option_set_dbpath("/var/lib/pacman/");
		pmdb_t *core = alpm_db_register_sync("core");
		pmpkg_t *pkg = alpm_db_get_pkg(core, "pacman");
		return 0;
	}

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-01 14:31:50 -05:00
..
libalpm Ensure dbpath is not null when populating sync database 2011-04-01 14:31:50 -05:00