diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-04-26 22:16:23 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-04-26 22:16:23 +0000 |
commit | add2906c9d42915651455f66d7ba9219359e3ca0 (patch) | |
tree | ce6e61cc833e2e7e85d815841dc17ac697e795c4 | |
parent | 8f2162174790bfa4cec10704d87602673e8d7e5f (diff) | |
download | perl-URPM-add2906c9d42915651455f66d7ba9219359e3ca0.tar perl-URPM-add2906c9d42915651455f66d7ba9219359e3ca0.tar.gz perl-URPM-add2906c9d42915651455f66d7ba9219359e3ca0.tar.bz2 perl-URPM-add2906c9d42915651455f66d7ba9219359e3ca0.tar.xz perl-URPM-add2906c9d42915651455f66d7ba9219359e3ca0.zip |
check that rpmdb was properly opened in read/write mode to prevent segfault if no write permissions
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | URPM.xs | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Verison 4.23 - 2011, by Per Øyvind Karlsen + +- check that rpmdb was properly opened in read/write mode to prevent segfault + if no write permissions + Version 4.22 - 26 April 2011, by Per Øyvind Karlsen - add support for notriggers @@ -3175,6 +3175,12 @@ Db_open(prefix=NULL, write_perm=0, log_auto_remove=1) if(write_perm) { rpmdb rdb = rpmtsGetRdb(db->ts); DB_ENV *dbenv = rdb->db_dbenv; + + if (dbenv == NULL) { + (void)rpmtsFree(db->ts); + croak("unable to open rpmdb in read/write mode, write permissions missing?"); + } + /* TODO: allow for user configuration? */ if(log_auto_remove) dbenv->log_set_config(dbenv, DB_LOG_AUTO_REMOVE, 1); |