* amd/sun_map.c (sun_append_str): When translating '&' from Sun
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 Apr 2007 20:13:01 +0000 (20:13 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 Apr 2007 20:13:01 +0000 (20:13 +0000)
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.

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

index a948b725cf4b98659ce29a4ca39e30e8e1d0c721..9eb216052847186263b80ee2a10e08cddde10d84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-04-13  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * 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  <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 079d2b8b4eda5a44267ce63ecd3321dfa6d85e7e..a7fb18cf8318d25ca735d72bc185b6b6c3bc7883 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.
+       * translate '*' Sun maps correctly with "${key}"
 
 *** Notes specific to am-utils version 6.2a2
 
index fc6a09ba5b432d65932e60babdf5250237b9cf0b..c33a28f8ce82a3948789cb921d24a84076f2d4ac 100644 (file)
@@ -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';
index 08c28a1a430ac906049f62b48cc1030b76dbb003..841df77d54c5dc919ebf1ef3ae6f40e4012775ce 100644 (file)
@@ -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
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
        ;;
     * )