Browse Source

149510

More ACL system code cleanup. Fix several compiler warnings, simplify
some includes.
Rob Crittenden 21 years ago
parent
commit
ea64bb776b

+ 0 - 1
httpd/src/ntnsapi.c

@@ -15,7 +15,6 @@
 
 #include <libadmin/libadmin.h>
 #include <libaccess/aclproto.h>
-#include <libaccess/nsadb.h>
 #include <base/fsmutex.h>
 #include <i18n.h>
 #include <base/ereport.h>

+ 0 - 5
include/base/crit.h

@@ -24,11 +24,6 @@
 #include "netsite.h"
 #endif /* !NETSITE_H */
 
-/* Define C interface */
-#ifndef PUBLIC_BASE_CRIT_H
-#include "public/base/crit.h"
-#endif /* !PUBLIC_BASE_CRIT_H */
-
 /* Define C++ interface */
 #ifdef __cplusplus
 

+ 0 - 4
include/base/ereport.h

@@ -16,10 +16,6 @@
  * Rob McCool
  */
 
-#ifndef PUBLIC_BASE_EREPORT_H
-#include "public/base/ereport.h"
-#endif /* !PUBLIC_BASE_EREPORT_H */
-
 /* --- Begin function prototypes --- */
 
 #ifdef INTNSAPI

+ 0 - 4
include/base/file.h

@@ -19,10 +19,6 @@
 #include "../netsite.h"
 #endif /* !NETSITE_H */
 
-#ifndef PUBLIC_BASE_FILE_H
-#include "public/base/file.h"
-#endif /* !PUBLIC_BASE_FILE_H */
-
 /* --- Begin function prototypes --- */
 
 #ifdef INTNSAPI

+ 0 - 4
include/base/pool.h

@@ -30,10 +30,6 @@
 #include "netsite.h"
 #endif /* !NETSITE_H */
 
-#ifndef PUBLIC_BASE_POOL_H
-#include "public/base/pool.h"
-#endif /* !PUBLIC_BASE_POOL_H */
-
 /* --- Begin function prototypes --- */
 
 #ifdef INTNSAPI

+ 0 - 4
include/base/shexp.h

@@ -72,10 +72,6 @@
 #endif /* USE_REGEX */
 #endif /* !MCC_PROXY */
 
-#ifndef PUBLIC_BASE_SHEXP_H
-#include "public/base/shexp.h"
-#endif /* !PUBLIC_BASE_SHEXP_H */
-
 /* --- Begin function prototypes --- */
 
 #ifdef INTNSAPI

+ 1 - 5
include/base/systems.h

@@ -256,7 +256,6 @@
 #define NEED_SETEID_PROTO /* setegid, seteuid */
 #define NET_SOCKETS
 #define SHMEM_MMAP_FLAGS MAP_SHARED
-#define TCPLEN_T size_t
 #define USE_PIPE
 /*
  * define this if your C++ platform has separate inline functions for
@@ -449,6 +448,7 @@ typedef void* PASSWD;
 #include "public/base/systems.h"
 #endif /* PUBLIC_BASE_SYSTEMS_H */
 
+
 /* --- Begin defaults for values not defined above --- */
 
 #ifndef DAEMON_LISTEN_SIZE
@@ -465,10 +465,6 @@ typedef void* PASSWD;
 #define CONSTVALSTRCAST
 #endif
 
-#ifndef TCPLEN_T
-#define TCPLEN_T int
-#endif
-
 #ifndef THROW_HACK
 #define THROW_HACK /* as nothing */
 #endif

+ 0 - 4
include/base/systhr.h

@@ -22,10 +22,6 @@
 
 #ifdef THREAD_ANY
 
-#ifndef PUBLIC_BASE_SYSTHR_H
-#include "public/base/systhr.h"
-#endif /* !PUBLIC_BASE_SYSTHR_H */
-
 /* --- Begin function prototypes --- */
 
 #ifdef INTNSAPI

+ 4 - 13
include/base/util.h

@@ -17,9 +17,10 @@
  * Rob McCool
  */
 
-#ifndef PUBLIC_BASE_UTIL_H
-#include "public/base/util.h"
-#endif /* !PUBLIC_BASE_UTIL_H */
+#ifndef PUBLIC_NSAPI_H
+#include "public/nsapi.h"
+#endif /* !PUBLIC_NSAPI_H */
+
 
 /* --- Begin common function prototypes --- */
 
