pacman/lib/libalpm
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
..
po Updated 3.5.1 translations from Transifex 2011-03-23 02:12:36 -05:00
.gitignore Remove unnecessary entries from .gitignore files 2007-07-16 16:49:28 -04:00
Makefile.am Add a hash table for holding packages 2011-02-04 09:55:45 +10:00
add.c Remove trans->skip_add 2011-02-22 16:48:51 -06:00
add.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
alpm.c alpm/db: do not close local DB in alpm_db_unregister_all 2011-03-24 17:18:24 -05:00
alpm.h Check local DB version before continuing transaction 2011-02-28 10:46:00 -06:00
alpm_list.c alpm_list: fix typo in doxygen comment 2011-03-16 19:52:54 -05:00
alpm_list.h Add new alpm_list_remove_item() function 2011-02-04 09:55:46 +10:00
backup.c Update copyright years for 2011 2011-01-07 18:47:37 -06:00
backup.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
be_local.c Fix assignment before NULL check 2011-03-20 19:56:55 -05:00
be_package.c Don't generate filelist unless we are going to use it 2011-02-16 20:57:07 -06:00
be_sync.c Ensure dbpath is not null when populating sync database 2011-04-01 14:31:50 -05:00
conflict.c alpm: alpm_db_get_pkgcache_list => alpm_db_get_pkgcache 2011-02-25 09:46:36 -06:00
conflict.h Conflict checking code cleanup 2011-02-16 20:57:07 -06:00
db.c Fix an outdated comment 2011-03-29 02:20:54 -05:00
db.h Check local DB version before continuing transaction 2011-02-28 10:46:00 -06:00
delta.c Update copyright years for 2011 2011-01-07 18:47:37 -06:00
delta.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
deps.c Ensure reported missing dependencies show correct version comparison 2011-03-25 15:43:08 -05:00
deps.h Ensure reported missing dependencies show correct version comparison 2011-03-25 15:43:08 -05:00
diskspace.c Ensure we have a root partition when checking space 2011-03-17 09:33:04 -05:00
diskspace.h diskspace: allow used flag to be toggled for both remove and install 2011-02-11 10:51:59 -06:00
dload.c Add comment about download file resolution 2011-02-04 09:15:22 -06:00
dload.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
error.c Check local DB version before continuing transaction 2011-02-28 10:46:00 -06:00
graph.h Use CALLOC for _alpm_graph_new() 2011-02-15 16:23:36 -06:00
group.c Update copyright years for 2011 2011-01-07 18:47:37 -06:00
group.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
handle.c alpm/handle.c: ensure handle is not NULL before proceeding 2011-03-29 12:10:08 -05:00
handle.h Fix double close of the lock file 2011-02-27 13:32:41 -06:00
log.c Mark log callback format string const 2011-02-24 09:38:59 -06:00
log.h Mark log callback format string const 2011-02-24 09:38:59 -06:00
md5.c libalpm md5: use larger and dynamic buffer 2010-09-02 10:33:21 -05:00
md5.h libalpm/md5: Fix license header 2008-06-03 21:31:31 -05:00
package.c Rework find_requiredby() to not use _alpm_dep_edge() 2011-03-25 15:40:12 -05:00
package.h Remove epoch as an independent field 2011-01-21 19:30:45 -06:00
pkghash.c Fix some database size estimation problems 2011-02-15 16:58:08 -06:00
pkghash.h alpm: remove public visibility of pmpkghash_t 2011-02-25 09:45:13 -06:00
remove.c alpm: alpm_db_get_pkgcache_list => alpm_db_get_pkgcache 2011-02-25 09:46:36 -06:00
remove.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
sync.c Minor code cleanups 2011-03-21 09:02:03 -05:00
sync.h Update copyright years for 2011 2011-01-07 18:47:37 -06:00
trans.c Check local DB version before continuing transaction 2011-02-28 10:46:00 -06:00
trans.h Remove trans->skip_add 2011-02-22 16:48:51 -06:00
util.c Fix line_offset not being reset in _alpm_archive_fgets() 2011-03-21 08:52:24 -05:00
util.h alpm/handle.c: ensure handle is not NULL before proceeding 2011-03-29 12:10:08 -05:00
version.c Allow version comparison to contain epoch specifier 2011-01-21 19:30:45 -06:00