[Pkg-fedora-ds-maintainers] [libapache2-mod-nss] 66/156: 196070

Timo Aaltonen tjaalton-guest at moszumanska.debian.org
Wed Jul 2 13:55:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

tjaalton-guest pushed a commit to branch master
in repository libapache2-mod-nss.

commit 073a85756519c1d8ff59fb54261bbdbba3164b77
Author: rcritten <>
Date:   Wed Jun 21 14:25:51 2006 +0000

    196070
    
    Fix some warnings related to not checking the return value of
    getcwd and chdir.
---
 nss_engine_init.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/nss_engine_init.c b/nss_engine_init.c
index 60cc250..ce2cfce 100644
--- a/nss_engine_init.c
+++ b/nss_engine_init.c
@@ -208,11 +208,23 @@ static void nss_init_SSLLibrary(server_rec *s, int sslenabled, int fipsenabled,
     /* We need to be in the same directory as libnssckbi.so to load the
      * root certificates properly.
      */
-    getcwd(cwd, PATH_MAX);
-    chdir(mc->pCertificateDatabase);
+    if (getcwd(cwd, PATH_MAX) == NULL) {
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+            "Unable to determine current working directory");
+        nss_die();
+    }
+    if (chdir(mc->pCertificateDatabase) != 0) {
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+            "Unable to change directory to %s", mc->pCertificateDatabase);
+        nss_die();
+    }
     /* Initialize NSS and open the certificate database read-only. */
     rv = NSS_Initialize(mc->pCertificateDatabase, mc->pDBPrefix, mc->pDBPrefix, "secmod.db", NSS_INIT_READONLY);
-    chdir(cwd);
+    if (chdir(cwd) != 0) {
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+            "Unable to change directory to %s", cwd);
+        nss_die();
+    }
 
     /* Assuming everything is ok so far, check the cert database password(s). */
     if (sslenabled && (rv != SECSuccess)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-fedora-ds/libapache2-mod-nss.git



More information about the Pkg-fedora-ds-maintainers mailing list