From aaf8cae7e452d58a1a23c3bbb633ca56d3d288f0 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 29 Dec 2006 14:04:58 +0100 Subject: [PATCH] Typo in copyright use QFile in db.cpp fix path in xca.nsi --- COPYRIGHT | 2 +- lib/db.cpp | 37 ++++++++++++++++++------------------- lib/db_crl.cpp | 1 - misc/xca.nsi | 4 ++-- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 7b477e96..3b67d248 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -33,7 +33,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This program links to software with different licenses from: - http://www.openssl.orgwhich includes cryptographic software + http://www.openssl.org which includes cryptographic software written by Eric Young (eay@cryptsoft.com)" http://www.trolltech.com diff --git a/lib/db.cpp b/lib/db.cpp index d418ba45..f99cc181 100644 --- a/lib/db.cpp +++ b/lib/db.cpp @@ -314,13 +314,13 @@ int db::erase(void) int db::shrink(int flags) { - int fdn, ret; + int ret; uint32_t offs; char buf[BUFSIZ]; + QFile new_file; - QString filename = name + "{new}"; - fdn = open(CCHAR(filename), O_RDWR | O_CREAT, 0644); - if (fdn<0) { + new_file.setFileName(name + "{new}"); + if (!new_file.open(QIODevice::ReadWrite)) { fileIOerr("open"); return 1; } @@ -339,16 +339,15 @@ int db::shrink(int flags) break; continue; } - ret = write(fdn, &head, sizeof(head)); - if (ret<0) + ret = new_file.write((char*)&head, sizeof(head)); + if (ret != sizeof(head)) break; offs = head_offset; while (offs) { ret = file.read((char*)buf, (offs > BUFSIZ) ? BUFSIZ : offs); if (ret<=0) break; - ret = write(fdn, buf, ret); - if (ret<0) + if (new_file.write(buf, ret) != ret) break; offs -= ret; } @@ -356,29 +355,29 @@ int db::shrink(int flags) break; } - close(fdn); + new_file.close(); if (ret) { - unlink(CCHAR(filename)); + unlink(CCHAR(new_file.fileName())); return 1; } file.close(); - // use the global rename() function and not the method of this class #ifdef WIN32 // here we try to reimplement the simple "mv" command on unix // atomic renaming fails on WIN32 platforms and // forces us to work with temporary files :-( - QString tempn = "$" + name + "orig"; - unlink(CCHAR(tempn)); - if (!::rename(CCHAR(name), CCHAR(tempn))) { - if (!::rename(CCHAR(filename), CCHAR(name))) { - unlink(CCHAR(tempn)); + QString tempn = name + "{orig}"; + QFile::remove(tempn); + if (file.rename(tempn)) { + if (new_file.rename(name)) { + QFile::remove(tempn); } else { - ::rename(CCHAR(tempn), CCHAR(name)); - unlink(CCHAR(filename)); + QFile::rename(tempn, name); + QFile::remove(new_file.fileName()); } } #else - ::rename(CCHAR(filename), CCHAR(name)); + // use the global rename() function and not the method of this class + ::rename(CCHAR(new_file.fileName()), CCHAR(name)); #endif return 0; } diff --git a/lib/db_crl.cpp b/lib/db_crl.cpp index 819348c5..93241079 100644 --- a/lib/db_crl.cpp +++ b/lib/db_crl.cpp @@ -257,7 +257,6 @@ pki_crl *db_crl::newItem(pki_x509 *cert) crl->sign(cert->getRefKey(), dgst); mainwin->certs->updatePKI(cert); -#warning FIXME: set Last update insert(crl); } catch (errorEx &err) { diff --git a/misc/xca.nsi b/misc/xca.nsi index b0237d90..c4e044c3 100755 --- a/misc/xca.nsi +++ b/misc/xca.nsi @@ -69,8 +69,8 @@ Section "xca (required)" SecMain File "${BDIR}/mingwm10.dll" File "${OPENSSL}\libeay32.dll" - File "${QTDIR}\QtGui4.dll" - File "${QTDIR}\QtCore4.dll" + File "${QTDIR}\bin\QtGui4.dll" + File "${QTDIR}\bin\QtCore4.dll" ; remove old images ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\xca "Install_Dir" "$INSTDIR"