patch to cron

Andy Stevens stevens@electricalscience.com
Fri Nov 20 21:24:00 GMT 2015


Hello Cygwin patchers, this is my first submission, hope I do OK.

I have discovered a bug in Vixie's cron in the bash script
/usr/bin/cron-config. The bug only appears on Windows 10 which has
an NT version of "10.0". This breaks the version checking in the
bash script. (Bash only supports integer compare or ASCII compare,
but not float compare.)

Below is my proposed patch.  Thanks to
http://stackoverflow.com/questions/8654051 for this bash magic.


--- /usr/bin/cron-config        2015-01-21 23:34:21.000000000 -0500
+++ cron-config 2015-11-20 16:08:24.574218000 -0500
@@ -126,7 +126,10 @@
      nt2003=""
      nt=$(uname -s | sed -ne 's/^CYGWIN_NT-\([^ ]*\)/\1/p')
      [ -z "$nt" ] && echo "Unknown system name" && return 1
-    [ "$nt" \> 5.1 ] && nt2003=yes
+    minver=5.1
+    if [ ${nt%.*} -eq ${minver%.*} ] && [ ${nt#*.} \> ${minver#*.} ] || [ ${nt%.*} -gt ${minver%.*} ]; then
+       nt2003=yes
+    fi
      return 0
  } # === End of get_NT() === #



Best,

--Andy Stevens
Electrical Science, Inc.
114 Pearl St., Suite 2B
Port Chester, NY 10573 USA
Office: +1-914-939-7396
Mobile: +1-646-552-0732
Email: stevens@electricalscience.com
Web: www.electricalscience.com




More information about the Cygwin-patches mailing list