74fc46
diff --git a/lib/sysinit/nsssysinit.c b/lib/sysinit/nsssysinit.c
74fc46
--- a/lib/sysinit/nsssysinit.c
74fc46
+++ b/lib/sysinit/nsssysinit.c
74fc46
@@ -1,11 +1,15 @@
74fc46
 /* This Source Code Form is subject to the terms of the Mozilla Public
74fc46
  * License, v. 2.0. If a copy of the MPL was not distributed with this
74fc46
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
74fc46
+
74fc46
+#define _GNU_SOURCE 1
74fc46
+#include <stdlib.h>
74fc46
+
74fc46
 #include "seccomon.h"
74fc46
 #include "prio.h"
74fc46
 #include "prprf.h"
74fc46
 #include "plhash.h"
74fc46
 #include "prenv.h"
74fc46
 
74fc46
 /*
74fc46
  * The following provides a default example for operating systems to set up
74fc46
@@ -37,17 +41,17 @@ testdir(char *dir)
74fc46
     return S_ISDIR(buf.st_mode);
74fc46
 }
74fc46
 
74fc46
 #define NSS_USER_PATH1 "/.pki"
74fc46
 #define NSS_USER_PATH2 "/nssdb"
74fc46
 static char *
74fc46
 getUserDB(void)
74fc46
 {
74fc46
-    char *userdir = PR_GetEnvSecure("HOME");
74fc46
+    char *userdir = secure_getenv("HOME");
74fc46
     char *nssdir = NULL;
74fc46
 
74fc46
     if (userdir == NULL) {
74fc46
         return NULL;
74fc46
     }
74fc46
 
74fc46
     nssdir = PORT_Alloc(strlen(userdir) + sizeof(NSS_USER_PATH1) + sizeof(NSS_USER_PATH2));
74fc46
     if (nssdir == NULL) {
74fc46
@@ -129,17 +133,17 @@ userCanModifySystemDB()
74fc46
 #else
74fc46
 #error "Need to write getUserDB, SystemDB, userIsRoot, and userCanModifySystemDB functions"
74fc46
 #endif
74fc46
 #endif
74fc46
 
74fc46
 static PRBool
74fc46
 getFIPSEnv(void)
74fc46
 {
74fc46
-    char *fipsEnv = PR_GetEnvSecure("NSS_FIPS");
74fc46
+    char *fipsEnv = secure_getenv("NSS_FIPS");
74fc46
     if (!fipsEnv) {
74fc46
         return PR_FALSE;
74fc46
     }
74fc46
     if ((strcasecmp(fipsEnv, "fips") == 0) ||
74fc46
         (strcasecmp(fipsEnv, "true") == 0) ||
74fc46
         (strcasecmp(fipsEnv, "on") == 0) ||
74fc46
         (strcasecmp(fipsEnv, "1") == 0)) {
74fc46
         return PR_TRUE;