@@ -68,20 +69,10 @@ NSPR_END_EXTERN_C
 #define util_strncasecmp INTutil_strncasecmp
 #define util_localtime INTutil_localtime
 
-#ifdef NEED_STRCASECMP
-#define util_strcasecmp INTutil_strcasecmp
-#define strcasecmp INTutil_strcasecmp
-#endif /* NEED_STRCASECMP */
-
 #ifdef NEED_STRINGS_H /* usually for strcasecmp */
 #include <strings.h>
 #endif
 
-#ifdef NEED_STRNCASECMP
-#define util_strncasecmp INTutil_strncasecmp
-#define strncasecmp INTutil_strncasecmp
-#endif /* NEED_STRNCASECMP */
-
 #endif /* INTNSAPI */
 
 #endif /* !BASE_UTIL_H */

+ 0 - 90
include/netsite.h

@@ -41,69 +41,6 @@
 #include "base/systems.h"
 #endif /* !BASE_SYSTEMS_H */
 
-#undef MAGNUS_VERSION_STRING
-
-#ifdef MCC_PROXY
-#define MAGNUS_VERSION PROXY_VERSION_DEF
-#define MAGNUS_VERSION_STRING PROXY_VERSION_STRING
-
-#elif defined(NS_CMS)
-#define MAGNUS_VERSION CMS_VERSION_DEF
-#define MAGNUS_VERSION_STRING CMS_VERSION_STRING
-
-#elif defined(NS_DS)
-#define MAGNUS_VERSION DS_VERSION_DEF
-#define MAGNUS_VERSION_STRING DS_VERSION_STRING
-
-#elif defined(MCC_ADMSERV)
-#define MAGNUS_VERSION ADMSERV_VERSION_DEF
-#define MAGNUS_VERSION_STRING ADMSERV_VERSION_STRING
-
-#elif defined(NS_CATALOG)
-#define MAGNUS_VERSION CATALOG_VERSION_DEF
-#define MAGNUS_VERSION_STRING CATALOG_VERSION_STRING
-
-#elif defined(NS_RDS)
-#define MAGNUS_VERSION RDS_VERSION_DEF
-#define MAGNUS_VERSION_STRING RDS_VERSION_STRING
-
-#elif defined(MCC_HTTPD)
-
-#ifdef NS_PERSONAL
-#define MAGNUS_VERSION PERSONAL_VERSION_DEF
-#else
-#define MAGNUS_VERSION ENTERPRISE_VERSION_DEF
-#endif
-
-#if defined(XP_UNIX) || defined(USE_ADMSERV)
-#if defined(NS_DS)
-#define MAGNUS_VERSION_STRING DS_VERSION_STRING
-#elif defined(NS_PERSONAL)
-#define MAGNUS_VERSION_STRING PERSONAL_VERSION_STRING
-#elif defined(NS_CATALOG)
-#define MAGNUS_VERSION_STRING CATALOG_VERSION_STRING
-#elif defined(NS_RDS)
-#define MAGNUS_VERSION_STRING RDS_VERSION_STRING
-#elif defined(NS_CMS)
-#define MAGNUS_VERSION_STRING CMS_VERSION_STRING
-#else
-#define MAGNUS_VERSION_STRING ENTERPRISE_VERSION_STRING
-#endif
-#endif /* XP_UNIX */
-
-#elif defined(MCC_NEWS)
-#define MAGNUS_VERSION_STRING NEWS_VERSION_STRING
-
-#elif defined(NS_MAIL)
-#define MAGNUS_VERSION MAIL_VERSION_DEF
-#define MAGNUS_VERSION_STRING MAIL_VERSION_STRING
-
-#elif defined(MCC_BATMAN)
-#define MAGNUS_VERSION BATMAN_VERSION_DEF
-#define MAGNUS_VERSION_STRING BATMAN_VERSION_STRING
-
-#endif
-
 #ifndef VOID
 #define VOID void
 #endif
@@ -147,33 +84,6 @@ typedef int                  boolean;
 
 NSPR_BEGIN_EXTERN_C
 
