From: Erez Zadok Date: Fri, 13 Apr 2007 20:13:01 +0000 (+0000) Subject: * amd/sun_map.c (sun_append_str): When translating '&' from Sun X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=0bf1e413c81c8d0b01ccab13321db81fa05f040e;p=am-utils-6.0.git * amd/sun_map.c (sun_append_str): When translating '&' from Sun automounter maps, replace it with "${key}" in the Amd map, not with the value of the key at the time. This way '*' maps work too. * config.guess.long: don't use -q option to grep because some systems don't support it. Bug fix for solaris. * amd/opts.c (expand_op): Don't call xstrlcpy() to truncate a string. It causes spurious xstrlcpy() syslog() errors. Use memcpy() and explicitly terminate the string. --- diff --git a/ChangeLog b/ChangeLog index a948b72..9eb2160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-04-13 Erez Zadok + + * amd/sun_map.c (sun_append_str): When translating '&' from Sun + automounter maps, replace it with "${key}" in the Amd map, not + with the value of the key at the time. This way '*' maps work + too. + + * config.guess.long: don't use -q option to grep because some + systems don't support it. Bug fix for solaris. + +2007-03-11 Christos Zoulas + + * amd/opts.c (expand_op): Don't call xstrlcpy() to truncate a + string. It causes spurious xstrlcpy() syslog() errors. Use + memcpy() and explicitly terminate the string. + 2007-01-20 Erez Zadok * updated copyright year to 2007 on all files. diff --git a/NEWS b/NEWS index 079d2b8..a7fb18c 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,9 @@ ia64-hp-hpux11.23 (gcc and cc) powerpc-apple-darwin8.7.0 +- Bugs fixed: + * reduce annoying warnings from xstrlcpy when expanding options. + * translate '*' Sun maps correctly with "${key}" *** Notes specific to am-utils version 6.2a2 diff --git a/amd/opts.c b/amd/opts.c index fc6a09b..c33a28f 100644 --- a/amd/opts.c +++ b/amd/opts.c @@ -1238,6 +1238,11 @@ expand_op(char *opt, int sel_p) } if (BUFSPACE(ep, vlen+1)) { + /* + * Don't call xstrlcpy() to truncate a string here. It causes + * spurious xstrlcpy() syslog() errors. Use memcpy() and + * explicitly terminate the string. + */ memcpy(ep, vptr, vlen+1); ep += vlen; *ep = '\0'; diff --git a/amd/sun_map.c b/amd/sun_map.c index 08c28a1..841df77 100644 --- a/amd/sun_map.c +++ b/amd/sun_map.c @@ -297,7 +297,7 @@ sun_append_str(char *dest, * with a new string, one or more key subs. where replaced with the * entry key. */ - if ((sub = sun_strsub(str, SUN_KEY_SUB, key)) != NULL) { + if ((sub = sun_strsub(str, SUN_KEY_SUB, "${key}")) != NULL) { out = sub; /* * Try to convert any variable substitutions. If this function diff --git a/config.guess.long b/config.guess.long index 4af3a58..2d2ea5c 100755 --- a/config.guess.long +++ b/config.guess.long @@ -31,11 +31,11 @@ case "${GCONFIG}" in GCONFIG=`echo ${GCONFIG} | sed -e 's/i.86/i386/' -e 's/linux-gnu/linux/'` if test -f /etc/redhat-release ; then long=`getver /etc/redhat-release` - if grep -q 'Red Hat Enterprise Linux' /etc/redhat-release; then + if grep 'Red Hat Enterprise Linux' /etc/redhat-release > /dev/null 2>&1 ; then echo ${GCONFIG}-rhel${long} - elif grep -q 'Fedora Core' /etc/redhat-release; then + elif grep 'Fedora Core' /etc/redhat-release > /dev/null 2>&1 ; then echo ${GCONFIG}-fc${long} - elif grep -q 'CentOS' /etc/redhat-release; then + elif grep 'CentOS' /etc/redhat-release > /dev/null 2>&1 ; then echo ${GCONFIG}-centos${long} else echo ${GCONFIG}-rh${long} @@ -43,7 +43,7 @@ case "${GCONFIG}" in exit 0 elif test -f /etc/SuSE-release ; then long=`getver /etc/SuSE-release` - if grep -q 'Enterprise Server' /etc/SuSE-release; then + if grep 'Enterprise Server' /etc/SuSE-release > /dev/null 2>&1 ; then echo ${GCONFIG}-sles${long} else echo ${GCONFIG}-suse${long} @@ -70,8 +70,10 @@ case "${GCONFIG}" in ;; *solaris* ) - if grep -qi nexentaos /etc/release ; then + if grep -i nexentaos /etc/release > /dev/null 2>&1 ; then echo ${GCONFIG}-nexentaos + else + echo ${GCONFIG} fi ;; * )