[Fedora-directory-commits] mod_nss mod_nss.c, 1.7, 1.8 mod_nss.h, 1.6, 1.7 nss_engine_config.c, 1.7, 1.8 nss_engine_init.c, 1.12, 1.13
by Doctor Conrad
Author: rcritten
Update of /cvs/dirsec/mod_nss
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21038
Modified Files:
mod_nss.c mod_nss.h nss_engine_config.c nss_engine_init.c
Log Message:
Add proxy support to mod_nss. Most of the changes are related to
adding new configuration directives. For the others we need to
initialize an NSS socket differently whether we will be acting as a
client or a server.
Index: mod_nss.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/mod_nss.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mod_nss.c 6 Sep 2005 14:51:43 -0000 1.7
+++ mod_nss.c 29 Sep 2005 19:35:43 -0000 1.8
@@ -15,6 +15,7 @@
#include "mod_nss.h"
#include <assert.h>
+#include "sslerr.h"
/*
* the table of configuration directives we provide
@@ -101,7 +102,6 @@
SSL_CMD_DIR(Require, AUTHCFG, RAW_ARGS,
"Require a boolean expression to evaluate to true for granting access"
"(arbitrary complex boolean expression - see manual)")
-#ifdef PROXY
/*
* Proxy configuration for remote SSL connections
*/
@@ -114,31 +114,11 @@
SSL_CMD_SRV(ProxyCipherSuite, TAKE1,
"SSL Proxy: colon-delimited list of permitted SSL ciphers "
"(`XXX:...:XXX' - see manual)")
- SSL_CMD_SRV(ProxyVerify, TAKE1,
- "SSL Proxy: whether to verify the remote certificate "
- "(`on' or `off')")
- SSL_CMD_SRV(ProxyVerifyDepth, TAKE1,
- "SSL Proxy: maximum certificate verification depth "
- "(`N' - number of intermediate certificates)")
- SSL_CMD_SRV(ProxyCACertificateFile, TAKE1,
- "SSL Proxy: file containing server certificates "
- "(`/path/to/file' - PEM encoded certificates)")
- SSL_CMD_SRV(ProxyCACertificatePath, TAKE1,
- "SSL Proxy: directory containing server certificates "
- "(`/path/to/dir' - contains PEM encoded certificates)")
- SSL_CMD_SRV(ProxyCARevocationPath, TAKE1,
- "SSL Proxy: CA Certificate Revocation List (CRL) path "
- "(`/path/to/dir' - contains PEM encoded files)")
- SSL_CMD_SRV(ProxyCARevocationFile, TAKE1,
- "SSL Proxy: CA Certificate Revocation List (CRL) file "
- "(`/path/to/file' - PEM encoded)")
- SSL_CMD_SRV(ProxyMachineCertificateFile, TAKE1,
- "SSL Proxy: file containing client certificates "
- "(`/path/to/file' - PEM encoded certificates)")
- SSL_CMD_SRV(ProxyMachineCertificatePath, TAKE1,
- "SSL Proxy: directory containing client certificates "
- "(`/path/to/dir' - contains PEM encoded certificates)")
+ SSL_CMD_SRV(ProxyNickname, TAKE1,
+ "SSL Proxy: client certificate Nickname to be for proxy connections "
+ "(`nickname')")
+#ifdef IGNORE
/* Deprecated directives. */
AP_INIT_RAW_ARGS("NSSLog", ap_set_deprecated, NULL, OR_ALL,
"SSLLog directive is no longer supported - use ErrorLog."),
@@ -183,7 +163,6 @@
return sslconn;
}
-#ifdef PROXY
int nss_proxy_enable(conn_rec *c)
{
SSLSrvConfigRec *sc = mySrvConfig(c->base_server);
@@ -193,7 +172,7 @@
if (!sc->proxy_enabled) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
"SSL Proxy requested for %s but not enabled "
- "[Hint: SSLProxyEngine]", sc->vhost_id);
+ "[Hint: NSSProxyEngine]", sc->vhost_id);
return 0;
}
@@ -203,7 +182,6 @@
return 1;
}
-#endif
int nss_engine_disable(conn_rec *c)
{
@@ -222,6 +200,76 @@
return 1;
}
+/* Callback for an incoming certificate that is not valid */
+
+SECStatus NSSBadCertHandler(void *arg, PRFileDesc * socket)
+{
+ conn_rec *c = (conn_rec *)arg;
+ PRErrorCode err = PR_GetError();
+ SECStatus rv = SECFailure;
+ CERTCertificate *peerCert = SSL_PeerCertificate(socket);
+
+ switch (err) {
+ case SSL_ERROR_BAD_CERT_DOMAIN:
+ if (c->remote_host != NULL) {
+ rv = CERT_VerifyCertName(peerCert, c->remote_host);
+ if (rv != SECSuccess) {
+ char *remote = CERT_GetCommonName(&peerCert->subject);
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "SSL Proxy: Possible man-in-the-middle attack. The remove server is %s, we expected %s", remote, c->remote_host, rv);
+ PORT_Free(remote);
+ }
+ } else {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "SSL Proxy: I don't have the name of the host we're supposed to connect to so I can't verify that we are connecting to who we think we should be. Giving up. Hint: See Apache bug 36468.");
+ }
+ break;
+ default:
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "Bad remote server certificate.", err);
+ nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL);
+ break;
+ }
+ return rv;
+}
+
+/* Callback to pull the client certificate upon server request */
+
+static SECStatus NSSGetClientAuthData(void *arg, PRFileDesc *socket,
+ CERTDistNames *caNames,
+ CERTCertificate **pRetCert,/*return */
+ SECKEYPrivateKey **pRetKey)
+{
+ CERTCertificate * cert;
+ SECKEYPrivateKey * privKey;
+ void * proto_win = NULL;
+ SECStatus rv = SECFailure;
+ char * localNickName = (char *)arg;
+
+ proto_win = SSL_RevealPinArg(socket);
+
+ if (localNickName) {
+ cert = CERT_FindUserCertByUsage(CERT_GetDefaultCertDB(),
+ localNickName, certUsageSSLClient,
+ PR_FALSE, proto_win);
+ if (cert) {
+ privKey = PK11_FindKeyByAnyCert(cert, proto_win);
+ if (privKey) {
+ rv = SECSuccess;
+ } else {
+ CERT_DestroyCertificate(cert);
+ }
+ }
+
+ if (rv == SECSuccess) {
+ *pRetCert = cert;
+ *pRetKey = privKey;
+ }
+ }
+
+ return rv;
+}
+
static int nss_hook_pre_connection(conn_rec *c, void *csd)
{
SSLSrvConfigRec *sc = mySrvConfig(c->base_server);
@@ -285,7 +333,28 @@
nss_io_filter_init(c, ssl);
- SSL_ResetHandshake(ssl, PR_TRUE);
+ SSL_ResetHandshake(ssl, mctx->as_server);
+
+ /* If we are doing a client connection, set our own bad certificate
+ * handler and register the nickname we want to use in case client
+ * authentication is requested.
+ */
+ if (!mctx->as_server) {
+ if (SSL_BadCertHook(ssl, (SSLBadCertHandler) NSSBadCertHandler, c) != SECSuccess)
+ {
+ /* errors are reported in the certificate handler */
+ return DECLINED;
+ }
+ if (mctx->nickname) {
+ if (SSL_GetClientAuthDataHook(ssl, NSSGetClientAuthData,
+ (void*)mctx->nickname) != SECSuccess)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
+ "Unable to register client authentication callback");
+ return DECLINED;
+ }
+ }
+ }
return APR_SUCCESS;
}
@@ -335,9 +404,7 @@
nss_var_register();
-#ifdef PROXY
APR_REGISTER_OPTIONAL_FN(nss_proxy_enable);
-#endif
APR_REGISTER_OPTIONAL_FN(nss_engine_disable);
}
Index: mod_nss.h
===================================================================
RCS file: /cvs/dirsec/mod_nss/mod_nss.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mod_nss.h 6 Sep 2005 14:51:43 -0000 1.6
+++ mod_nss.h 29 Sep 2005 19:35:43 -0000 1.7
@@ -238,6 +238,8 @@
char *cipherSuite;
+ int as_server;
+
int ssl2;
int ssl3;
int tls;
@@ -278,9 +280,7 @@
int nOptionsAdd;
int nOptionsDel;
const char *szCipherSuite;
- nss_verify_t nVerifyClient;
- const char *szCACertificatePath;
- const char *szCACertificateFile;
+ nss_verify_t nVerifyClient;
const char *szUserName;
} SSLDirConfigRec;
@@ -333,6 +333,11 @@
const char *nss_cmd_NSSRequireSSL(cmd_parms *cmd, void *dcfg);
const char *nss_cmd_NSSRequire(cmd_parms *, void *, const char *);
+const char *nss_cmd_NSSProxyEngine(cmd_parms *cmd, void *dcfg, int flag);
+const char *nss_cmd_NSSProxyProtocol(cmd_parms *, void *, const char *);
+const char *nss_cmd_NSSProxyCipherSuite(cmd_parms *, void *, const char *);
+const char *nss_cmd_NSSProxyNickname(cmd_parms *cmd, void *dcfg, const char *arg);
+
/* module initialization */
int nss_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);
void nss_init_Child(apr_pool_t *, server_rec *);
@@ -363,8 +368,11 @@
APR_DECLARE_OPTIONAL_FN(int, nss_is_https, (conn_rec *));
/* Proxy Support */
+int nss_proxy_enable(conn_rec *c);
int nss_engine_disable(conn_rec *c);
+APR_DECLARE_OPTIONAL_FN(int, nss_proxy_enable, (conn_rec *));
+
APR_DECLARE_OPTIONAL_FN(int, nss_engine_disable, (conn_rec *));
/* I/O */
Index: nss_engine_config.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_engine_config.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- nss_engine_config.c 6 Sep 2005 14:51:43 -0000 1.7
+++ nss_engine_config.c 29 Sep 2005 19:35:43 -0000 1.8
@@ -69,6 +69,8 @@
{
mctx->sc = NULL; /* set during module init */
+ mctx->as_server = PR_TRUE;
+
mctx->ssl2 = PR_FALSE;
mctx->ssl3 = PR_FALSE;
mctx->tls = PR_FALSE;
@@ -87,6 +89,18 @@
}
+static void modnss_ctx_init_proxy(SSLSrvConfigRec *sc,
+ apr_pool_t *p)
+{
+ modnss_ctx_t *mctx;
+
+ mctx = sc->proxy = apr_palloc(p, sizeof(*sc->proxy));
+
+ modnss_ctx_init(mctx);
+
+ mctx->as_server = PR_FALSE;
+}
+
static void modnss_ctx_init_server(SSLSrvConfigRec *sc,
apr_pool_t *p)
{
@@ -95,6 +109,8 @@
mctx = sc->server = apr_palloc(p, sizeof(*sc->server));
modnss_ctx_init(mctx);
+
+ mctx->as_server = PR_TRUE;
}
static SSLSrvConfigRec *nss_config_server_new(apr_pool_t *p)
@@ -111,9 +127,7 @@
sc->proxy = NULL;
sc->server = NULL;
-#ifdef PROXY
modnss_ctx_init_proxy(sc, p);
-#endif
modnss_ctx_init_server(sc, p);
@@ -149,6 +163,13 @@
cfgMerge(enforce, PR_TRUE);
}
+static void modnss_ctx_cfg_merge_proxy(modnss_ctx_t *base,
+ modnss_ctx_t *add,
+ modnss_ctx_t *mrg)
+{
+ modnss_ctx_cfg_merge(base, add, mrg);
+}
+
static void modnss_ctx_cfg_merge_server(modnss_ctx_t *base,
modnss_ctx_t *add,
modnss_ctx_t *mrg)
@@ -170,9 +191,7 @@
cfgMergeBool(enabled);
cfgMergeBool(proxy_enabled);
-#ifdef PROXY
modnss_ctx_cfg_merge_proxy(base->proxy, add->proxy, mrg->proxy);
-#endif
modnss_ctx_cfg_merge_server(base->server, add->server, mrg->server);
@@ -270,7 +289,7 @@
const char *nss_cmd_NSSFIPS(cmd_parms *cmd, void *dcfg, int flag)
{
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
-
+
sc->fips = flag ? TRUE : FALSE;
return NULL;
@@ -281,7 +300,7 @@
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
sc->ocsp = flag ? TRUE : FALSE;
-
+
return NULL;
}
@@ -395,6 +414,46 @@
return NULL;
}
+const char *nss_cmd_NSSProxyEngine(cmd_parms *cmd, void *dcfg, int flag)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->proxy_enabled = flag ? TRUE : FALSE;
+
+ return NULL;
+}
+
+const char *nss_cmd_NSSProxyProtocol(cmd_parms *cmd,
+ void *dcfg,
+ const char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->proxy->auth.protocols = arg;
+}
+
+const char *nss_cmd_NSSProxyCipherSuite(cmd_parms *cmd,
+ void *dcfg,
+ const char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->proxy->auth.cipher_suite = arg;
+
+ return NULL;
+}
+
+const char *nss_cmd_NSSProxyNickname(cmd_parms *cmd,
+ void *dcfg,
+ const char *arg)
+{
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+
+ sc->proxy->nickname = arg;
+
+ return NULL;
+}
+
const char *nss_cmd_NSSEnforceValidCerts(cmd_parms *cmd,
void *dcfg,
int flag)
Index: nss_engine_init.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_engine_init.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- nss_engine_init.c 13 Sep 2005 19:34:39 -0000 1.12
+++ nss_engine_init.c 29 Sep 2005 19:35:43 -0000 1.13
@@ -16,7 +16,9 @@
#include "mod_nss.h"
#include "apr_thread_proc.h"
#include "ap_mpm.h"
-#include <secmod.h>
+#include "secmod.h"
+#include "sslerr.h"
+#include "pk11func.h"
static SECStatus ownBadCertHandler(void *arg, PRFileDesc * socket);
static SECStatus ownHandshakeCallback(PRFileDesc * socket, void *arg);
@@ -111,6 +113,7 @@
SSLModConfigRec *mc = myModConfig(s);
SSLSrvConfigRec *sc;
int forked = 0;
+ char cwd[PATH_MAX];
sc = mySrvConfig(s);
@@ -172,8 +175,14 @@
/* Set the PKCS #11 strings for the internal token. */
PK11_ConfigurePKCS11(NULL,NULL,NULL, INTERNAL_TOKEN_NAME, NULL, NULL,NULL,NULL,8,1);
+ /* We need to be in the same directory as libnssckbi.so to load the
+ * root certificates properly.
+ */
+ getcwd(cwd, PATH_MAX);
+ chdir(mc->pCertificateDatabase);
/* 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);
/* Assuming everything is ok so far, check the cert database password(s). */
if (sslenabled && (rv != SECSuccess)) {
@@ -287,11 +296,9 @@
sc->server->sc = sc;
}
-#ifdef PROXY
if (sc->proxy) {
sc->proxy->sc = sc;
}
-#endif
/*
* Create the server host:port string because we need it a lot
@@ -366,8 +373,8 @@
/*
- * Announce mod_ssl and SSL library in HTTP Server field
- * as ``mod_ssl/X.X.X OpenSSL/X.X.X''
+ * Announce mod_nss and SSL library in HTTP Server field
+ * as ``mod_nss/X.X.X NSS/X.X.X''
*/
nss_add_version_components(p, base_server);
@@ -391,20 +398,28 @@
nss_die();
}
- if (SSL_OptionSet(mctx->model, SSL_HANDSHAKE_AS_SERVER, PR_TRUE)
+ if (SSL_OptionSet(mctx->model, SSL_HANDSHAKE_AS_SERVER, mctx->as_server)
!= SECSuccess) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"Unable to set SSL server handshake mode.");
nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
nss_die();
}
- if (SSL_OptionSet(mctx->model, SSL_HANDSHAKE_AS_CLIENT, PR_FALSE)
+ if (SSL_OptionSet(mctx->model, SSL_HANDSHAKE_AS_CLIENT, !mctx->as_server)
!= SECSuccess) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "Unable to disable handshake as client");
+ "Unable to set handshake as client");
nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
nss_die();
}
+ if (!mctx->as_server) {
+ if ((SSL_OptionSet(mctx->model, SSL_NO_CACHE, PR_TRUE)) != SECSuccess) {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ "Unable to disable SSL client caching");
+ nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
+ nss_die();
+ }
+ }
}
static void nss_init_ctx_protocol(server_rec *s,
@@ -622,7 +637,8 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"FIPS mode enabled, permitted SSL ciphers are: [%s]",
fipsciphers);
- }
+ }
+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"Configuring permitted SSL ciphers [%s]",
suite);
@@ -666,7 +682,7 @@
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"Cipher %s is enabled but this is not a FIPS cipher, disabling.", ciphers_def[i].name);
cipher_state[i] = PR_FALSE;
- }
+ }
}
}
@@ -728,18 +744,20 @@
* Get own certificate and private key.
*/
- if (mctx->nickname == NULL) {
+ if (mctx->nickname == NULL && mctx->as_server) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"No certificate nickname provided.");
nss_die();
}
- ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
- "Using nickname %s.", mctx->nickname);
+
+ if (mctx->nickname != NULL)
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
+ "Using nickname %s.", mctx->nickname);
mctx->servercert = FindServerCertFromNickname(mctx->nickname);
/* Verify the certificate chain. */
- if (mctx->servercert != NULL) {
+ if (mctx->servercert != NULL && mctx->as_server) {
SECCertificateUsage usage = certificateUsageSSLServer;
if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), mctx->servercert, PR_TRUE, usage, NULL, NULL) != SECSuccess) {
@@ -754,14 +772,14 @@
}
}
- if (NULL == mctx->servercert)
+ if (NULL == mctx->servercert && mctx->as_server)
{
ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
"Certificate not found: '%s'", mctx->nickname);
nss_die();
}
- if (strchr(mctx->nickname, ':'))
+ if (mctx->nickname && strchr(mctx->nickname, ':'))
{
char* token = strdup(mctx->nickname);
char* colon = strchr(token, ':');
@@ -786,17 +804,20 @@
slot = PK11_GetInternalKeySlot();
}
- mctx->serverkey = PK11_FindPrivateKeyFromCert(slot, mctx->servercert, NULL);
- PK11_FreeSlot(slot);
+ if (mctx->servercert) {
+ mctx->serverkey = PK11_FindPrivateKeyFromCert(slot, mctx->servercert, NULL);
+ PK11_FreeSlot(slot);
+ }
- if (mctx->serverkey == NULL) {
+ if (mctx->as_server && mctx->serverkey == NULL) {
ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
"Key not found for: '%s'", mctx->nickname);
nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
nss_die();
}
- mctx->serverKEAType = NSS_FindCertKEAType(mctx->servercert);
+ if (mctx->as_server) {
+ mctx->serverKEAType = NSS_FindCertKEAType(mctx->servercert);
/*
* Check for certs that are expired or not yet valid and WARN about it
@@ -824,6 +845,7 @@
"Unhandled Certificate time type %d for: '%s'", certtimestatus, mctx->nickname);
break;
}
+ }
secstatus = (SECStatus)SSL_SetPKCS11PinArg(mctx->model, NULL);
if (secstatus != SECSuccess) {
@@ -832,15 +854,15 @@
nss_die();
}
-#if 1
- secstatus = SSL_ConfigSecureServer(mctx->model, mctx->servercert, mctx->serverkey, mctx->serverKEAType);
- if (secstatus != SECSuccess) {
- ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
- "SSL error configuring server: '%s'", mctx->nickname);
- nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
- nss_die();
+ if (mctx->as_server) {
+ secstatus = SSL_ConfigSecureServer(mctx->model, mctx->servercert, mctx->serverkey, mctx->serverKEAType);
+ if (secstatus != SECSuccess) {
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
+ "SSL error configuring server: '%s'", mctx->nickname);
+ nss_log_nss_error(APLOG_MARK, APLOG_ERR, s);
+ nss_die();
+ }
}
-#endif
secstatus = (SECStatus)SSL_HandshakeCallback(mctx->model, (SSLHandshakeCallback)NSSHandshakeCallback, NULL);
if (secstatus != SECSuccess)
@@ -852,6 +874,16 @@
}
}
+static void nss_init_proxy_ctx(server_rec *s,
+ apr_pool_t *p,
+ apr_pool_t *ptemp,
+ SSLSrvConfigRec *sc)
+{
+ nss_init_ctx(s, p, ptemp, sc->proxy);
+
+ nss_init_server_certs(s, p, ptemp, sc->proxy);
+}
+
static void nss_init_server_ctx(server_rec *s,
apr_pool_t *p,
apr_pool_t *ptemp,
@@ -876,11 +908,11 @@
nss_init_server_ctx(s, p, ptemp, sc);
}
-#ifdef PROXY
if (sc->proxy_enabled) {
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
+ "Enabling proxy.");
nss_init_proxy_ctx(s, p, ptemp, sc);
}
-#endif
}
void nss_init_Child(apr_pool_t *p, server_rec *s)
@@ -936,10 +968,14 @@
{
PRErrorCode err = PR_GetError();
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
- "Bad certificate: %d", err);
-
- return SECFailure;
+ switch (err) {
+ default:
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "Bad remote server certificate.", err);
+ nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL);
+ return SECFailure;
+ break;
+ }
}
/*
@@ -1028,6 +1064,9 @@
PRUint32 bestCertMatchedUsage = 0;
PRBool bestCertIsValid = PR_FALSE;
+ if (name == NULL)
+ return NULL;
+
clist = PK11_ListCerts(PK11CertListUser, NULL);
for (cln = CERT_LIST_HEAD(clist); !CERT_LIST_END(cln,clist);
18 years, 5 months
[Fedora-directory-commits] console build.xml, 1.5, 1.6 buildnum.pl, 1.1, 1.2
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/console
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16699
Modified Files:
build.xml buildnum.pl
Log Message:
169552 - Minor build changes to support build and debug from Eclipse
Index: build.xml
===================================================================
RCS file: /cvs/dirsec/console/build.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- build.xml 15 Sep 2005 22:06:33 -0000 1.5
+++ build.xml 29 Sep 2005 17:18:23 -0000 1.6
@@ -70,9 +70,10 @@
</path>
<!-- Generate version property file -->
- <exec dir="${console.root}/console" executable="./buildnum.pl">
+ <exec executable="${console.root}/console/buildnum.pl" vmlauncher="true">
<arg line="-p ${built.dir}"/>
</exec>
+
<exec executable="${console.root}/console/src/com/netscape/management/client/console/genverinfo.sh">
<arg value="${console.root}/console/src/com/netscape/management/client/console/versioninfo.properties"/>
<arg value="${console.dotversion}"/>
@@ -131,7 +132,9 @@
<!-- compile regular java code -->
<javac srcdir="${java.src.dir}"
destdir="${built.classdir}"
- debug="${compile.debug}" deprecation="${compile.deprecation}"
+ debug="${compile.debug}"
+ debuglevel="lines,vars,source"
+ deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
verbose="no"
excludes="**/CVS/**">
Index: buildnum.pl
===================================================================
RCS file: /cvs/dirsec/console/buildnum.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- buildnum.pl 15 Sep 2005 22:06:33 -0000 1.1
+++ buildnum.pl 29 Sep 2005 17:18:23 -0000 1.2
@@ -58,7 +58,7 @@
# Load arguments
$platdir = $opt_p || exitHelp();
-$buildnum_file = "./$platdir/buildnum.dat";
+$buildnum_file = "$platdir/buildnum.dat";
# Get current time
@now = gmtime;
18 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/cm/newinst setup.patch, NONE, 1.1.2.1 setup, 1.9.2.2, 1.9.2.3
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/cm/newinst
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18846/ldap/cm/newinst
Modified Files:
Tag: Directory71RtmBranch
setup
Added Files:
Tag: Directory71RtmBranch
setup.patch
Log Message:
[167982] Service Pack framework
To make patch installation easier and less confusing, 1) adding a setup wrapper
(ldap/cm/newinst/setup.patch) for Solaris and HP as well as 2) adding some code
to RPM setup script (ldap/cm/newinst/setup) for RHELs, which checks the
existing server config files and retrieves the values needed for the upgrade.
setup.patch:
--- NEW FILE setup.patch ---
#!/bin/sh
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
#
# This script is a wrapper for dssetup used for inplace upgrade / patch
# installation.
#
clear
echo " Fedora Project"
echo " Fedora Server Products Installation/Uninstallation"
echo "-------------------------------------------------------------------------------"
echo ""
echo ""
echo "BY INSTALLING THIS SOFTWARE YOU ARE CONSENTING TO BE BOUND BY"
echo "AND ARE BECOMING A PARTY TO THE AGREEMENT FOUND IN THE"
echo "LICENSE.TXT FILE. IF YOU DO NOT AGREE TO ALL OF THE TERMS"
echo "OF THIS AGREEMENT, PLEASE DO NOT INSTALL OR USE THIS SOFTWARE."
echo ""
printf "Do you agree to the license terms? [No]: "
read ans
if [ "$ans" != "Y" -a "$ans" != "YES" -a "$ans" != "Yes" -a "$ans" != "y" -a "$ans" != "yes" ]; then
exit 1;
fi
clear
echo " Fedora Project"
echo " Fedora Server Products Installation/Uninstallation"
echo "-------------------------------------------------------------------------------"
echo ""
echo ""
echo "This program will extract the patch files and install them"
echo "into a directory where the Directory Server is already installed."
echo ""
echo "To accept the default shown in brackets, press the Enter key."
echo ""
printf "Install location [/opt/fedora/servers]: "
read serverroot
if [ ! -d $serverroot ]; then
echo ""
echo "Directory $serverroot does not exist."
exit 1
fi
if [ ! -f $serverroot/admin-serv/config/adm.conf ]; then
echo ""
echo "Administration Server's configuration file $serverroot/admin-serv/config/adm.conf does not exist."
exit 1
fi
getValFromAdminConf() {
cattr=$1
cfile=$2
rval=`grep -i $cattr $serverroot/admin-serv/config/$cfile | awk '{print $2}'`
echo $rval
}
dsinst=`getValFromAdminConf "ldapStart:" "adm.conf" | awk -F/ '{print $1}'`
dsconffile=$serverroot/$dsinst/config/dse.ldif
if [ ! -f $dsconffile ]; then
echo ""
echo "Directory Server's configuration file $dsconffile does not exist."
exit 1
fi
clear
ldaphost=`getValFromAdminConf "ldapHost:" "adm.conf"`
ldapport=`getValFromAdminConf "ldapPort:" "adm.conf"`
siepid=`getValFromAdminConf "siepid:" "adm.conf"`
suitespotuser=`ls -l $dsconffile | awk '{print $3}'`
suitespotgroup=`ls -l $dsconffile | awk '{print $4}'`
admindomain=`echo $ldaphost | awk -F. '{print $5 ? $2 "." $3 "." $4 "." $5: $4 ? $2 "." $3 "." $4 : $3 ? $2 "." $3 : $2 ? $2 : ""}'`
if [ "$admindomain" = "" ]; then
admindomain=`domainname`
fi
echo " Fedora Project"
echo " Directory Installation/Uninstallation"
echo "-------------------------------------------------------------------------------"
echo ""
echo "In order to reconfigure your installation, the Configuration Directory"
echo "Administrator password is required. Here is your current information:"
echo ""
echo "Configuration Directory: ldap://$ldaphost:$ldapport/o=NetscapeRoot"
echo "Configuration Administrator ID: $siepid"
echo ""
echo "At the prompt, please enter the password for the Configuration Administrator."
echo ""
echo "administrator ID: $siepid"
siepasswd=""
while [ "$siepasswd" = "" ]; do
printf "Password: "
read siepasswd
done
inffile=./myinstall.inf
echo "[General]" > $inffile
echo "FullMachineName= $ldaphost" >> $inffile
echo "SuiteSpotUserID= $suitespotuser" >> $inffile
echo "SuitespotGroup= $suitespotgroup" >> $inffile
echo "ServerRoot= $serverroot" >> $inffile
echo "ConfigDirectoryLdapURL= ldap://$ldaphost:$ldapport/" >> $inffile
echo "ConfigDirectoryAdminID= $siepid" >> $inffile
echo "AdminDomain= $admindomain" >> $inffile
echo "ConfigDirectoryAdminPwd= $siepasswd" >> $inffile
echo "Components= slapd-71sp1" >> $inffile
echo "" >> $inffile
echo "[slapd-71sp1]" >> $inffile
echo "Components= slapd-71sp1" >> $inffile
clear
./dssetup -s -f $inffile
Index: setup
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/setup,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -u -r1.9.2.2 -r1.9.2.3
--- setup 9 Sep 2005 22:50:37 -0000 1.9.2.2
+++ setup 28 Sep 2005 22:47:14 -0000 1.9.2.3
@@ -130,6 +130,13 @@
echo $maxhost
}
+getValFromAdminConf() {
+ cattr=$1
+ cfile=$2
+ rval=`grep -i $cattr $sroot/admin-serv/config/$cfile | awk '{print $2}'`
+ echo $rval
+}
+
logfile=`doMktmp log`
myargs=
silent=
@@ -192,6 +199,61 @@
askYN "Continue?"
fi
+# check whether it is an in-place installation
+if [ -f $sroot/admin-serv/config/adm.conf ]; then
+ dsinst=`getValFromAdminConf "ldapStart:" "adm.conf" | awk -F/ '{print $1}'`
+ if [ -f $sroot/$dsinst/config/dse.ldif ]; then
+ # it is an in=place installation
+ ldaphost=`getValFromAdminConf "ldapHost:" "adm.conf"`
+ ldapport=`getValFromAdminConf "ldapPort:" "adm.conf"`
+ adminport=`getValFromAdminConf "\<port:" "adm.conf"`
+ siepid=`getValFromAdminConf "siepid:" "adm.conf"`
+ sysuser=`getValFromAdminConf "nsSuiteSpotUser:" "local.conf"`
+ suitespotuser=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $3}'`
+ suitespotgroup=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $4}'`
+ admindomain=`echo $ldaphost | awk -F. '{print $5 ? $2 "." $3 "." $4 "." $5: $4 ? $2 "." $3 "." $4 : $3 ? $2 "." $3 : $2 ? $2 : ""}'`
+ if [ "$admindomain" = "" ]; then
+ admindomain=`domainname`
+ fi
+
+ echo "In order to reconfigure your installation, the Configuration Directory"
+ echo "Administrator password is required. Here is your current information:"
+ echo ""
+ echo "Configuration Directory: ldap://$ldaphost:$ldapport/o=NetscapeRoot"
+ echo "Configuration Administrator ID: $siepid"
+ echo ""
+ echo "At the prompt, please enter the password for the Configuration Administrator."
+ echo ""
+ echo "administrator ID: $siepid"
+ siepasswd=""
+ while [ "$siepasswd" = "" ]; do
+ printf "Password: "
+ read siepasswd
+ done
+
+ inffile=$sroot/setup/myinstall.inf
+ echo "[General]" > $inffile
+ echo "FullMachineName= $ldaphost" >> $inffile
+ echo "SuiteSpotUserID= $suitespotuser" >> $inffile
+ echo "SuitespotGroup= $suitespotgroup" >> $inffile
+ echo "ServerRoot= $sroot" >> $inffile
+ echo "ConfigDirectoryLdapURL= ldap://$ldaphost:$ldapport/o=NetscapeRoot" >> $inffile
+ echo "ConfigDirectoryAdminID= $siepid" >> $inffile
+ echo "AdminDomain= $admindomain" >> $inffile
+ echo "ConfigDirectoryAdminPwd= $siepasswd" >> $inffile
+ echo "" >> $inffile
+ echo "[admin]" >> $inffile
+ echo "ServerAdminID= $siepid" >> $inffile
+ echo "ServerAdminPwd= $siepasswd" >> $inffile
+ echo "SysUser= $sysuser" >> $inffile
+ echo "Port= $adminport" >> $inffile
+ echo "ServerIpAddress=" >> $inffile
+
+ # set silent mode
+ silent=1
+ fi
+fi
+
# dsktune
if ! [ $silent ]; then
bin/slapd/server/dsktune | tee -a $logfile
18 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/cm Makefile, 1.30.2.7, 1.30.2.8 fedora-patch.inf, 1.1.2.3, 1.1.2.4 redhat-patch.inf, 1.1.2.3, 1.1.2.4
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/cm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18846/ldap/cm
Modified Files:
Tag: Directory71RtmBranch
Makefile fedora-patch.inf redhat-patch.inf
Log Message:
[167982] Service Pack framework
To make patch installation easier and less confusing, 1) adding a setup wrapper
(ldap/cm/newinst/setup.patch) for Solaris and HP as well as 2) adding some code
to RPM setup script (ldap/cm/newinst/setup) for RHELs, which checks the
existing server config files and retrieves the values needed for the upgrade.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/Makefile,v
retrieving revision 1.30.2.7
retrieving revision 1.30.2.8
diff -u -r1.30.2.7 -r1.30.2.8
--- Makefile 16 Sep 2005 20:01:17 -0000 1.30.2.7
+++ Makefile 28 Sep 2005 22:47:13 -0000 1.30.2.8
@@ -813,13 +813,14 @@
cp $(INSTDIR)/dssetup $(PATCHINSTDIR)
cp $(INSTDIR)/LICENSE.txt $(PATCHINSTDIR)
cp $(INSTDIR)/README.txt $(PATCHINSTDIR)
+ cp $(BUILD_ROOT)/ldap/cm/newinst/setup.patch $(PATCHINSTDIR)/setup
# prepare the main inf file: setup.inf pointing inf file $(SLAPDS)/$(SLAPD).inf
sed -e "s/Components.*=/Components = $(SLAPDSP)/" $(INSTDIR)/setup.inf > $(PATCHINSTDIR)/setup.inf
echo "" >> $(PATCHINSTDIR)/setup.inf
echo "[$(SLAPDSP)]" >> $(PATCHINSTDIR)/setup.inf
echo "ComponentInfoFile = $(SLAPDSP)/$(SLAPDSP).inf" >> $(PATCHINSTDIR)/setup.inf
# create a zip file based upon the $(PATCHINF) file
- cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep file: $(PATCHINF) | awk -F: '{print $$3}'`
+ cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep "^file:" $(PATCHINF) | awk -F: '{print $$3}'`
# put ns-config and needed libs in the $(PATCHINSTDIR)/$(SLAPDSP) directory
$(INSTALL) -m 755 $(RELDIR_32)/bin/slapd/admin/bin/ns-config $(PATCHINSTDIR)/$(SLAPDSP)
-@for file in $(PACKAGE_SETUP_LIBS_32) ; \
@@ -829,7 +830,7 @@
done
# create patch inf file: $(SLAPD).inf
cp $(OBJDIR)/slapd-patch.inf $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf
- cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep file: $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp
+ cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep "^file:" $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp
echo `cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp` | sed -e "s/ /,/g" > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2
echo "BackupFiles="`cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2`>> $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf
rm -f $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2
Index: fedora-patch.inf
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/fedora-patch.inf,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- fedora-patch.inf 12 Sep 2005 20:05:15 -0000 1.1.2.3
+++ fedora-patch.inf 28 Sep 2005 22:47:13 -0000 1.1.2.4
@@ -38,7 +38,7 @@
#
# Info file to generate DS7.1 SP1 patch
# base: <builddir> containing the base package -- DS7.1
-# file: <patchfile>
+# file: bug#: <patchfile>
#
base: /share/dev4/fedora-ds/fds71/ships/20050526.1
@@ -56,6 +56,7 @@
file: 156120,159037: winsync/PassSync.msi
file: 156120,159037: winsync/ntds.msi
file: 167761: java/jars/ds71.jar
+file: 169388: lib/replication-plugin.*
file: xxxxxx: bin/slapd/README.txt
file: xxxxxx: README.txt
Index: redhat-patch.inf
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/redhat-patch.inf,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- redhat-patch.inf 12 Sep 2005 20:05:15 -0000 1.1.2.3
+++ redhat-patch.inf 28 Sep 2005 22:47:13 -0000 1.1.2.4
@@ -38,7 +38,7 @@
#
# Info file to generate DS7.1 SP1 patch
# base: <builddir> containing the base package -- DS7.1
-# file: <patchfile>
+# file: bug#: <patchfile>
#
base: /share/dev4/ds/ds71/ships/20050524.1
@@ -56,5 +56,6 @@
file: 156120,159037: winsync/PassSync.msi
file: 156120,159037: winsync/ntds.msi
file: 167761: java/jars/ds71.jar
+file: 169388: lib/replication-plugin.*
file: xxxxxx: bin/slapd/README.txt
file: xxxxxx: README.txt
18 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication windows_protocol_util.c, 1.20, 1.20.2.1
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15510
Modified Files:
Tag: Directory71RtmBranch
windows_protocol_util.c
Log Message:
169388 - Fixed attribute comparision helper function that was causing certain changes to not get synched.
Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -r1.20 -r1.20.2.1
--- windows_protocol_util.c 12 May 2005 03:46:20 -0000 1.20
+++ windows_protocol_util.c 28 Sep 2005 20:27:53 -0000 1.20.2.1
@@ -1532,7 +1532,7 @@
slapi_attr_first_value(a, &va);
slapi_attr_first_value(b, &vb);
- if (va->bv.bv_len == va->bv.bv_len)
+ if (va->bv.bv_len == vb->bv.bv_len)
{
if (0 != memcmp(va->bv.bv_val,vb->bv.bv_val,va->bv.bv_len))
{
18 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication windows_protocol_util.c, 1.20, 1.21
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15419
Modified Files:
windows_protocol_util.c
Log Message:
169388 - Fixed attribute comparision helper function that was causing certain changes to not get synched.
Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- windows_protocol_util.c 12 May 2005 03:46:20 -0000 1.20
+++ windows_protocol_util.c 28 Sep 2005 20:21:20 -0000 1.21
@@ -1532,7 +1532,7 @@
slapi_attr_first_value(a, &va);
slapi_attr_first_value(b, &vb);
- if (va->bv.bv_len == va->bv.bv_len)
+ if (va->bv.bv_len == vb->bv.bv_len)
{
if (0 != memcmp(va->bv.bv_val,vb->bv.bv_val,va->bv.bv_len))
{
18 years, 5 months
[Fedora-directory-commits] mod_admserv configure, 1.9, 1.10 configure.in, 1.8, 1.9
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/mod_admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22420
Modified Files:
configure configure.in
Log Message:
use nspr and nss instead of mozilla-nspr and -nss
Index: configure
===================================================================
RCS file: /cvs/dirsec/mod_admserv/configure,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- configure 24 Sep 2005 03:09:23 -0000 1.9
+++ configure 26 Sep 2005 19:40:08 -0000 1.10
@@ -8473,9 +8473,9 @@
fi
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nspr; then
- nspr_inc=`$PKG_CONFIG --cflags-only-I mozilla-nspr`
- nspr_lib=`$PKG_CONFIG --libs-only-L mozilla-nspr`
+ if $PKG_CONFIG --exists nspr; then
+ nspr_inc=`$PKG_CONFIG --cflags-only-I nspr`
+ nspr_lib=`$PKG_CONFIG --libs-only-L nspr`
else
{ { echo "$as_me:$LINENO: error: NSPR not found, specify with --with-nspr." >&5
echo "$as_me: error: NSPR not found, specify with --with-nspr." >&2;}
@@ -8732,9 +8732,9 @@
fi
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nss; then
- nss_inc=`$PKG_CONFIG --cflags-only-I mozilla-nss`
- nss_lib=`$PKG_CONFIG --libs-only-L mozilla-nss`
+ if $PKG_CONFIG --exists nss; then
+ nss_inc=`$PKG_CONFIG --cflags-only-I nss`
+ nss_lib=`$PKG_CONFIG --libs-only-L nss`
else
{ { echo "$as_me:$LINENO: error: NSS not found, specify with --with-nss." >&5
echo "$as_me: error: NSS not found, specify with --with-nss." >&2;}
Index: configure.in
===================================================================
RCS file: /cvs/dirsec/mod_admserv/configure.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- configure.in 24 Sep 2005 02:58:19 -0000 1.8
+++ configure.in 26 Sep 2005 19:40:08 -0000 1.9
@@ -151,9 +151,9 @@
AC_MSG_CHECKING(for nspr with pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nspr; then
- nspr_inc=`$PKG_CONFIG --cflags-only-I mozilla-nspr`
- nspr_lib=`$PKG_CONFIG --libs-only-L mozilla-nspr`
+ if $PKG_CONFIG --exists nspr; then
+ nspr_inc=`$PKG_CONFIG --cflags-only-I nspr`
+ nspr_lib=`$PKG_CONFIG --libs-only-L nspr`
else
AC_MSG_ERROR([NSPR not found, specify with --with-nspr.])
fi
@@ -292,9 +292,9 @@
AC_MSG_CHECKING(for nss with pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nss; then
- nss_inc=`$PKG_CONFIG --cflags-only-I mozilla-nss`
- nss_lib=`$PKG_CONFIG --libs-only-L mozilla-nss`
+ if $PKG_CONFIG --exists nss; then
+ nss_inc=`$PKG_CONFIG --cflags-only-I nss`
+ nss_lib=`$PKG_CONFIG --libs-only-L nss`
else
AC_MSG_ERROR([NSS not found, specify with --with-nss.])
fi
18 years, 5 months
[Fedora-directory-commits] mod_nss configure, 1.5, 1.6 configure.in, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/mod_nss
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22339
Modified Files:
configure configure.in
Log Message:
separate with options for include and lib directories - use nspr and nss instead of mozilla-nspr and -nss
Index: configure
===================================================================
RCS file: /cvs/dirsec/mod_nss/configure,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configure 13 Sep 2005 19:34:39 -0000 1.5
+++ configure 26 Sep 2005 19:38:52 -0000 1.6
@@ -1022,7 +1022,11 @@
--with-apr-config Use apr-config to determine the APR directory
--with-apxs=PATH Path to apxs
--with-nspr=PATH Netscape Portable Runtime (NSPR) directory
+ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory
+ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory
--with-nss=PATH Network Security Services (NSS) directory
+ --with-nss-inc=PATH Network Security Services (NSS) include directory
+ --with-nss-lib=PATH Network Security Services (NSS) library directory
Some influential environment variables:
CC C compiler command
@@ -4537,7 +4541,7 @@
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4540 "configure"' > conftest.$ac_ext
+ echo '#line 4544 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5066,7 +5070,7 @@
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
-if { (eval echo configure:5069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:5073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s out/conftest.err; then
@@ -6250,7 +6254,7 @@
libsuff=
case "$host_cpu" in
x86_64*|s390x*)
- echo '#line 6253 "configure"' > conftest.$ac_ext
+ echo '#line 6257 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -6922,7 +6926,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6925 "configure"
+#line 6929 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -7020,7 +7024,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 7023 "configure"
+#line 7027 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -8468,7 +8472,6 @@
fi
-
{ echo "$as_me:$LINENO: checking for apr-config..." >&5
echo "$as_me: checking for apr-config..." >&6;}
# check for --with-apr-config
@@ -8569,12 +8572,16 @@
# if no apxs found yet, check /usr/local/apache/sbin
# since it's the default Apache location
if test -z "$APXS"; then
- echo "$as_me:$LINENO: checking for apxs in /usr/local/apache/sbin" >&5
-echo $ECHO_N "checking for apxs in /usr/local/apache/sbin... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for apxs in /usr/local/apache/sbin and /usr/sbin" >&5
+echo $ECHO_N "checking for apxs in /usr/local/apache/sbin and /usr/sbin... $ECHO_C" >&6
if test -x /usr/local/apache/sbin/apxs; then
APXS=/usr/local/apache/sbin/apxs
echo "$as_me:$LINENO: result: found $APXS. Use --with-apxs to specify another." >&5
echo "${ECHO_T}found $APXS. Use --with-apxs to specify another." >&6
+ elif test -x /usr/sbin/apxs; then
+ APXS=/usr/sbin/apxs
+ echo "$as_me:$LINENO: result: found $APXS. Use --with-apxs to specify another." >&5
+echo "${ECHO_T}found $APXS. Use --with-apxs to specify another." >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
@@ -8662,7 +8669,7 @@
if test "${with_nspr+set}" = set; then
withval="$with_nspr"
- if test -e "$withval"/include/nspr.h
+ if test -e "$withval"/include/nspr.h -a -d "$withval"/lib
then
echo "$as_me:$LINENO: result: using $withval" >&5
echo "${ECHO_T}using $withval" >&6
@@ -8681,10 +8688,60 @@
echo "${ECHO_T}no" >&6
fi;
+# check for --with-nspr-inc
+echo "$as_me:$LINENO: checking for --with-nspr-inc" >&5
+echo $ECHO_N "checking for --with-nspr-inc... $ECHO_C" >&6
+
+# Check whether --with-nspr-inc or --without-nspr-inc was given.
+if test "${with_nspr_inc+set}" = set; then
+ withval="$with_nspr_inc"
+
+ if test -e "$withval"/nspr.h
+ then
+ echo "$as_me:$LINENO: result: using $withval" >&5
+echo "${ECHO_T}using $withval" >&6
+ nspr_inc="-I$withval"
+ else
+ echo
+ { { echo "$as_me:$LINENO: error: $withval not found" >&5
+echo "$as_me: error: $withval not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
+# check for --with-nspr-lib
+echo "$as_me:$LINENO: checking for --with-nspr-lib" >&5
+echo $ECHO_N "checking for --with-nspr-lib... $ECHO_C" >&6
+
+# Check whether --with-nspr-lib or --without-nspr-lib was given.
+if test "${with_nspr_lib+set}" = set; then
+ withval="$with_nspr_lib"
+
+ if test -d "$withval"
+ then
+ echo "$as_me:$LINENO: result: using $withval" >&5
+echo "${ECHO_T}using $withval" >&6
+ nspr_lib="-L$withval"
+ else
+ echo
+ { { echo "$as_me:$LINENO: error: $withval not found" >&5
+echo "$as_me: error: $withval not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
# if NSPR is not found yet, try pkg-config
# last resort
-if test -z "$NSPRDIR"; then
+if test -z "$nspr_inc" -o -z "$nspr_lib"; then
echo "$as_me:$LINENO: checking for nspr with pkg-config" >&5
echo $ECHO_N "checking for nspr with pkg-config... $ECHO_C" >&6
# Extract the first word of "pkg-config", so it can be a program name with args.
@@ -8727,9 +8784,9 @@
fi
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nspr; then
- nspr_inc=`$PKG_CONFIG --cflags-only-I mozilla-nspr`
- nspr_lib=`$PKG_CONFIG --libs-only-L mozilla-nspr`
+ if $PKG_CONFIG --exists nspr; then
+ nspr_inc=`$PKG_CONFIG --cflags-only-I nspr`
+ nspr_lib=`$PKG_CONFIG --libs-only-L nspr`
else
{ { echo "$as_me:$LINENO: error: NSPR not found, specify with --with-nspr." >&5
echo "$as_me: error: NSPR not found, specify with --with-nspr." >&2;}
@@ -8749,7 +8806,7 @@
if test "${with_nss+set}" = set; then
withval="$with_nss"
- if test -e "$withval"/include/nss.h
+ if test -e "$withval"/include/nss.h -a -d "$withval"/lib
then
echo "$as_me:$LINENO: result: using $withval" >&5
echo "${ECHO_T}using $withval" >&6
@@ -8768,10 +8825,60 @@
echo "${ECHO_T}no" >&6
fi;
+# check for --with-nss-inc
+echo "$as_me:$LINENO: checking for --with-nss-inc" >&5
+echo $ECHO_N "checking for --with-nss-inc... $ECHO_C" >&6
+
+# Check whether --with-nss-inc or --without-nss-inc was given.
+if test "${with_nss_inc+set}" = set; then
+ withval="$with_nss_inc"
+
+ if test -e "$withval"/nss.h
+ then
+ echo "$as_me:$LINENO: result: using $withval" >&5
+echo "${ECHO_T}using $withval" >&6
+ nss_inc="-I$withval"
+ else
+ echo
+ { { echo "$as_me:$LINENO: error: $withval not found" >&5
+echo "$as_me: error: $withval not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
+# check for --with-nss-lib
+echo "$as_me:$LINENO: checking for --with-nss-lib" >&5
+echo $ECHO_N "checking for --with-nss-lib... $ECHO_C" >&6
+
+# Check whether --with-nss-lib or --without-nss-lib was given.
+if test "${with_nss_lib+set}" = set; then
+ withval="$with_nss_lib"
+
+ if test -d "$withval"
+ then
+ echo "$as_me:$LINENO: result: using $withval" >&5
+echo "${ECHO_T}using $withval" >&6
+ nss_lib="-L$withval"
+ else
+ echo
+ { { echo "$as_me:$LINENO: error: $withval not found" >&5
+echo "$as_me: error: $withval not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
# if NSS is not found yet, try pkg-config
# last resort
-if test -z "$NSSDIR"; then
+if test -z "$nss_inc" -o -z "$nss_lib"; then
echo "$as_me:$LINENO: checking for nss with pkg-config" >&5
echo $ECHO_N "checking for nss with pkg-config... $ECHO_C" >&6
# Extract the first word of "pkg-config", so it can be a program name with args.
@@ -8814,9 +8921,9 @@
fi
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nss; then
- nss_inc=`$PKG_CONFIG --cflags-only-I mozilla-nss`
- nss_lib=`$PKG_CONFIG --libs-only-L mozilla-nss`
+ if $PKG_CONFIG --exists nss; then
+ nss_inc=`$PKG_CONFIG --cflags-only-I nss`
+ nss_lib=`$PKG_CONFIG --libs-only-L nss`
else
{ { echo "$as_me:$LINENO: error: NSS not found, specify with --with-nss." >&5
echo "$as_me: error: NSS not found, specify with --with-nss." >&2;}
Index: configure.in
===================================================================
RCS file: /cvs/dirsec/mod_nss/configure.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configure.in 13 Sep 2005 19:34:39 -0000 1.5
+++ configure.in 26 Sep 2005 19:38:52 -0000 1.6
@@ -73,10 +73,13 @@
# if no apxs found yet, check /usr/local/apache/sbin
# since it's the default Apache location
if test -z "$APXS"; then
- AC_MSG_CHECKING(for apxs in /usr/local/apache/sbin)
+ AC_MSG_CHECKING(for apxs in /usr/local/apache/sbin and /usr/sbin)
if test -x /usr/local/apache/sbin/apxs; then
APXS=/usr/local/apache/sbin/apxs
AC_MSG_RESULT([found $APXS. Use --with-apxs to specify another.])
+ elif test -x /usr/sbin/apxs; then
+ APXS=/usr/sbin/apxs
+ AC_MSG_RESULT([found $APXS. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
@@ -114,7 +117,7 @@
AC_MSG_CHECKING(for --with-nspr)
AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory],
[
- if test -e "$withval"/include/nspr.h
+ if test -e "$withval"/include/nspr.h -a -d "$withval"/lib
then
AC_MSG_RESULT([using $withval])
NSPRDIR=$withval
@@ -127,16 +130,46 @@
],
AC_MSG_RESULT(no))
+# check for --with-nspr-inc
+AC_MSG_CHECKING(for --with-nspr-inc)
+AC_ARG_WITH(nspr-inc, [ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory],
+[
+ if test -e "$withval"/nspr.h
+ then
+ AC_MSG_RESULT([using $withval])
+ nspr_inc="-I$withval"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+AC_MSG_RESULT(no))
+
+# check for --with-nspr-lib
+AC_MSG_CHECKING(for --with-nspr-lib)
+AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory],
+[
+ if test -d "$withval"
+ then
+ AC_MSG_RESULT([using $withval])
+ nspr_lib="-L$withval"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+AC_MSG_RESULT(no))
+
# if NSPR is not found yet, try pkg-config
# last resort
-if test -z "$NSPRDIR"; then
+if test -z "$nspr_inc" -o -z "$nspr_lib"; then
AC_MSG_CHECKING(for nspr with pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nspr; then
- nspr_inc=`$PKG_CONFIG --cflags-only-I mozilla-nspr`
- nspr_lib=`$PKG_CONFIG --libs-only-L mozilla-nspr`
+ if $PKG_CONFIG --exists nspr; then
+ nspr_inc=`$PKG_CONFIG --cflags-only-I nspr`
+ nspr_lib=`$PKG_CONFIG --libs-only-L nspr`
else
AC_MSG_ERROR([NSPR not found, specify with --with-nspr.])
fi
@@ -149,7 +182,7 @@
AC_MSG_CHECKING(for --with-nss)
AC_ARG_WITH(nss, [ --with-nss=PATH Network Security Services (NSS) directory],
[
- if test -e "$withval"/include/nss.h
+ if test -e "$withval"/include/nss.h -a -d "$withval"/lib
then
AC_MSG_RESULT([using $withval])
NSSDIR=$withval
@@ -162,16 +195,46 @@
],
AC_MSG_RESULT(no))
+# check for --with-nss-inc
+AC_MSG_CHECKING(for --with-nss-inc)
+AC_ARG_WITH(nss-inc, [ --with-nss-inc=PATH Network Security Services (NSS) include directory],
+[
+ if test -e "$withval"/nss.h
+ then
+ AC_MSG_RESULT([using $withval])
+ nss_inc="-I$withval"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+AC_MSG_RESULT(no))
+
+# check for --with-nss-lib
+AC_MSG_CHECKING(for --with-nss-lib)
+AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Network Security Services (NSS) library directory],
+[
+ if test -d "$withval"
+ then
+ AC_MSG_RESULT([using $withval])
+ nss_lib="-L$withval"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+AC_MSG_RESULT(no))
+
# if NSS is not found yet, try pkg-config
# last resort
-if test -z "$NSSDIR"; then
+if test -z "$nss_inc" -o -z "$nss_lib"; then
AC_MSG_CHECKING(for nss with pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
- if $PKG_CONFIG --exists mozilla-nss; then
- nss_inc=`$PKG_CONFIG --cflags-only-I mozilla-nss`
- nss_lib=`$PKG_CONFIG --libs-only-L mozilla-nss`
+ if $PKG_CONFIG --exists nss; then
+ nss_inc=`$PKG_CONFIG --cflags-only-I nss`
+ nss_lib=`$PKG_CONFIG --libs-only-L nss`
else
AC_MSG_ERROR([NSS not found, specify with --with-nss.])
fi
18 years, 5 months