[Fedora-directory-commits] ldapserver buildpaths.mk, 1.14, 1.15 components.mk, 1.47, 1.48 internal_buildpaths.mk, 1.9, 1.10 internal_comp_deps.mk, 1.39, 1.40 nsconfig.mk, 1.21, 1.22
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17688
Modified Files:
buildpaths.mk components.mk internal_buildpaths.mk
internal_comp_deps.mk nsconfig.mk
Log Message:
[186642] Directory Server Makefile updates for Internal build
Package 32-bit LDAPSDK, NSPR, and NSS libraries in shared32/lib for perldap (Solaris and PA-RISC only).
Index: buildpaths.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/buildpaths.mk,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- buildpaths.mk 8 Apr 2006 19:29:35 -0000 1.14
+++ buildpaths.mk 13 Apr 2006 05:26:51 -0000 1.15
@@ -73,14 +73,18 @@
# ours - we need to map ours to theirs
ifneq (,$(findstring RHEL3,$(NSOBJDIR_NAME)))
MOZ_OBJDIR_NAME = $(subst _gcc3_,_glibc_PTH$(NS64TAG)_,$(subst RHEL3,Linux2.4,$(NSOBJDIR_NAME)))
+ MOZ_OBJDIR_NAME_32 = $(subst _gcc3_,_glibc_PTH_,$(subst RHEL3,Linux2.4,$(NSOBJDIR_NAME)))
else
ifneq (,$(findstring RHEL4,$(NSOBJDIR_NAME)))
MOZ_OBJDIR_NAME = $(subst _gcc3_,_glibc_PTH$(NS64TAG)_,$(subst RHEL4,Linux2.6,$(NSOBJDIR_NAME)))
+ MOZ_OBJDIR_NAME_32 = $(subst _gcc3_,_glibc_PTH_,$(subst RHEL4,Linux2.6,$(NSOBJDIR_NAME)))
else
ifneq (,$(findstring Linux,$(NSOBJDIR_NAME)))
MOZ_OBJDIR_NAME = $(subst _glibc_PTH_,_glibc_PTH$(NS64TAG)_,$(NSOBJDIR_NAME))
+ MOZ_OBJDIR_NAME_32 = $(subst _glibc_PTH_,_glibc_PTH_,$(NSOBJDIR_NAME))
else
MOZ_OBJDIR_NAME = $(NSOBJDIR_NAME)
+ MOZ_OBJDIR_NAME_32 = $(NSOBJDIR_NAME_32)
endif
endif
endif
Index: components.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/components.mk,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- components.mk 8 Apr 2006 19:29:35 -0000 1.47
+++ components.mk 13 Apr 2006 05:26:51 -0000 1.48
@@ -152,12 +152,16 @@
ifdef NSPR_SOURCE_ROOT
NSPR_LIBPATH = $(NSPR_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME)/lib
NSPR_INCDIR = $(NSPR_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME)/include
+ NSPR_LIBPATH_32 = $(NSPR_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME_32)/lib
+ NSPR_INCDIR_32 = $(NSPR_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME_32)/include
else
NSPR_LIBPATH = $(NSPR_BUILD_DIR)/lib
NSPR_INCDIR = $(NSPR_BUILD_DIR)/include
+ NSPR_LIBPATH_32 = $(NSPR_BUILD_DIR_32)/lib
+ NSPR_INCDIR_32 = $(NSPR_BUILD_DIR_32)/include
endif
NSPR_INCLUDE = -I$(NSPR_INCDIR)
-NSPR_LIBS_TO_PKG = $(addsuffix .$(DLL_SUFFIX),$(addprefix $(NSPR_LIBPATH)/lib,$(NSPR_LIBNAMES)))
+NSPR_LIBS_TO_PKG = $(addsuffix .$(DLL_SUFFIX),$(addprefix $(NSPR_LIBPATH)/$(LIB_PREFIX),$(NSPR_LIBNAMES)))
LIBS_TO_PKG += $(NSPR_LIBS_TO_PKG)
LIBS_TO_PKG_SHARED += $(NSPR_LIBS_TO_PKG) # needed for cmd line tools
@@ -186,10 +190,14 @@
SECURITY_LIBPATH = $(SECURITY_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME)/lib
SECURITY_BINPATH = $(SECURITY_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME)/bin
SECURITY_INCDIR = $(SECURITY_SOURCE_ROOT)/dist/public/nss
+ SECURITY_LIBPATH_32 = $(SECURITY_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME_32)/lib
+ SECURITY_BINPATH_32 = $(SECURITY_SOURCE_ROOT)/dist/$(MOZ_OBJDIR_NAME_32)/bin
else
SECURITY_LIBPATH = $(SECURITY_BUILD_DIR)/lib
SECURITY_BINPATH = $(SECURITY_BUILD_DIR)/bin
SECURITY_INCDIR = $(SECURITY_BUILD_DIR)/include
+ SECURITY_LIBPATH_32 = $(SECURITY_BUILD_DIR_32)/lib
+ SECURITY_BINPATH_32 = $(SECURITY_BUILD_DIR_32)/bin
endif
SECURITY_INCLUDE = -I$(SECURITY_INCDIR)
# add crlutil and ocspclnt when we support CRL and OCSP cert checking in DS
@@ -227,6 +235,7 @@
SECURITY_LIBS_TO_PKG += $(addsuffix .chk,$(addprefix $(SECURITY_LIBPATH)/$(LIB_PREFIX),$(SECURITY_NEED_CHK)))
LIBS_TO_PKG += $(SECURITY_LIBS_TO_PKG)
LIBS_TO_PKG_SHARED += $(SECURITY_LIBS_TO_PKG) # for cmd line tools
+
ifeq ($(USE_SETUPUTIL), 1)
PACKAGE_SETUP_LIBS += $(SECURITY_LIBS_TO_PKG) # for the setup programs
endif
@@ -285,10 +294,17 @@
LDAPSDK_LIBPATH = $(LDAPSDK_SOURCE_ROOT)/dist/lib
LDAPSDK_INCDIR = $(LDAPSDK_SOURCE_ROOT)/dist/public/ldap
LDAPSDK_BINPATH = $(LDAPSDK_SOURCE_ROOT)/dist/bin
+# need to build in another source root ...
+ LDAPSDK_LIBPATH_32 = $(LDAPSDK_SOURCE_ROOT_32)/dist/lib
+ LDAPSDK_INCDIR_32 = $(LDAPSDK_SOURCE_ROOT_32)/dist/public/ldap
+ LDAPSDK_BINPATH_32 = $(LDAPSDK_SOURCE_ROOT_32)/dist/bin
else
LDAPSDK_LIBPATH = $(LDAP_ROOT)/lib
LDAPSDK_INCDIR = $(LDAP_ROOT)/include
LDAPSDK_BINPATH = $(LDAP_ROOT)/bin
+ LDAPSDK_LIBPATH_32 = $(LDAP_ROOT_32)/lib
+ LDAPSDK_INCDIR_32 = $(LDAP_ROOT_32)/include
+ LDAPSDK_BINPATH_32 = $(LDAP_ROOT_32)/bin
endif
LDAPSDK_INCLUDE = -I$(LDAPSDK_INCDIR)
@@ -601,11 +617,48 @@
PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) lib/perl
PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) lib/perl
+# 32-bit perldap is packaged in 64-bit DS on Solaris and HP-UX PA-RISC.
+# It requires 32-bit LDAPSDK, NSPR, NSS.
+ifeq ($(USE_64), 1)
+ ifeq ($(BUILD_ARCH), SOLARIS)
+ PACKAGE_LIB32:=1
+ endif
+ ifeq ($(BUILD_ARCH), HPUX)
+ HPUX_ARCH := $(shell uname -m)
+ ifneq ($(HPUX_ARCH), ia64)
+ PACKAGE_LIB32:=1
+ endif
+ endif
+endif
+
+
# must define dependencies last because they depend on the definitions above
ifeq ($(INTERNAL_BUILD), 1)
include $(BUILD_ROOT)/internal_comp_deps.mk
endif
+ifeq ($(PACKAGE_LIB32), 1)
+ NSS32_LIBNAMES = $(SECURITY_LIBNAMES) smime3
+ NSS32_NEED_CHK = softokn3
+ ifeq ($(ARCH), SOLARIS)
+ NSS32_LIBNAMES += freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
+# these libs have a corresponding .chk file
+ NSS32_NEED_CHK += freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
+ endif
+ ifeq ($(ARCH), HPUX)
+ NSS32_LIBNAMES += freebl_32fpu_3 freebl_32int_3
+# these libs have a corresponding .chk file
+ NSS32_NEED_CHK += freebl_32fpu_3 freebl_32int_3
+ endif
+ NSSCKBI_FILE = $(LIB_PREFIX)nssckbi.$(DLL_SUFFIX)
+ NSSCKBI32_FILE = $(LIB_PREFIX)nssckbi32.$(DLL_SUFFIX)
+ SECURITY_FILES_32_TMP = $(NSSCKBI_FILE) $(addprefix $(LIB_PREFIX),$(addsuffix .$(DLL_SUFFIX),$(NSS32_LIBNAMES))) $(addprefix $(LIB_PREFIX),$(addsuffix .chk,$(NSS32_NEED_CHK)))
+
+ LIBS_TO_PKG_SHARED_32 = $(addprefix $(SECURITY_LIBPATH_32)/,$(SECURITY_FILES_32_TMP))
+ LIBS_TO_PKG_SHARED_32 += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(NSPR_LIBPATH_32)/$(LIB_PREFIX),$(NSPR_LIBNAMES)))
+ LIBS_TO_PKG_SHARED_32 += $(addprefix $(LDAPSDK_LIBPATH_32)/,$(LDAP_SOLIBS))
+endif # PACKAGE_LIB32
+
#################################################
# User Sync Components
#################################################
Index: internal_buildpaths.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/internal_buildpaths.mk,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- internal_buildpaths.mk 7 Apr 2006 01:33:30 -0000 1.9
+++ internal_buildpaths.mk 13 Apr 2006 05:26:51 -0000 1.10
@@ -77,6 +77,7 @@
#NSPR_SOURCE_ROOT = $(MOZILLA_SOURCE_ROOT)
ifndef NSPR_SOURCE_ROOT
NSPR_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/nspr
+NSPR_BUILD_DIR_32 = $(NSCP_DISTDIR_FULL_RTL_32)/nspr
# NSPR also needs a build dir with a full, absolute path for some reason
NSPR_ABS_BUILD_DIR = $(NSCP_ABS_DISTDIR_FULL_RTL)/nspr
endif # NSPR_SOURCE_ROOT
@@ -89,6 +90,7 @@
#SECURITY_SOURCE_ROOT = $(MOZILLA_SOURCE_ROOT)
ifndef SECURITY_SOURCE_ROOT
SECURITY_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/nss
+SECURITY_BUILD_DIR_32 = $(NSCP_DISTDIR_FULL_RTL_32)/nss
endif # SECURITY_SOURCE_ROOT
#SVRCORE_SOURCE_ROOT = $(MOZILLA_SOURCE_ROOT)
@@ -99,6 +101,7 @@
#LDAPSDK_SOURCE_ROOT = $(MOZILLA_SOURCE_ROOT)
ifndef LDAPSDK_SOURCE_ROOT
LDAP_ROOT = $(NSCP_DISTDIR_FULL_RTL)/ldapsdk
+LDAP_ROOT_32 = $(NSCP_DISTDIR_FULL_RTL_32)/ldapsdk
endif # LDAPSDK_SOURCE_ROOT
#SASL_SOURCE_ROOT = $(BUILD_ROOT)/../cyrus-sasl-2.1.20
Index: internal_comp_deps.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/internal_comp_deps.mk,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- internal_comp_deps.mk 7 Apr 2006 01:33:30 -0000 1.39
+++ internal_comp_deps.mk 13 Apr 2006 05:26:51 -0000 1.40
@@ -53,7 +53,7 @@
endif # BUILD_PUMPKIN
ifndef NSPR_SOURCE_ROOT
-NSPR_IMPORT = $(COMPONENTS_DIR)/nspr20/$(NSPR_RELDATE)/$(FULL_RTL_OBJDIR)
+NSPR_IMPORT = $(COMPONENTS_DIR)/nspr/$(NSPR_RELDATE)/$(FULL_RTL_OBJDIR)
NSPR_DEP = $(NSPR_LIBPATH)/libnspr4.$(LIB_SUFFIX)
ifndef NSPR_PULL_METHOD
@@ -158,6 +158,15 @@
LDAPSDK_PULL_LIBS = lib/libssldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX),lib/libldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX),lib/libprldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX)
endif
+# Solaris and HP-UX PA-RISC only #########################################
+# if building 64 bit version, also need the 32 bit version of NSS and NSPR
+ifeq ($(PACKAGE_LIB32), 1)
+ NSPR_IMPORT_32 = $(COMPONENTS_DIR)/nspr/$(NSPR_RELDATE)/$(FULL_RTL_OBJDIR_32)
+ SECURITY_IMPORT_32 = $(COMPONENTS_DIR)/nss/$(SECURITY_RELDATE)/$(FULL_RTL_OBJDIR_32)
+ LDAP_RELEASE_32 = $(LDAP_SBC)/$(LDAPCOMP_DIR)/$(LDAP_VERSION)/$(FULL_RTL_OBJDIR_32)
+ SECURITY_FILES_32 = $(subst $(SPACE),$(COMMA),$(SECURITY_FILES_32_TMP))
+endif
+
ifndef LDAPSDK_PULL_METHOD
LDAPSDK_PULL_METHOD = $(COMPONENT_PULL_METHOD)
endif
@@ -172,6 +181,21 @@
-@if [ ! -f $@ ] ; \
then echo "Error: could not get component LDAPSDK file $@" ; \
fi
+
+ifeq ($(PACKAGE_LIB32), 1)
+ $(FTP_PULL) -method $(SECURITY_PULL_METHOD) \
+ -objdir $(NSPR_BUILD_DIR_32) -componentdir $(NSPR_IMPORT_32) \
+ -files lib
+ mkdir -p $(SECURITY_BUILD_DIR_32)/lib
+ $(FTP_PULL) -method $(SECURITY_PULL_METHOD) \
+ -objdir $(SECURITY_BUILD_DIR_32)/lib -componentdir $(SECURITY_IMPORT_32)/lib \
+ -files $(SECURITY_FILES_32)
+ $(FTP_PULL) -method $(LDAPSDK_PULL_METHOD) \
+ -objdir $(LDAP_ROOT_32) -componentdir $(LDAP_RELEASE_32) \
+ -files lib
+ mv -f $(SECURITY_BUILD_DIR_32)/lib/$(NSSCKBI_FILE) $(SECURITY_BUILD_DIR_32)/lib/$(NSSCKBI32_FILE)
+endif # PACKAGE_LIB32
+##
endif # LDAPSDK_SOURCE_ROOT
ifndef SASL_SOURCE_ROOT
Index: nsconfig.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/nsconfig.mk,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- nsconfig.mk 7 Apr 2006 22:22:17 -0000 1.21
+++ nsconfig.mk 13 Apr 2006 05:26:51 -0000 1.22
@@ -1335,6 +1335,10 @@
NSCP_DISTDIR_FULL_RTL = $(NSCP_DISTDIR)
NSCP_ABS_DISTDIR_FULL_RTL = $(ABS_ROOT_PARENT)/dist/$(FULL_RTL_OBJDIR)
+FULL_RTL_OBJDIR_32 = $(NSOBJDIR_NAME_32)
+NSCP_DISTDIR_FULL_RTL_32 = $(BUILD_ROOT)/../dist/$(NSOBJDIR_NAME_32)
+NSCP_ABS_DISTDIR_FULL_RTL_32 = $(ABS_ROOT_PARENT)/dist/$(FULL_RTL_OBJDIR_32)
+
# these components may have additional RTL debugging support built in on NT
# adminutil, dbm, ldapsdk, NLS, NSPR, NSS (security)
# we cannot simply redefine NSOBJDIR_NAME and NSCP_DISTDIR because other
18 years
[Fedora-directory-commits] dsbuild gar.conf.mk, 1.1.1.1, 1.2 gar.conf.mk.in, 1.1.1.1, 1.2 gar.lib.mk, 1.3, 1.4 gar.mk, 1.1.1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/dsbuild
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32350
Modified Files:
gar.conf.mk gar.conf.mk.in gar.lib.mk gar.mk
Log Message:
fix USE_CVS issue - remove all of the install stuff - should make use on Solaris et. al. easier
Index: gar.conf.mk
===================================================================
RCS file: /cvs/dirsec/dsbuild/gar.conf.mk,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gar.conf.mk 10 Feb 2006 15:28:53 -0000 1.1.1.1
+++ gar.conf.mk 12 Apr 2006 22:11:47 -0000 1.2
@@ -23,101 +23,9 @@
GARCHIVEDIR = $(HOME)/ds-sources
-# Set this variable if you want to compile KDE for a 64bit target (x86_64)
-
-#HAVE_64BIT_TARGET = true
-
-# Several variables depend on the target architecture
-
-ifdef HAVE_64BIT_TARGET
- ENABLE_LIBSUFFIX="--enable-libsuffix=64"
- TARGET_LIBNAME = lib64
- TARGET_PLATFORM = linux-g++-64
- TARGET_PKG_CONFIG_PATH = /usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig
-
- # *Mandatory* compiler options on x86_64
- OWN_CFLAGS = -m64 -fPIC
-
- # Compiler options (optional)
- OWN_CFLAGS += -O2 -pipe
-
- # Optional compiler options for gcc >= 3.4.0
-# OWN_CFLAGS += -march=opteron -O3 -pipe
-
-else
- ENABLE_LIBSUFFIX=
- TARGET_LIBNAME = lib
- TARGET_PLATFORM = linux-g++
- TARGET_PKG_CONFIG_PATH = /usr/lib/pkgconfig:/usr/local/lib/pkgconfig
-
- # Compiler options (optional)
- OWN_CFLAGS = -O2 -pipe
-
-endif
-
-# These are the standard directory name variables from all GNU
-# makefiles. They're also used by autoconf, and can be adapted
-# for a variety of build systems.
-#
-# TODO: set $(SYSCONFDIR) and $(LOCALSTATEDIR) to never use
-# /usr/etc or /usr/var
-prefix ?= /tmp/fedora-ds-build
-exec_prefix = $(prefix)
-bindir = $(exec_prefix)/bin
-sbindir = $(exec_prefix)/sbin
-libexecdir = $(exec_prefix)/libexec
-datadir = $(prefix)/share
-sysconfdir = $(prefix)/etc
-sharedstatedir = $(prefix)/share
-localstatedir = $(prefix)/var
-libdir = $(exec_prefix)/$(TARGET_LIBNAME)
-infodir = $(BUILD_PREFIX)/info
-lispdir = $(prefix)/share/emacs/site-lisp
-includedir = $(BUILD_PREFIX)/include
-mandir = $(BUILD_PREFIX)/man
-docdir = $(BUILD_PREFIX)/share/doc
-sourcedir = $(BUILD_PREFIX)/src
-
-# the DESTDIR is used at INSTALL TIME ONLY to determine what the
-# filesystem root should be. The BUILD_PREFIX is the prefix that
-# usurps the DESTDIR. It should be considered relative to
-# $(DESTDIR). Thus, if includedir were set to
-# $(BUILD_PREFIX)/include, it would expand out at install time
-# (BUT NO SOONER) to /tmp/gar/../../tmp/build. The /../../ at
-# the front should be harmless, as .. for / is just / itself.
-DESTDIR ?=
-BUILD_PREFIX ?= $(prefix)
-#BUILD_PREFIX ?= $(ROOTFROMDEST)/tmp/build
-
-# allow us to link to libraries we installed
-CPPFLAGS += -I$(DESTDIR)$(includedir)
-CFLAGS += -I$(DESTDIR)$(includedir) -L$(DESTDIR)$(libdir)
-LDFLAGS += -L$(DESTDIR)$(libdir)
-# allow us to use programs we just built
-PATH := $(DESTDIR)$(bindir):$(DESTDIR)$(sbindir):$(DESTDIR)$(BUILD_PREFIX)/bin:$(DESTDIR)$(BUILD_PREFIX)/sbin:$(PATH)
-LD_LIBRARY_PATH := $(DESTDIR)$(libdir):$(DESTDIR)$(BUILD_PREFIX)/$(TARGET_LIBNAME):$(LD_LIBRARY_PATH)
-
-# This is for foo-config chaos
-PKG_CONFIG_PATH:=$(DESTDIR)$(libdir)/pkgconfig:$(TARGET_PKG_CONFIG_PATH):$(PKG_CONFIG_PATH)
-
-# Now add own flags to CFLAGS
-CFLAGS += $(OWN_CFLAGS)
-
-# Equalise CFLAGS and CXXFLAGS
-CXXFLAGS := $(CFLAGS)
-
# If you have no following GNU tools installed change these lines
TAR = tar
MD5 = md5sum
-# make these variables available to configure and build scripts
-# outside of make's realm.
-export DESTDIR prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir
-export sharedstatedir localstatedir libdir infodir lispdir includedir mandir
-export docdir sourcedir
-export CC CXX
-export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS PATH LD_LIBRARY_PATH LD_PRELOAD
-export PKG_CONFIG_PATH BUILD_CLEAN
-
# prepend the local file listing
FILE_SITES = file://$(FILEDIR)/ file://$(GARCHIVEDIR)/
Index: gar.conf.mk.in
===================================================================
RCS file: /cvs/dirsec/dsbuild/gar.conf.mk.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gar.conf.mk.in 10 Feb 2006 15:28:53 -0000 1.1.1.1
+++ gar.conf.mk.in 12 Apr 2006 22:11:47 -0000 1.2
@@ -23,101 +23,9 @@
GARCHIVEDIR = $(HOME)/ds-sources
-# Set this variable if you want to compile KDE for a 64bit target (x86_64)
-
-#HAVE_64BIT_TARGET = true
-
-# Several variables depend on the target architecture
-
-ifdef HAVE_64BIT_TARGET
- ENABLE_LIBSUFFIX="--enable-libsuffix=64"
- TARGET_LIBNAME = lib64
- TARGET_PLATFORM = linux-g++-64
- TARGET_PKG_CONFIG_PATH = /usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig
-
- # *Mandatory* compiler options on x86_64
- OWN_CFLAGS = -m64 -fPIC
-
- # Compiler options (optional)
- OWN_CFLAGS += -O2 -pipe
-
- # Optional compiler options for gcc >= 3.4.0
-# OWN_CFLAGS += -march=opteron -O3 -pipe
-
-else
- ENABLE_LIBSUFFIX=
- TARGET_LIBNAME = lib
- TARGET_PLATFORM = linux-g++
- TARGET_PKG_CONFIG_PATH = /usr/lib/pkgconfig:/usr/local/lib/pkgconfig
-
- # Compiler options (optional)
- OWN_CFLAGS = -O2 -pipe
-
-endif
-
-# These are the standard directory name variables from all GNU
-# makefiles. They're also used by autoconf, and can be adapted
-# for a variety of build systems.
-#
-# TODO: set $(SYSCONFDIR) and $(LOCALSTATEDIR) to never use
-# /usr/etc or /usr/var
-prefix ?= /tmp/fedora-ds-build
-exec_prefix = $(prefix)
-bindir = $(exec_prefix)/bin
-sbindir = $(exec_prefix)/sbin
-libexecdir = $(exec_prefix)/libexec
-datadir = $(prefix)/share
-sysconfdir = $(prefix)/etc
-sharedstatedir = $(prefix)/share
-localstatedir = $(prefix)/var
-libdir = $(exec_prefix)/$(TARGET_LIBNAME)
-infodir = $(BUILD_PREFIX)/info
-lispdir = $(prefix)/share/emacs/site-lisp
-includedir = $(BUILD_PREFIX)/include
-mandir = $(BUILD_PREFIX)/man
-docdir = $(BUILD_PREFIX)/share/doc
-sourcedir = $(BUILD_PREFIX)/src
-
-# the DESTDIR is used at INSTALL TIME ONLY to determine what the
-# filesystem root should be. The BUILD_PREFIX is the prefix that
-# usurps the DESTDIR. It should be considered relative to
-# $(DESTDIR). Thus, if includedir were set to
-# $(BUILD_PREFIX)/include, it would expand out at install time
-# (BUT NO SOONER) to /tmp/gar/../../tmp/build. The /../../ at
-# the front should be harmless, as .. for / is just / itself.
-DESTDIR ?=
-BUILD_PREFIX ?= $(prefix)
-#BUILD_PREFIX ?= $(ROOTFROMDEST)/tmp/build
-
-# allow us to link to libraries we installed
-CPPFLAGS += -I$(DESTDIR)$(includedir)
-CFLAGS += -I$(DESTDIR)$(includedir) -L$(DESTDIR)$(libdir)
-LDFLAGS += -L$(DESTDIR)$(libdir)
-# allow us to use programs we just built
-PATH := $(DESTDIR)$(bindir):$(DESTDIR)$(sbindir):$(DESTDIR)$(BUILD_PREFIX)/bin:$(DESTDIR)$(BUILD_PREFIX)/sbin:$(PATH)
-LD_LIBRARY_PATH := $(DESTDIR)$(libdir):$(DESTDIR)$(BUILD_PREFIX)/$(TARGET_LIBNAME):$(LD_LIBRARY_PATH)
-
-# This is for foo-config chaos
-PKG_CONFIG_PATH:=$(DESTDIR)$(libdir)/pkgconfig:$(TARGET_PKG_CONFIG_PATH):$(PKG_CONFIG_PATH)
-
-# Now add own flags to CFLAGS
-CFLAGS += $(OWN_CFLAGS)
-
-# Equalise CFLAGS and CXXFLAGS
-CXXFLAGS := $(CFLAGS)
-
# If you have no following GNU tools installed change these lines
TAR = tar
MD5 = md5sum
-# make these variables available to configure and build scripts
-# outside of make's realm.
-export DESTDIR prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir
-export sharedstatedir localstatedir libdir infodir lispdir includedir mandir
-export docdir sourcedir
-export CC CXX
-export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS PATH LD_LIBRARY_PATH LD_PRELOAD
-export PKG_CONFIG_PATH BUILD_CLEAN
-
# prepend the local file listing
FILE_SITES = file://$(FILEDIR)/ file://$(GARCHIVEDIR)/
Index: gar.lib.mk
===================================================================
RCS file: /cvs/dirsec/dsbuild/gar.lib.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gar.lib.mk 8 Apr 2006 19:26:49 -0000 1.3
+++ gar.lib.mk 12 Apr 2006 22:11:47 -0000 1.4
@@ -46,7 +46,7 @@
# get one that doesn't return an error code.
$(DOWNLOADDIR)/%:
# no download with cvs - we "extract" the files from CVS instead
-ifndef USE_CVS
+ifdef DISTFILES
@if test -f $(COOKIEDIR)/checksum-$*; then : ; else \
echo " ==> Grabbing $(call TMSG_ID,$@)"; \
for i in $(filter %/$*,$(URLS)); do \
@@ -106,7 +106,7 @@
# error out if it mentions the file without an "OK".
checksum-%: $(CHECKSUM_FILE)
# no checksum with cvs - we "extract" the files from CVS instead
-ifndef USE_CVS
+ifdef DISTFILES
@echo " ==> Running checksum on $(call TMSG_ID,$*)"
@if grep -- '$*' $(CHECKSUM_FILE); then \
if LC_ALL="C" LANG="C" $(MD5) -c $(CHECKSUM_FILE) 2>&1 | grep -- '$*' | grep -v ':[ ]\+OK'; then \
@@ -290,17 +290,6 @@
#################### CONFIGURE RULES ####################
-ifdef HAVE_QT_3_3_INSTALLED
- TMP_DIRPATHS = --prefix=$(prefix) --exec_prefix=$(exec_prefix) --bindir=$(bindir) --sbindir=$(sbindir) --libexecdir=$(libexecdir) --datadir=$(datadir) --sysconfdir=$(sysconfdir) --sharedstatedir=$(sharedstatedir) --localstatedir=$(localstatedir) --libdir=$(libdir) --infodir=$(infodir) --lispdir=$(lispdir) --includedir=$(includedir) --mandir=$(mandir) --with-qt-dir=$(QTDIR)
-else
- TMP_DIRPATHS = --prefix=$(prefix) --exec_prefix=$(exec_prefix) --bindir=$(bindir) --sbindir=$(sbindir) --libexecdir=$(libexecdir) --datadir=$(datadir) --sysconfdir=$(sysconfdir) --sharedstatedir=$(sharedstatedir) --localstatedir=$(localstatedir) --libdir=$(libdir) --infodir=$(infodir) --lispdir=$(lispdir) --includedir=$(includedir) --mandir=$(mandir) --with-qt-dir=$(prefix)
- QTDIR = $(prefix)
-endif
-
-NODIRPATHS += --lispdir
-
-DIRPATHS = $(filter-out $(addsuffix %,$(NODIRPATHS)), $(TMP_DIRPATHS))
-
# configure a package that has an autoconf-style configure
# script.
configure-%/configure:
Index: gar.mk
===================================================================
RCS file: /cvs/dirsec/dsbuild/gar.mk,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gar.mk 10 Feb 2006 15:28:52 -0000 1.1.1.1
+++ gar.mk 12 Apr 2006 22:11:47 -0000 1.2
@@ -38,13 +38,6 @@
ALLFILES ?= $(DISTFILES) $(PATCHFILES)
-INSTALL_DIRS = $(addprefix $(DESTDIR),$(BUILD_PREFIX) $(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir) $(datadir) $(sysconfdir) $(sharedstatedir) $(localstatedir) $(libdir) $(infodir) $(lispdir) $(includedir) $(mandir) $(foreach NUM,1 2 3 4 5 6 7 8, $(mandir)/man$(NUM)) $(sourcedir))
-
-# These are bad, since exporting them mucks up the dep rules!
-# WORKSRC is added in manually for the manifest rule.
-#export GARDIR FILEDIR DOWNLOADDIR COOKIEDIR WORKDIR WORKSRC EXTRACTDIR
-#export SCRATCHDIR CHECKSUM_FILE MANIFEST_FILE
-
# For rules that do nothing, display what dependencies they
# successfully completed
DONADA = @echo " [$(call TMSG_ACTION,$@)] complete for $(call TMSG_ID,$(GARNAME))."
18 years
[Fedora-directory-commits] ldapserver/lib/libsi18n acclanglist.c, 1.5, 1.6 makstrdb.c, 1.6, 1.7
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/libsi18n
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/lib/libsi18n
Modified Files:
acclanglist.c makstrdb.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: acclanglist.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libsi18n/acclanglist.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- acclanglist.c 19 Apr 2005 22:07:54 -0000 1.5
+++ acclanglist.c 11 Apr 2006 02:14:54 -0000 1.6
@@ -200,6 +200,7 @@
/* Add current language for future appending.,make sure it's not on list */
if ((strlen(curLanguageList[i]) > 2) && (curLanguageList[i][2] == '_')) {
strncpy(lang, curLanguageList[i], 2);
+ lang[sizeof(lang)-1] = 0;
for (k = 0; (k < index) && strcmp(AcceptLanguageList[k], lang); k++);
if (k != index) lang[0] = '\0';
Index: makstrdb.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libsi18n/makstrdb.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- makstrdb.c 19 Apr 2005 22:07:54 -0000 1.6
+++ makstrdb.c 11 Apr 2006 02:14:54 -0000 1.7
@@ -119,7 +119,6 @@
char* cptr;
RESOURCE_TABLE* table;
NSRESHANDLE hresdb;
- char DBTlibraryName[128];
/* Creating database */
hresdb = NSResCreateTable(DATABASE_NAME, NULL);
@@ -189,7 +188,7 @@
*/
src = table->str;
dest = buffer;
- while (*src) {
+ while (*src && (sizeof(buffer) > (dest-buffer))) {
if (*src < 0x20) {
strcpy(dest,"\\u00");
dest += 4;
18 years
[Fedora-directory-commits] ldapserver/lib/libadmin authdb.c, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/libadmin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/lib/libadmin
Modified Files:
authdb.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: authdb.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libadmin/authdb.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- authdb.c 19 Apr 2005 22:07:53 -0000 1.5
+++ authdb.c 11 Apr 2006 02:14:54 -0000 1.6
@@ -60,11 +60,13 @@
#ifdef USE_ADMSERV
char *tmp = getenv("NETSITE_ROOT");
- sprintf(line, "%s%cuserdb", tmp, FILE_PATHSEP);
+ snprintf(line, sizeof(line), "%s%cuserdb", tmp, FILE_PATHSEP);
+ line[sizeof(line)-1] = 0;
#else
char *tmp = get_mag_var("#ServerRoot");
- sprintf(line, "%s%cadmin%cuserdb", tmp, FILE_PATHSEP, FILE_PATHSEP);
+ snprintf(line, sizeof(line), "%s%cadmin%cuserdb", tmp, FILE_PATHSEP, FILE_PATHSEP);
+ line[sizeof(line)-1] = 0;
#endif
userdb = STRDUP(line);
return userdb;
18 years
[Fedora-directory-commits] ldapserver/lib/libaccess acl.yy.cpp, 1.4, 1.5 aclscan.l, 1.4, 1.5 authdb.cpp, 1.4, 1.5 lasdns.cpp, 1.5, 1.6 lasip.cpp, 1.5, 1.6 lastod.cpp, 1.4, 1.5
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/libaccess
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/lib/libaccess
Modified Files:
acl.yy.cpp aclscan.l authdb.cpp lasdns.cpp lasip.cpp
lastod.cpp
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: acl.yy.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/acl.yy.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- acl.yy.cpp 19 Apr 2005 22:07:47 -0000 1.4
+++ acl.yy.cpp 11 Apr 2006 02:14:53 -0000 1.5
@@ -472,6 +472,7 @@
#ifdef XP_WIN32
#include <io.h>
#endif
+#include "plstr.h"
#include "parse.h"
#include "aclscan.h"
@@ -1944,7 +1945,7 @@
acl_lineno = 1;
acl_use_buffer = (filename == NULL) ? 1 : 0 ;
if ( filename != NULL ) {
- strcpy(acl_filename, filename);
+ PL_strncpyz(acl_filename, filename, sizeof(acl_filename));
#ifdef UTEST
aclin = fopen(filename, "r");
if ( aclin == NULL ) {
Index: aclscan.l
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/aclscan.l,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- aclscan.l 19 Apr 2005 22:07:47 -0000 1.4
+++ aclscan.l 11 Apr 2006 02:14:53 -0000 1.5
@@ -53,6 +53,7 @@
#ifdef XP_WIN32
#include <io.h>
#endif
+#include "plstr.h"
#include "parse.h"
#include "aclscan.h"
@@ -328,7 +329,7 @@
acl_lineno = 1;
acl_use_buffer = (filename == NULL) ? 1 : 0 ;
if ( filename != NULL ) {
- strcpy(acl_filename, filename);
+ PL_strncpyz(acl_filename, filename, sizeof(acl_filename));
#ifdef UTEST
yyin = fopen(filename, "r");
if ( yyin == NULL ) {
Index: authdb.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/authdb.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- authdb.cpp 19 Apr 2005 22:07:47 -0000 1.4
+++ authdb.cpp 11 Apr 2006 02:14:53 -0000 1.5
@@ -167,10 +167,10 @@
else {
/* treat prefix in the url as dbtype if it has been registered.
*/
- int prefix_len = strcspn(url, ":");
+ size_t prefix_len = strcspn(url, ":");
char dbtypestr[BIG_LINE];
- if (prefix_len) {
+ if (prefix_len && (prefix_len < sizeof(dbtypestr))) {
strncpy(dbtypestr, url, prefix_len);
dbtypestr[prefix_len] = 0;
Index: lasdns.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/lasdns.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- lasdns.cpp 19 Apr 2005 22:07:47 -0000 1.5
+++ lasdns.cpp 11 Apr 2006 02:14:53 -0000 1.6
@@ -132,7 +132,7 @@
int
LASDnsBuild(NSErr_t *errp, char *attr_pattern, LASDnsContext_t *context, int aliasflg)
{
- int delimiter; /* length of valid token */
+ size_t delimiter; /* length of valid token */
char token[256]; /* max length dns name */
int i;
int ipcnt;
@@ -162,9 +162,13 @@
}
do {
+ size_t maxsize = sizeof(token);
/* Get a single hostname from the pattern string */
delimiter = strcspn(attr_pattern, ", \t");
- strncpy(token, attr_pattern, delimiter);
+ if (delimiter >= maxsize) {
+ delimiter = maxsize-1;
+ }
+ PL_strncpyz(token, attr_pattern, delimiter);
token[delimiter] = '\0';
/* Skip any white space after the token */
Index: lasip.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/lasip.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- lasip.cpp 19 Apr 2005 22:07:47 -0000 1.5
+++ lasip.cpp 11 Apr 2006 02:14:53 -0000 1.6
@@ -95,6 +95,14 @@
if (strcspn(ipstr, "0123456789.*"))
return LAS_EVAL_INVALID;
+ if (strlen(netmaskstr) >= sizeof(token)) {
+ return LAS_EVAL_INVALID;
+ }
+
+ if (strlen(ipstr) >= sizeof(token)) {
+ return LAS_EVAL_INVALID;
+ }
+
*netmask = *ip = 0; /* Start with "don't care" */
for (i=0; i<4; i++) {
@@ -263,6 +271,10 @@
delimiter = strcspn(curptr, ", \t");
delimiter = (delimiter <= strlen(curptr)) ? delimiter : strlen(curptr);
strncpy(token, curptr, delimiter);
+ if (delimiter >= sizeof(token)) {
+ return LAS_EVAL_INVALID;
+ }
+
token[delimiter] = '\0';
/* skip all the white space after the token */
curptr = strpbrk((curptr+delimiter), "1234567890+.*");
@@ -275,6 +287,9 @@
curptr = strpbrk((++curptr), "1234567890.*");
delimiter = strcspn(curptr, ", \t");
delimiter = (delimiter <= strlen(curptr)) ? delimiter : strlen(curptr);
+ if (delimiter >= sizeof(token2)) {
+ return LAS_EVAL_INVALID;
+ }
strncpy(token2, curptr, delimiter);
token2[delimiter] = '\0';
retcode = dotdecimal(token, token2, &ip, &netmask);
@@ -512,7 +527,7 @@
/* Cannot reach here. Even a 32 bit mismatch has a conclusion in
* the pattern tree.
*/
- sprintf(ip_str, "%x", ip);
+ sprintf(ip_str, "%x", (unsigned int)ip);
nserrGenerate(errp, ACLERRINTERNAL, ACLERR5240, ACL_Program, 2, XP_GetAdminStr(DBT_lasipevalReach32BitsWithoutConcl_), ip_str);
return LAS_EVAL_INVALID;
}
Index: lastod.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/libaccess/lastod.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- lastod.cpp 19 Apr 2005 22:07:47 -0000 1.4
+++ lastod.cpp 11 Apr 2006 02:14:53 -0000 1.5
@@ -50,6 +50,7 @@
#include "aclutil.h"
#include <libaccess/dbtlibaccess.h>
#include <libaccess/aclerror.h>
+#include "plstr.h"
/* Day of the week LAS driver
* Note that everything is case-insensitive.
@@ -97,7 +98,7 @@
strftime(daystr, 4, "%a", localtime(&t));
#endif
makelower(daystr);
- strcpy(lcl_pattern, pattern);
+ PL_strncpyz(lcl_pattern, pattern, sizeof(lcl_pattern));
makelower(lcl_pattern);
/* Compare the value to the pattern */
@@ -163,10 +164,18 @@
return LAS_EVAL_INVALID;
}
+ if ((size_t)(dash-pattern) >= sizeof(start)) {
+ nserrGenerate(errp, ACLERRINVAL, ACLERR5610, ACL_Program, 2, XP_GetAdminStr(DBT_illegalComparatorForTimeOfDayDN_), comparator_string(comparator));
+ return LAS_EVAL_INVALID;
+ }
strncpy(start, pattern, dash-pattern);
start[dash-pattern]='\0';
intstart = atoi(start);
+ if (strlen(dash+1) >= sizeof(end)) {
+ nserrGenerate(errp, ACLERRINVAL, ACLERR5610, ACL_Program, 2, XP_GetAdminStr(DBT_illegalComparatorForTimeOfDayDN_), comparator_string(comparator));
+ return LAS_EVAL_INVALID;
+ }
strcpy(end, dash+1);
intend = atoi(end);
18 years
[Fedora-directory-commits] ldapserver/lib/base dns.cpp, 1.5, 1.6 dnsdmain.cpp, 1.6, 1.7 file.cpp, 1.5, 1.6 plist.cpp, 1.4, 1.5 pool.cpp, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/base
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/lib/base
Modified Files:
dns.cpp dnsdmain.cpp file.cpp plist.cpp pool.cpp
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: dns.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/base/dns.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dns.cpp 19 Apr 2005 22:07:45 -0000 1.5
+++ dns.cpp 11 Apr 2006 02:14:52 -0000 1.6
@@ -109,7 +109,9 @@
err = PR_InitializeNetAddr(PR_IpAddrNull, 0, &iaddr);
- if((iaddr.inet.ip = inet_addr(ip)) == -1)
+ /* richm: ipv6 cleanup - use inet_aton or other more appropriate function
+ instead of inet_addr */
+ if((iaddr.inet.ip = inet_addr(ip)) == (in_addr_t)-1)
goto bong;
/*
Index: dnsdmain.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/base/dnsdmain.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dnsdmain.cpp 10 May 2005 23:17:04 -0000 1.6
+++ dnsdmain.cpp 11 Apr 2006 02:14:52 -0000 1.7
@@ -177,7 +177,7 @@
if (domain != 0) {
hnlen = strlen(hname);
- if ((hnlen + dnlen + 2) <= sizeof(line)) {
+ if ((size_t)(hnlen + dnlen + 2) <= sizeof(line)) {
strcpy(line, hname);
line[hnlen] = '.';
strcpy(&line[hnlen+1], domain);
Index: file.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/base/file.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- file.cpp 19 Apr 2005 22:07:45 -0000 1.5
+++ file.cpp 11 Apr 2006 02:14:52 -0000 1.6
@@ -543,23 +543,6 @@
#include "util.h"
-static char *_errmsg_new(int code)
-{
- char *ret;
-#ifdef THREAD_ANY
- if(!(ret = (char *) systhread_getdata(errmsg_key))) {
- ret = (char *) PERM_MALLOC(256);
- systhread_setdata(errmsg_key, (void *)ret);
- }
-#else
- ret = errmsg;
-#endif
- util_snprintf(ret, ERRMSG_SIZE, "libsec code %d", code);
-#ifndef MCC_BATMAN
- PR_SetError(0,0);
-#endif
- return ret;
-}
#endif
@@ -611,7 +594,7 @@
PR_SetError(0, 0);
lmsg = nscp_error_msg;
} else {
- util_snprintf(static_error, ERRMSG_SIZE, "unknown error %d", nscp_error);
+ util_snprintf(static_error, sizeof(static_error), "unknown error %d", nscp_error);
lmsg = static_error;
}
} else {
Index: plist.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/base/plist.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- plist.cpp 19 Apr 2005 22:07:45 -0000 1.4
+++ plist.cpp 11 Apr 2006 02:14:52 -0000 1.5
@@ -818,7 +818,7 @@
/* Is it time to grow the hash table? */
i = PLSIZENDX(pt->pt_sizendx);
- if ((pt->pt_sizendx < PLMAXSIZENDX) &&
+ if (((size_t)pt->pt_sizendx < PLMAXSIZENDX) &&
pt->pt_nsyms >= (i + i)) {
PLSymbolTable_t *npt;
Index: pool.cpp
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/base/pool.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- pool.cpp 19 Apr 2005 22:07:45 -0000 1.5
+++ pool.cpp 11 Apr 2006 02:14:52 -0000 1.6
@@ -195,7 +195,7 @@
memset(block->data, 0xa, block->end-block->data);
#endif /* POOL_ZERO_DEBUG */
- if ((freelist_size + block->end - block->data) > freelist_max) {
+ if ((unsigned long)(freelist_size + block->end - block->data) > freelist_max) {
/* Just have to delete the whole block! */
crit_enter(freelist_lock);
@@ -452,7 +452,7 @@
pool_t *pool = (pool_t *)pool_handle;
void *newptr;
block_t *block_ptr;
- int oldsize;
+ size_t oldsize;
if (pool_handle == NULL || pool_disable)
return PERM_REALLOC(ptr, size);
18 years
[Fedora-directory-commits] ldapserver/lib/ldaputil certmap.c, 1.5, 1.6 init.c, 1.6, 1.7 ldapauth.c, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/ldaputil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/lib/ldaputil
Modified Files:
certmap.c init.c ldapauth.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: certmap.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/certmap.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- certmap.c 19 Apr 2005 22:07:45 -0000 1.5
+++ certmap.c 11 Apr 2006 02:14:53 -0000 1.6
@@ -46,6 +46,8 @@
*/
#include <plstr.h>
#include <prlink.h>
+#include <prprf.h>
+
#include <key.h>
#include <cert.h>
#include <ldaputil/certmap.h>
@@ -388,7 +390,7 @@
static void print_oid_bitmask (long bitmask)
{
- fprintf(stderr, "%x: ", bitmask);
+ fprintf(stderr, "%lx: ", bitmask);
if (PresentInComps(bitmask, SEC_OID_AVA_COUNTRY_NAME))
fprintf(stderr, " C");
@@ -1812,7 +1814,7 @@
*certmap_list = 0;
*certmap_default = 0;
- sprintf(this_dllname, "%s", dllname);
+ PR_snprintf(this_dllname, sizeof(this_dllname), "%s", dllname);
if (!certmap_listinfo) return LDAPU_ERR_OUT_OF_MEMORY;
Index: init.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/init.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- init.c 19 Apr 2005 22:07:45 -0000 1.6
+++ init.c 11 Apr 2006 02:14:53 -0000 1.7
@@ -39,6 +39,7 @@
#include <string.h>
#include <prlink.h>
#include <prio.h>
+#include <prprf.h>
/*#include "base/file.h"*/
#include "ldaputil/certmap.h"
@@ -90,7 +91,7 @@
if(is_lib) {
char path[1024];
- sprintf(path, "%s%c%s", dir, FILE_PATHSEP, libname);
+ PR_snprintf(path, sizeof(path), "%s%c%s", dir, FILE_PATHSEP, libname);
lib = PR_LoadLibrary(path);
if (!lib) rv = LDAPU_ERR_UNABLE_TO_LOAD_PLUGIN;
}
@@ -123,7 +124,7 @@
if (serv_root && *serv_root) {
/* Load common libraries */
- sprintf(dir, "%s%clib%c%s", serv_root, FILE_PATHSEP,
+ PR_snprintf(dir, sizeof(dir), "%s%clib%c%s", serv_root, FILE_PATHSEP,
FILE_PATHSEP, "common");
rv = load_server_libs(dir);
Index: ldapauth.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/ldapauth.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ldapauth.c 19 Apr 2005 22:07:45 -0000 1.5
+++ ldapauth.c 11 Apr 2006 02:14:53 -0000 1.6
@@ -46,6 +46,7 @@
#include <stdio.h> /* for BUFSIZ */
#include <string.h> /* for strncpy, strcat */
#include <ldap.h>
+#include <prprf.h>
#include <ldaputil/certmap.h>
#include <ldaputil/errors.h>
@@ -274,7 +275,7 @@
int retval;
/* setup filter as (uid=<uid>) */
- sprintf(filter, ldapu_strings[LDAPU_STR_FILTER_USER], uid);
+ PR_snprintf(filter, sizeof(filter), ldapu_strings[LDAPU_STR_FILTER_USER], uid);
retval = ldapu_find(ld, base, scope, filter, attrs, attrsonly, res);
@@ -384,7 +385,7 @@
int retval;
/* setup the filter */
- sprintf(filter,
+ PR_snprintf(filter, sizeof(filter),
ldapu_strings[LDAPU_STR_FILTER_GROUP],
groupid);
@@ -497,7 +498,7 @@
return LDAPU_ERR_CIRCULAR_GROUPS;
/* setup the filter */
- sprintf(member_filter, ldapu_strings[LDAPU_STR_FILTER_MEMBER], userdn, userdn);
+ PR_snprintf(member_filter, sizeof(member_filter), ldapu_strings[LDAPU_STR_FILTER_MEMBER], userdn, userdn);
retval = ldapu_find(ld, groupdn, LDAP_SCOPE_BASE, member_filter, attrs,
attrsonly, &res);
@@ -510,7 +511,7 @@
DBG_PRINT2("Find parent groups of \"%s\"\n", userdn);
/* Modify the filter to include the objectclass check */
- sprintf(filter, ldapu_strings[LDAPU_STR_FILTER_MEMBER_RECURSE],
+ PR_snprintf(filter, sizeof(filter), ldapu_strings[LDAPU_STR_FILTER_MEMBER_RECURSE],
member_filter);
retval = ldapu_find(ld, base, LDAP_SCOPE_SUBTREE, filter,
attrs, attrsonly, &res);
@@ -1020,9 +1021,9 @@
/* setup filter as (& (uid=<uid>) (attrfilter)) */
if (*attrfilter == '(')
- sprintf(filter, "(& (uid=%s) %s)", uid, attrfilter);
+ PR_snprintf(filter, sizeof(filter), "(& (uid=%s) %s)", uid, attrfilter);
else
- sprintf(filter, "(& (uid=%s) (%s))", uid, attrfilter);
+ PR_snprintf(filter, sizeof(filter), "(& (uid=%s) (%s))", uid, attrfilter);
retval = ldapu_find(ld, base, scope, filter, attrs, attrsonly, &res);
18 years
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools/ldclt ldclt.c, 1.1, 1.2 repcheck.c, 1.1, 1.2 repslave.c, 1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/ldap/servers/slapd/tools/ldclt
Modified Files:
ldclt.c repcheck.c repslave.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: ldclt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldclt.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ldclt.c 11 Jan 2006 01:54:30 -0000 1.1
+++ ldclt.c 11 Apr 2006 02:14:51 -0000 1.2
@@ -3060,6 +3060,8 @@
ldcltExit (EXIT_OTHER); /*JLS 25-08-00*/
ldcltExit (mctx.exitStatus); /*JLS 25-08-00*/
+
+ return mctx.exitStatus;
}
Index: repcheck.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/repcheck.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- repcheck.c 11 Jan 2006 01:54:30 -0000 1.1
+++ repcheck.c 11 Apr 2006 02:14:51 -0000 1.2
@@ -111,6 +111,7 @@
char **tmp;
struct hostent *serveraddr;
struct sockaddr_in srvsaddr;
+ char *p;
while((i=getopt(argc,argv,"p:"))!=EOF){
switch(i){
@@ -125,7 +126,10 @@
maxop=npend=0;
pendops=(Optype*)malloc(sizeof(Optype)*20);
sigset(SIGPIPE,SIG_IGN);
- while(gets(logline)){
+ while(fgets(logline, sizeof(logline), stdin)){
+ if (p = strchr(logline, '\n')) {
+ *p = 0;
+ }
if(!connected){
if((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1){
perror(argv[0]);
Index: repslave.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/repslave.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- repslave.c 11 Jan 2006 01:54:30 -0000 1.1
+++ repslave.c 11 Apr 2006 02:14:51 -0000 1.2
@@ -314,8 +314,11 @@
* Ignore SIGPIPE during write()
*/
sigset(SIGPIPE,SIG_IGN);
- while(gets(logline))
+ while(fgets(logline, sizeof(logline), stdin))
{
+ if (p = strchr(logline, '\n')) {
+ *p = 0;
+ }
if(log)
puts(logline);
for(tmp=ldap_ops,i=0;tmp[i];i++)
18 years
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools migratecred.c, 1.5, 1.6 pwenc.c, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/ldap/servers/slapd/tools
Modified Files:
migratecred.c pwenc.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: migratecred.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/migratecred.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- migratecred.c 19 Apr 2005 22:07:42 -0000 1.5
+++ migratecred.c 11 Apr 2006 02:14:51 -0000 1.6
@@ -172,7 +172,8 @@
#endif
#endif
- sprintf(libpath, "%s/../lib/des-plugin%s", newpath, shared_lib);
+ snprintf(libpath, sizeof(libpath), "%s/../lib/des-plugin%s", newpath, shared_lib);
+ libpath[sizeof(libpath)-1] = 0;
fct = (migrate_fn_type)sym_load(libpath, "migrateCredentials",
"DES Plugin", 1 /* report errors */ );
Index: pwenc.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/pwenc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- pwenc.c 19 Apr 2005 22:07:42 -0000 1.5
+++ pwenc.c 11 Apr 2006 02:14:51 -0000 1.6
@@ -129,7 +129,7 @@
struct pw_scheme *pwsp, *cmppwsp;
extern int optind;
char *cpwd = NULL; /* candidate password for comparison */
- char errorbuf[BUFSIZ];
+ char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE];
slapdFrontendConfig_t *slapdFrontendConfig = NULL;
char *opts = "Hs:c:D:";
18 years
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldif dllmain.c, 1.4, 1.5
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldif
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8136/ldapserver/ldap/servers/slapd/back-ldif
Modified Files:
dllmain.c
Log Message:
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code
Reviewed by: Nathan, Noriko, and Pete (Thanks!)
Fix Description: Clean up usage of sprintf, strcpy, fgets instead of
gets, fixed buffer usage, etc., mostly in the CGI code and other user
facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick
to force it to check printf style varargs functions, to check the format
string against the argument string, for type mismatches, missing
arguments, and too many arguments.
In the CGI form argument parsing code, we needed to be more careful
about checking for bad input - good input is supposed to look like this:
name=value&name=value&.....
&name=value. I don't think the original code
was checking properly for something like name&name=value.
There was another place where we were not checking to see if a buffer
had enough room before appending a string to it.
I had to change a couple of functions to allow passing in the size of
the buffer.
Fixed some issues raised by Noriko and Nathan.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: dllmain.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldif/dllmain.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dllmain.c 19 Apr 2005 22:07:39 -0000 1.4
+++ dllmain.c 11 Apr 2006 02:14:45 -0000 1.5
@@ -140,6 +140,7 @@
va_list ap;
va_start (ap, fmt);
_snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
+ debugBuf[sizeof(debugBuf)-1] = 0;
va_end (ap);
OutputDebugString (debugBuf);
18 years