* config.guess.long: don't use -q option to grep because some amd-6-1-stable
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 Apr 2007 20:13:06 +0000 (20:13 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 Apr 2007 20:13:06 +0000 (20:13 +0000)
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.

ChangeLog
NEWS
amd/opts.c
config.guess.long

index b73b690bd0d9a3d59be548aa5de56b6dcc20aa78..74c557aae71657e1aa9cfcef681ba8879e32d160 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-04-13  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * 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  <christos@zoulas.com>
+
+       * 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  <ezk@cs.sunysb.edu>
 
        * updated copyright year to 2007 on all files.
diff --git a/NEWS b/NEWS
index 3c41b55d3e19b753f0ac18f57c98995da32c8b65..5ad823936b7337a53d34d110ae15e5cc79d4651c 100644 (file)
--- 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.
+
 *** Notes specific to am-utils version 6.1.5
 
 New amd.conf global parameter: nfs_allow_any_interface.  By default it is
index f5231bcca252fbcfbc0c17a50d760085fe2a0b6e..072cfde0db5b8fe14365cf1435dfb05e79f7d247 100644 (file)
@@ -1238,8 +1238,14 @@ expand_op(char *opt, int sel_p)
            }
 
            if (BUFSPACE(ep, vlen+1)) {
-             xstrlcpy(ep, vptr, 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';
            } else {
              plog(XLOG_ERROR, EXPAND_ERROR, opt);
              goto out;
index 4af3a587e6bae2c35c52d77ed54e1ccca4e1d7b6..2d2ea5c7fe82af103ffa826497006c8cfe81c3a5 100755 (executable)
@@ -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
        ;;
     * )