-/* -------------------------- System version on NT------------------------- */
-
-/* Encode the server version as a number to be able to provide inexpensive
- * dynamic checks on server version - this isn't added in yet. */
-
-#define ENTERPRISE_VERSION 1  
-#define PERSONAL_VERSION 2       
-#define CATALOG_VERSION 3      
-#define RDS_VERSION 4       
-#define CMS_VERSION 5
-#undef DS_VERSION
-#define DS_VERSION 6
-
-#define server_fasttrack (!strcmp(MAGNUS_VERSION_STRING, PERSONAL_VERSION_STRING))
-#define server_enterprise (!strcmp(MAGNUS_VERSION_STRING, ENTERPRISE_VERSION_STRING))
-
-/* This definition of MAGNUS_VERSION_STRING on NT should be used
- * only when building the ns-http DLL */
-
-#if defined(MCC_HTTPD) && defined(XP_WIN32) && !defined(USE_ADMSERV) && !defined(MCC_ADMSERV)
-#undef MAGNUS_VERSION_STRING
-#define MAGNUS_VERSION_STRING INTsystem_version()
-#endif /* XP_WIN32 */
-
-/* Set server's version dynamically */
-NSAPI_PUBLIC void INTsystem_version_set(char *ptr);
-
 #ifndef APSTUDIO_READONLY_SYMBOLS
 
 /* Include the public netsite.h definitions */

+ 0 - 4
include/public/base/systems.h

@@ -27,9 +27,6 @@
 #define ZERO(ptr,len) memset(ptr,0,len)
 #define NEED_STRCASECMP
 #define NEED_STRNCASECMP
-#if OSVERSION > 4200
-#define TCPLEN_T size_t
-#endif /* OSVERSION > 4200 */
 
 #elif defined(BSDI)
 
@@ -168,7 +165,6 @@
 #define SEM_FLOCK
 #define SHMEM_UNIX_MMAP
 #define ZERO(ptr,len) memset(ptr,0,len)
-#define TCPLEN_T size_t
 
 #elif defined(Linux)
 

+ 3 - 3
include/public/nsacl/aclapi.h

@@ -18,9 +18,9 @@
 #include "nserrdef.h"
 #endif /* !PUBLIC_NSACL_NSERRDEF_H */
 
-#ifndef PUBLIC_BASE_POOL_H
-#include "../base/pool.h"
-#endif /* !PUBLIC_BASE_POOL_H */
+#ifndef PUBLIC_NSAPI_H
+#include "public/nsapi.h"
+#endif /* !PUBLIC_NSAPI_H */
 
 #ifndef PUBLIC_NSACL_PLISTDEF_H
 #include "plistdef.h"

+ 3 - 3
include/public/nsacl/plistdef.h

@@ -15,9 +15,9 @@
  *      lists are a generalization of parameter blocks (pblocks).
  */
 
-#ifndef PUBLIC_BASE_POOL_H
-#include "../base/pool.h"
-#endif /* !PUBLIC_BASE_POOL_H */
+#ifndef PUBLIC_NSAPI_H
+#include "public/nsapi.h"
+#endif /* !PUBLIC_NSAPI_H */
 
 typedef struct PListStruct_s *PList_t;
 

+ 0 - 2
ldap/clients/dsgw/dsgw.h

@@ -32,8 +32,6 @@
 #include "../../include/srchpref.h"
 
 #if defined( XP_WIN32 )
-#define util_strcasecmp strcasecomp
-#define util_strncasecmp strncasecomp
 
 #include "base/systems.h"
 #include "proto-ntutil.h"

+ 0 - 24
lib/base/system.cpp

@@ -15,7 +15,6 @@
 
 #ifdef XP_WIN32
 #include <windows.h>
-static char *version = "Netscape Server/2.0";
 #endif
 
 #include "base/systems.h"	/* find out if we have malloc pools */
@@ -52,29 +51,6 @@ static int thread_malloc_key = -1;
 #define DEBUG_FREE_CHAR   'X'
 #endif /* DEBUG_MALLOC */
 
