diff --git a/crm/Makefile.am b/crm/Makefile.am index b7d881be4f..cc8e95c691 100644 --- a/crm/Makefile.am +++ b/crm/Makefile.am @@ -1,42 +1,42 @@ # # Copyright (C) 2004 Andrew Beekhof # # 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; either version 2 # of the License, or (at your option) any later version. # # 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. # MAINTAINERCLEANFILES = Makefile.in ## Subdirectories SUBDIRS = cib crmd pengine tengine admin DIST_SUBDIRS = cib crmd pengine tengine admin -dtddir = $(HA_NOARCHLIBHBDIR) +dtddir = $(HA_NOARCHDATAHBDIR) crm_varlibdir = $(HA_VARLIBDIR)/$(HB_PKG)/crm crm_varrundir = $(HA_VARRUNDIR)/$(HB_PKG)/crm EXTRA_DIST = crm-1.0.dtd dtd_SCRIPTS = crm.dtd crm.dtd: crm-1.0.dtd cp $(top_srcdir)/crm/crm-1.0.dtd crm.dtd install-exec-local: $(mkinstalldirs) $(DESTDIR)/$(crm_varlibdir) -chown $(HA_CCMUSER) $(DESTDIR)/$(crm_varlibdir) -chgrp $(HA_APIGROUP) $(DESTDIR)/$(crm_varlibdir) -chmod 750 $(DESTDIR)/$(crm_varlibdir) $(mkinstalldirs) $(DESTDIR)/$(crm_varrundir) -chown $(HA_CCMUSER) $(DESTDIR)/$(crm_varrundir) -chgrp $(HA_APIGROUP) $(DESTDIR)/$(crm_varrundir) -chmod 750 $(DESTDIR)/$(crm_varrundir) diff --git a/cts/Makefile.am b/cts/Makefile.am index 20ab77f625..57bd24ed54 100644 --- a/cts/Makefile.am +++ b/cts/Makefile.am @@ -1,44 +1,44 @@ # # heartbeat: Linux-HA heartbeat code # # Copyright (C) 2001 Michael Moerz # # 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; either version 2 # of the License, or (at your option) any later version. # # 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. # MAINTAINERCLEANFILES = Makefile.in -ctsdir = @hb_libdir@/cts +ctsdir = @HA_NOARCHDATAHBDIR@/cts cts_PYTHON = \ CM_fs.py \ CM_hb.py \ CM_LinuxHAv2.py \ CTS.py \ CTSaudits.py \ CTSlab.py \ CTStests.py \ extracttests.py \ getpeinputs.sh \ OCFIPraTest.py \ CIB.py cts_DATA = README cts_SCRIPTS = \ CTSproxy.py \ getpeinputs.sh \ LSBDummy all-local: $(cts_PYTHON) diff --git a/replace/strlcpy.c b/replace/strlcat.c similarity index 78% copy from replace/strlcpy.c copy to replace/strlcat.c index 64da43c240..8b909f9296 100644 --- a/replace/strlcpy.c +++ b/replace/strlcat.c @@ -1,29 +1,33 @@ #include #include /* * Copyright (C) 2007 Alan Robertson * This software licensed under the GNU LGPL. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ size_t -strlcpy(char *dest, const char * src, size_t maxlen) +strlcat(char *dest, const char * src, size_t maxlen) { - strncpy(dest, src, maxlen); - dest[maxlen-1]=EOS; - return strnlen(dest, maxlen); + size_t curlen = strlen(dest); + size_t addlen = strlen(src); + size_t appendlen = (maxlen-1) - curlen; + if (appendlen > 0) { + strlcpy(dest+curlen, src, maxlen-curlen); + } + return curlen + addlen; } diff --git a/replace/strlcpy.c b/replace/strlcpy.c index 64da43c240..661d02eafc 100644 --- a/replace/strlcpy.c +++ b/replace/strlcpy.c @@ -1,29 +1,32 @@ #include #include /* * Copyright (C) 2007 Alan Robertson * This software licensed under the GNU LGPL. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ size_t strlcpy(char *dest, const char * src, size_t maxlen) { - strncpy(dest, src, maxlen); - dest[maxlen-1]=EOS; - return strnlen(dest, maxlen); + size_t srclen = strlen(src); + if (maxlen > 0) { + strncpy(dest, src, maxlen); + dest[maxlen-1]=EOS; + } + return srclen; }