Author: rmeggins
Update of /cvs/dirsec/dsgw
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32675/dsgw
Modified Files:
Makefile.am setup-ds-dsgw.in aclocal.m4 configure missing
install-sh Makefile.in depcomp config.sub config.guess compile
Log Message:
enhance setup - move to sbin, check for already configured, add reconfig option to force
reconfig, add support for users and groups
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.am 30 Jan 2008 17:47:50 -0000 1.12
+++ Makefile.am 31 Jan 2008 21:43:36 -0000 1.13
@@ -223,7 +223,7 @@
dist_gwinfo_DATA = html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
-nodist_bin_SCRIPTS = setup-ds-dsgw
+nodist_sbin_SCRIPTS = setup-ds-dsgw
# add more here for localized bundles
nodist_property_DATA = root.res en.res en_US.res
Index: setup-ds-dsgw.in
===================================================================
RCS file: /cvs/dirsec/dsgw/setup-ds-dsgw.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- setup-ds-dsgw.in 31 Jan 2008 20:31:59 -0000 1.2
+++ setup-ds-dsgw.in 31 Jan 2008 21:43:36 -0000 1.3
@@ -76,6 +76,8 @@
httpurl="http://$host:$port"
fi
httpdconf=$admservdir/httpd.conf
+ dsgwuser=`ls -l $admservdir/local.conf | awk '{print $3}'`
+ dsgwgroup=`ls -l $admservdir/local.conf | awk '{print $4}'`
fi
# see if there are any directory servers here
@@ -98,14 +100,18 @@
port=`getValFromLdif nsslapd-port "$dir/dse.ldif"`
ldapurl="ldap://$host:$port"
fi
- # get suffix
- grep ^nsslapd-suffix: $dir/dse.ldif | sed -e 's/^nsslapd-suffix:[ ]*//' | while
read suffix ; do
- case "$suffix" in
- *netscaperoot) ;;
- *NetscapeRoot) ;;
- *) break ;; # find the first non-netscaperoot suffix
- esac
- done
+ # get suffix - first non-netscaperoot suffix
+ savesuffix="$suffix"
+ suffix=`grep ^nsslapd-suffix: $dir/dse.ldif | sed -e 's/^nsslapd-suffix:[
]*//' | grep -v -i o=netscaperoot | head -1`
+ if [ -z "$suffix" ] ; then
+ suffix="$savesuffix"
+ fi
+ if [ -z "$dsgwuser" ] ; then
+ dsgwuser=`ls -l $dir/dse.ldif | awk '{print $3}'`
+ fi
+ if [ -z "$dsgwgroup" ] ; then
+ dsgwgroup=`ls -l $dir/dse.ldif | awk '{print $4}'`
+ fi
fi
done
@@ -122,6 +128,8 @@
silent=1
elif [ "$arg" = "-k" ]; then
keepinffile=1
+ elif [ "$arg" = "-r" ]; then
+ reconfig=1
elif [ "$arg" = "-f" ]; then
nextisinffile=1
elif [ $nextisinffile ]; then
@@ -140,9 +148,33 @@
httpport=`getValFromInf Port $inffile`
httpurl="http://$host:$httpport"
ldapurl="ldap://$host:$port"
+ infuser=`getValFromInf SysUser $inffile`
+ infgroup=`getValFromInf SysGroup $inffile`
+ if [ -z "$infuser" ] ; then
+ infuser=`getValFromInf SuiteSpotUserID $inffile`
+ fi
+ if [ -z "$infgroup" ] ; then
+ infgroup=`getValFromInf SuiteSpotGroup $inffile`
+ fi
+ if [ -n "$infuser" ] ; then
+ dsgwuser="$infuser"
+ fi
+ if [ -n "$infgroup" ] ; then
+ dsgwgroup="$infgroup"
+ fi
+fi
+
+if [ -z "$reconfig" -a -f $dsgwconfigdir/dsgw.conf ] ; then
+ echo The Directory Server Gateway has already been configured. The
+ echo file $dsgwconfigdir/dsgw.conf
+ echo exists already. If you want to force a reconfiguration, removing
+ echo your existing configuration and recreating it, run this script
+ echo again with the "-r" argument.
+ exit 1
fi
# generate dsgw.conf and pb.conf and default.conf in the $dsgwconfigdir directory
+rm -f $dsgwconfigdir/dsgw.conf
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
@@ -153,6 +185,10 @@
-e "s#@httpurl@#$httpurl#g" \
@configdir(a)/dsgw.tmpl > $dsgwconfigdir/dsgw.conf
+chown $dsgwuser:$dsgwgroup $dsgwconfigdir/dsgw.conf
+chmod 0400 $dsgwconfigdir/dsgw.conf
+
+rm -f $dsgwconfigdir/pb.conf
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
@@ -163,6 +199,10 @@
-e "s#@httpurl@#$httpurl#g" \
@pbconfigdir(a)/pb.tmpl > $dsgwconfigdir/pb.conf
+chown $dsgwuser:$dsgwgroup $dsgwconfigdir/pb.conf
+chmod 0400 $dsgwconfigdir/pb.conf
+
+rm -f $dsgwconfigdir/orgchart.conf
sed -e "s#@host@#$hostname#g" \
-e "s#@port@#$port#g" \
-e "s#@httpport@#$httpport#g" \
@@ -173,8 +213,14 @@
-e "s#@httpurl@#$httpurl#g" \
@orghtmldir(a)/orgchart.tmpl > $dsgwconfigdir/orgchart.conf
+chown $dsgwuser:$dsgwgroup $dsgwconfigdir/orgchart.conf
+chmod 0400 $dsgwconfigdir/orgchart.conf
+
# the default.conf is just a copy of dsgw.conf
+rm -f $dsgwconfigdir/default.conf
cp $dsgwconfigdir/dsgw.conf $dsgwconfigdir/default.conf
+chown $dsgwuser:$dsgwgroup $dsgwconfigdir/default.conf
+chmod 0400 $dsgwconfigdir/default.conf
# tell Apache about the dsgw - must restart Apache
grep dsgw-httpd.conf "$httpdconf" > /dev/null 2>&1 || (echo
"" ; echo "# DSGW configuration" ; echo "Include
$dsgwconfigdir/dsgw-httpd.conf") >> $httpdconf
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/dsgw/Makefile.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Makefile.in 31 Jan 2008 03:14:44 -0000 1.13
+++ Makefile.in 31 Jan 2008 21:43:36 -0000 1.14
@@ -92,7 +92,7 @@
am__EXEEXT_1 = unauth$(EXEEXT) search$(EXEEXT) csearch$(EXEEXT) \
newentry$(EXEEXT) tutor$(EXEEXT) lang$(EXEEXT)
am__installdirs = "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
\
- "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(configdir)" \
"$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)" \
"$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)" \
"$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)" \
@@ -154,8 +154,8 @@
unauth_OBJECTS = $(am_unauth_OBJECTS)
unauth_LDADD = $(LDADD)
cgibinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-nodist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(cgibin_SCRIPTS) $(nodist_bin_SCRIPTS)
+nodist_sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(cgibin_SCRIPTS) $(nodist_sbin_SCRIPTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -535,7 +535,7 @@
dist_gwinfo_DATA = html/info/infonav.html
nodist_context_DATA = dsgw-httpd.conf
-nodist_bin_SCRIPTS = setup-ds-dsgw
+nodist_sbin_SCRIPTS = setup-ds-dsgw
# add more here for localized bundles
nodist_property_DATA = root.res en.res en_US.res
@@ -745,24 +745,24 @@
echo " rm -f '$(DESTDIR)$(cgibindir)/$$f'"; \
rm -f "$(DESTDIR)$(cgibindir)/$$f"; \
done
-install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS)
+install-nodist_sbinSCRIPTS: $(nodist_sbin_SCRIPTS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(nodist_bin_SCRIPTS)'; for p in $$list; do \
+ test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+ @list='$(nodist_sbin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(nodist_binSCRIPT_INSTALL) '$$d$$p'
'$(DESTDIR)$(bindir)/$$f'"; \
- $(nodist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f";
\
+ echo " $(nodist_sbinSCRIPT_INSTALL) '$$d$$p'
'$(DESTDIR)$(sbindir)/$$f'"; \
+ $(nodist_sbinSCRIPT_INSTALL) "$$d$$p"
"$(DESTDIR)$(sbindir)/$$f"; \
else :; fi; \
done
-uninstall-nodist_binSCRIPTS:
+uninstall-nodist_sbinSCRIPTS:
@$(NORMAL_UNINSTALL)
- @list='$(nodist_bin_SCRIPTS)'; for p in $$list; do \
+ @list='$(nodist_sbin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sbindir)/$$f"; \
done
mostlyclean-compile:
@@ -1193,7 +1193,7 @@
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) config.h
installdirs:
- for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
"$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"
"$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)"
"$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)"
"$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)"
"$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"; do \
+ for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)"
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(configdir)"
"$(DESTDIR)$(gwinfodir)" "$(DESTDIR)$(htmldir)"
"$(DESTDIR)$(maninstdir)" "$(DESTDIR)$(orghtmldir)"
"$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)"
"$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -1250,7 +1250,7 @@
install-dist_pbhtmlDATA install-nodist_contextDATA \
install-nodist_propertyDATA
-install-exec-am: install-nodist_binSCRIPTS
+install-exec-am: install-nodist_sbinSCRIPTS
install-info: install-info-am
@@ -1283,8 +1283,8 @@
uninstall-dist_htmlDATA uninstall-dist_maninstDATA \
uninstall-dist_orghtmlDATA uninstall-dist_pbconfigDATA \
uninstall-dist_pbhtmlDATA uninstall-info-am \
- uninstall-nodist_binSCRIPTS uninstall-nodist_contextDATA \
- uninstall-nodist_propertyDATA
+ uninstall-nodist_contextDATA uninstall-nodist_propertyDATA \
+ uninstall-nodist_sbinSCRIPTS
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-cgibinPROGRAMS clean-generic clean-libtool \
@@ -1300,8 +1300,8 @@
install-dist_orghtmlDATA install-dist_pbconfigDATA \
install-dist_pbhtmlDATA install-exec install-exec-am \
install-info install-info-am install-man \
- install-nodist_binSCRIPTS install-nodist_contextDATA \
- install-nodist_propertyDATA install-strip installcheck \
+ install-nodist_contextDATA install-nodist_propertyDATA \
+ install-nodist_sbinSCRIPTS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
@@ -1310,8 +1310,8 @@
uninstall-dist_gwinfoDATA uninstall-dist_htmlDATA \
uninstall-dist_maninstDATA uninstall-dist_orghtmlDATA \
uninstall-dist_pbconfigDATA uninstall-dist_pbhtmlDATA \
- uninstall-info-am uninstall-nodist_binSCRIPTS \
- uninstall-nodist_contextDATA uninstall-nodist_propertyDATA
+ uninstall-info-am uninstall-nodist_contextDATA \
+ uninstall-nodist_propertyDATA uninstall-nodist_sbinSCRIPTS
# By default create only the default root bundle (english).