-
-/* On NT, the server version string is not statically encoded based
- * upon a product compile define but dynamically set by the server
- * exe at startup.
- */
-
-NSAPI_PUBLIC char *system_version()
-{
-#ifdef XP_WIN32
-    return version;
-#else /* XP_UNIX */
-    return MAGNUS_VERSION_STRING;
-#endif /* XP_UNIX */
-}
-
-NSAPI_PUBLIC void system_version_set(char *server_version)
-{
-#ifdef XP_WIN32
-    version = PERM_STRDUP(server_version);
-#endif
-}
-
-
 NSAPI_PUBLIC void *system_malloc(int size)
 {
 #if defined(MALLOC_POOLS) && defined(MCC_HTTPD) && defined(THREAD_ANY)

+ 0 - 62
lib/libaccess/Makefile

@@ -40,11 +40,7 @@ $(UTESTDEST):
 OSOBJS = 
 
 OBJS=$(addprefix $(OBJDEST)/,	usi.o \
-				attrec.o \
 				nseframe.o \
-				nsdb.o \
-				nsuser.o \
-				nsgroup.o \
 				nsautherr.o \
 				symbols.o \
                                 acltools.o \
@@ -67,23 +63,9 @@ OBJS=$(addprefix $(OBJDEST)/,	usi.o \
                                 acleval.o \
 				oneeval.o \
 				access_plhash.o \
-				aclparse.o \
-				aclbuild.o \
 				aclerror.o \
-				nsadb.o  \
-				nscert.o  \
-				nsamgmt.o  \
-				nsgmgmt.o  \
-				nsdbmgmt.o  \
-				nsumgmt.o  \
                                 $(OSOBJS) \
 				)
- 
-
-#
-# AVA Mapping files. Currently not compiled in (FORTEZZA for reference only).
-#
-AVAMAPFILES = lex.yy.o y.tab.o avapfile.o avadb.o 
 
 MODULE_CFLAGS=-I$(BUILD_ROOT)/include -DACL_LIB_INTERNAL $(TESTFLAGS)
 
@@ -128,47 +110,3 @@ flex:
 	$(LEX) -i aclscan.l
 	sed -f yy-sed lex.yy.c > acl.yy.cpp
 	rm lex.yy.c
-
-#
-# more AVA mapping stuff, needs to be made to work with the other lexx/yacc
-# code added for 3.0
-#
-#ifeq ($(ARCH), WINNT)
-#$(OBJDEST)/y.tab.o:	$(OBJDEST)/y.tab.c  $(VALUES) $(OBJDEST)/y.tab.h 
-#	$(CC) -c $(CFLAGS) $(MCC_INCLUDE) -I$(OBJDEST) -I. $< -Fo$*.o
-#else
-#$(OBJDEST)/y.tab.o:	$(OBJDEST)/y.tab.c $(OBJDEST)/y.tab.h
-#	$(CC) -c $(CFLAGS) $(MCC_INCLUDE) -I. -o $*.o $<
-#endif
-#
-#ifeq ($(ARCH), WINNT)
-#$(OBJDEST)/y.tab.h:	wintab.h
-#	cp wintab.h $(OBJDEST)/y.tab.h
-#
-#$(OBJDEST)/y.tab.c:	winnt.y
-#	cp winnt.y $(OBJDEST)/y.tab.c
-#
-#$(OBJDEST)/values.h:	winnt.v
-#	cp winnt.v $(OBJDEST)/values.h
-#else
-#$(OBJDEST)/y.tab.h $(OBJDEST)/y.tab.c:	avaparse.y
-#	yacc -d avaparse.y
-#	mv y.tab.h $(OBJDEST)/
-#	mv y.tab.c $(OBJDEST)/
-#endif
-#
-#$(OBJDEST)/lex.yy.o:	$(OBJDEST)/lex.yy.c $(OBJDEST)/y.tab.h
-#ifeq ($(ARCH), WINNT)
-#	$(CC) -c $(CFLAGS) $(MCC_INCLUDE) -I$(OBJDEST) -I. $< -Fo$*.o
-#else
-#	$(CC) -c $(CFLAGS) $(MCC_INCLUDE) -I. -o $*.o $<
-#endif
-#
-#ifeq ($(ARCH), WINNT)
-#$(OBJDEST)/lex.yy.c: winnt.l
-#	cp winnt.l $(OBJDEST)/lex.yy.c
-#else
-#$(OBJDEST)/lex.yy.c: avascan.l
-#	lex avascan.l
-#	mv lex.yy.c $(OBJDEST)/
-#endif

+ 4 - 0
lib/libaccess/aclerror.cpp

@@ -12,6 +12,7 @@
  */
 
 #include "base/systems.h"
+#include "public/nsapi.h"
 #ifdef NSPR20
 #include "prprf.h"
 #else
@@ -42,6 +43,9 @@
 #define aclerrfail	XP_GetAdminStr(DBT_AclerrfmtAclerrfail)
 #define aclerrio	XP_GetAdminStr(DBT_AclerrfmtAclerrio)
 
+char * NSAuth_Program = "NSAUTH";
+char * ACL_Program = "NSACL";               /* ACL facility name */
+
 /*
  * Description (aclErrorFmt)
  *