rpms/ntp/FC-6 ntp-4.2.4p0-droproot.patch, NONE, 1.1 ntp-4.2.4p0-mlock.patch, NONE, 1.1 .cvsignore, 1.23, 1.24 ntp.spec, 1.63, 1.64 ntpd.init, 1.23, 1.24 sources, 1.24, 1.25 ntp-4.2.4-allowbind.patch, 1.1, NONE ntp-4.2.4-bcast.patch, 1.1, NONE ntp-4.2.4-droproot.patch, 1.1, NONE ntp-4.2.4-intresflags.patch, 1.1, NONE ntp-4.2.4-mlock.patch, 1.1, NONE ntp-4.2.4-optvalues.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Mar 7 18:49:02 UTC 2007


Author: mlichvar

Update of /cvs/dist/rpms/ntp/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv28329

Modified Files:
	.cvsignore ntp.spec ntpd.init sources 
Added Files:
	ntp-4.2.4p0-droproot.patch ntp-4.2.4p0-mlock.patch 
Removed Files:
	ntp-4.2.4-allowbind.patch ntp-4.2.4-bcast.patch 
	ntp-4.2.4-droproot.patch ntp-4.2.4-intresflags.patch 
	ntp-4.2.4-mlock.patch ntp-4.2.4-optvalues.patch 
Log Message:
- update to 4.2.4p0
- fix init script
  - don't add second -g to ntpd options (#228424)
  - update getopts
  - skip all refclocks when parsing ntp.conf
Resolves: #228424


ntp-4.2.4p0-droproot.patch:
 html/ntpdate.html |    7 ++-
 ntpdate/ntpdate.c |  125 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 128 insertions(+), 4 deletions(-)

--- NEW FILE ntp-4.2.4p0-droproot.patch ---
--- ntp-4.2.4p0/ntpdate/ntpdate.c.droproot	2007-02-22 12:02:08.000000000 +0100
+++ ntp-4.2.4p0/ntpdate/ntpdate.c	2007-03-07 16:06:26.000000000 +0100
@@ -53,6 +53,12 @@
 
 #include <arpa/inet.h>
 
+/* Linux capabilities */
+#include <sys/capability.h>
+#include <sys/prctl.h>
+#include <pwd.h>
+#include <grp.h>
+
 #ifdef SYS_VXWORKS
 # include "ioLib.h"
 # include "sockLib.h"
@@ -159,6 +165,11 @@
 int unpriv_port = 0;
 
 /*
+ * Use capabilities to drop privileges and switch uids
+ */
+char *server_user;
+
+/*
  * Program name.
  */
 char *progname;
@@ -301,6 +312,88 @@
 static ni_namelist *getnetinfoservers P((void));
 #endif
 
+/* This patch is adapted (copied) from Chris Wings drop root patch
+ * for xntpd.
+ */
+void drop_root(uid_t server_uid, gid_t server_gid)
+{
+  cap_t caps;
+
+  if (prctl(PR_SET_KEEPCAPS, 1)) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "prctl(PR_SET_KEEPCAPS, 1) failed");
+		}
+		else {
+			fprintf(stderr, "prctl(PR_SET_KEEPCAPS, 1) failed.\n");
+		}
+    exit(1);
+  }
+
+  if ( setgroups(0, NULL) == -1 ) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "setgroups failed.");
+		}
+		else {
+			fprintf(stderr, "setgroups failed.\n");
+		}
+    exit(1);
+  }
+
+  if ( setegid(server_gid) == -1 || seteuid(server_uid) == -1 ) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "setegid/seteuid to uid=%d/gid=%d failed.", server_uid,
+							server_gid);
+		}
+		else {
+			fprintf(stderr, "setegid/seteuid to uid=%d/gid=%d failed.\n", server_uid,
+							server_gid);
+		}
+    exit(1);
+  }
+
+  caps = cap_from_text("cap_sys_time=epi");
+  if (caps == NULL) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "cap_from_text failed.");
+		}
+		else {
+			fprintf(stderr, "cap_from_text failed.\n");
+		}
+    exit(1);
+  }
+
+  if (cap_set_proc(caps) == -1) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "cap_set_proc failed.");
+		}
+		else {
+			fprintf(stderr, "cap_set_proc failed.\n");
+		}
+    exit(1);
+  }
+  
+  /* Try to free the memory from cap_from_text */
+  cap_free( caps );
+
+  if ( setregid(server_gid, server_gid) == -1 ||
+       setreuid(server_uid, server_uid) == -1 ) {
+		if (syslogit) {
+			msyslog(LOG_ERR, "setregid/setreuid to uid=%d/gid=%d failed.",
+							server_uid, server_gid);
+		}
+		else {
+			fprintf(stderr, "setregid/setreuid to uid=%d/gid=%d failed.\n",
+							server_uid, server_gid);
+		}
+    exit(1);
+  }
+
+	if (syslogit) {
+		msyslog(LOG_DEBUG, "running as uid(%d)/gid(%d) euid(%d)/egid(%d).",
+						getuid(), getgid(), geteuid(), getegid());
+	}
+}
+
 /*
  * Main program.  Initialize us and loop waiting for I/O and/or
  * timer expiries.
@@ -354,7 +447,7 @@
 	clear_globals();
 #endif
 
-
+	server_user = NULL;
 	/* Check to see if we have IPv6. Otherwise force the -4 flag */
 	if (isc_net_probeipv6() != ISC_R_SUCCESS) {
 		ai_fam_templ = AF_INET;
@@ -367,7 +460,7 @@
 	/*
 	 * Decode argument list
 	 */
-	while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uv")) != EOF)
+ 	while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uvU:")) != EOF)
 		switch (c)
 		{
 		case '4':
@@ -445,6 +538,14 @@
 		case 'u':
 			unpriv_port = 1;
 			break;
+ 		case 'U':
+ 			if (ntp_optarg) {
+ 				server_user = strdup(ntp_optarg);
+ 			}
+ 			else {
+ 				++errflg;
+ 			}
+ 			break;
 		case '?':
 			++errflg;
 			break;
@@ -454,7 +555,7 @@
 	
 	if (errflg) {
 		(void) fprintf(stderr,
-		    "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
+		    "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] [-U username] server ...\n",
 		    progname);
 		exit(2);
 	}
@@ -574,6 +675,24 @@
 	initializing = 0;
 	was_alarmed = 0;
 
+	if (server_user) {
+		struct passwd *pwd = NULL;
+
+		/* Lookup server_user uid/gid before chroot/chdir */
+		pwd = getpwnam( server_user );
+		if ( pwd == NULL ) {
+			if (syslogit) {
+				msyslog(LOG_ERR, "Failed to lookup user '%s'.", server_user);
+			}
+			else {
+				fprintf(stderr, "Failed to lookup user '%s'.\n", server_user);
+			}
+			exit(1);
+		}
+		drop_root(pwd->pw_uid, pwd->pw_gid);
+	}
+
+
 	while (complete_servers < sys_numservers) {
 #ifdef HAVE_POLL_H
 		struct pollfd* rdfdes;
--- ntp-4.2.4p0/html/ntpdate.html.droproot	2006-12-28 13:02:58.000000000 +0100
+++ ntp-4.2.4p0/html/ntpdate.html	2007-03-07 15:57:33.000000000 +0100
@@ -18,7 +18,7 @@
 		<hr>
 		<p>Disclaimer: The functionality of this program is now available in the <tt>ntpd</tt> program. See the <tt>-q</tt> command line option in the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page. After a suitable period of mourning, the <tt>ntpdate</tt> program is to be retired from this distribution</p>
 		<h4>Synopsis</h4>
-		<tt>ntpdate [ -bBdoqsuv ] [ -a <i>key</i> ] [ -e <i>authdelay</i> ] [ -k <i>keyfile</i> ] [ -o <i>version</i> ] [ -p <i>samples</i> ] [ -t <i>timeout</i> ] <i>server</i> [ ... ]</tt>
+		<tt>ntpdate [ -bBdoqsuv ] [ -a <i>key</i> ] [ -e <i>authdelay</i> ] [ -k <i>keyfile</i> ] [ -o <i>version</i> ] [ -p <i>samples</i> ] [ -t <i>timeout</i> ] [ -U <i>user_name</i> ] <i>server</i> [ ... ]</tt>
 		<h4>Description</h4>
 		<tt>ntpdate</tt> sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the <i>server</i> arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of <tt>ntpdate</tt> depends on the number of servers, the number of polls each time it is run and the interval between runs.
 		<p><tt>ntpdate</tt> can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon <tt>ntpd</tt>. It is also possible to run <tt>ntpdate</tt> from a <tt>cron</tt> script. However, it is important to note that <tt>ntpdate</tt> with contrived <tt>cron</tt> scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since <tt>ntpdate</tt> does not discipline the host clock frequency as does <tt>ntpd</tt>, the accuracy using <tt>ntpdate</tt> is limited.</p>
@@ -58,6 +58,11 @@
 			<dd>Direct <tt>ntpdate</tt> to use an unprivileged port or outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the <tt>-d</tt> option always uses unprivileged ports.
 			<dt><tt>-<i>v</i></tt>
 			<dd>Be verbose. This option will cause <tt>ntpdate</tt>'s version identification string to be logged.
+
+			<dt><tt>-U <i>user_name</i></tt></dt>
+			<dd>ntpdate process drops root privileges and changes user ID to
+			<i>user_name</i> and group ID to the primary group of 
+			<i>server_user</i>.
 		</dl>
 		<h4>Diagnostics</h4>
 		<tt>ntpdate</tt>'s exit status is zero if it finds a server and updates the clock, and nonzero otherwise.

ntp-4.2.4p0-mlock.patch:
 html/ntpd.html   |    4 +++-
 ntpd/ntpd-opts.c |   23 ++++++++++++++++++++++-
 ntpd/ntpd-opts.h |   19 +++++++++++++------
 ntpd/ntpd.c      |    4 +++-
 4 files changed, 41 insertions(+), 9 deletions(-)

--- NEW FILE ntp-4.2.4p0-mlock.patch ---
--- ntp-4.2.4p0/html/ntpd.html.mlock	2007-03-07 16:17:07.000000000 +0100
+++ ntp-4.2.4p0/html/ntpd.html	2007-03-07 16:17:07.000000000 +0100
@@ -34,7 +34,7 @@
 		</ul>
 		<hr>
 		<h4 id="synop">Synopsis</h4>
-		<tt>ntpd [ -46aAbdDgLnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>iface</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt>
+		<tt>ntpd [ -46aAbdDgLmnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>iface</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt>
 		<h4 id="descr">Description</h4>
 		<p>The <tt>ntpd</tt> program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. <tt>ntpd</tt> does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 picoseconds. While the ultimate precision is not achievable with ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs.</p>
 		<h4 id="op">How NTP Operates</h4>
@@ -95,6 +95,8 @@
 			<dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> configuration command.
 			<dt><tt>-L</tt>
 			<dd>Do not listen to virtual IPs. The default is to listen.
+			<dt><tt>-m</tt>
+			<dd>Lock memory.
 			<dt><tt>-n</tt>
 			<dd>Don't fork.
 			<dt><tt>-N</tt>
--- ntp-4.2.4p0/ntpd/ntpd.c.mlock	2007-03-07 16:17:07.000000000 +0100
+++ ntp-4.2.4p0/ntpd/ntpd.c	2007-03-07 16:17:07.000000000 +0100
@@ -704,7 +704,8 @@
 	}
 #endif
 
-#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE)
+#if defined(MCL_CURRENT) && defined(MCL_FUTURE)
+    if (HAVE_OPT( MLOCK )) {
 # ifdef HAVE_SETRLIMIT
 	/*
 	 * Set the stack limit to something smaller, so that we don't lock a lot
@@ -742,6 +743,7 @@
 	 */
 	if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
 		msyslog(LOG_ERR, "mlockall(): %m");
+    }
 #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */
 # ifdef HAVE_PLOCK
 #  ifdef PROCLOCK
--- ntp-4.2.4p0/ntpd/ntpd-opts.c.mlock	2007-03-07 16:17:07.000000000 +0100
+++ ntp-4.2.4p0/ntpd/ntpd-opts.c	2007-03-07 16:17:07.000000000 +0100
@@ -265,6 +265,15 @@
 #define NICE_FLAGS       (OPTST_DISABLED)
 
 /*
+ *  Mlock option description:
+ */
+tSCC    zMlockText[] =
+        "Lock memory";
+tSCC    zMlock_NAME[]               = "MLOCK";
+tSCC    zMlock_Name[]               = "mlock";
+#define MLOCK_FLAGS       (OPTST_DISABLED)
+
+/*
  *  Pidfile option description:
  */
 tSCC    zPidfileText[] =
@@ -796,6 +805,18 @@
      /* desc, NAME, name */ zSlewText, zSlew_NAME, zSlew_Name,
      /* disablement strs */ NULL, NULL },
 
+  {  /* entry idx, value */ 29, VALUE_OPT_MLOCK,
+     /* equiv idx, value */ 29, VALUE_OPT_MLOCK,
+     /* equivalenced to  */ NO_EQUIVALENT,
+     /* min, max, act ct */ 0, 1, 0,
+     /* opt state flags  */ MLOCK_FLAGS, 0,
+     /* last opt argumnt */ { NULL },
+     /* arg list/cookie  */ NULL,
+     /* must/cannot opts */ NULL, NULL,
+     /* option proc      */ NULL,
+     /* desc, NAME, name */ zMlockText, zMlock_NAME, zMlock_Name,
+     /* disablement strs */ NULL, NULL },
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
@@ -913,7 +934,7 @@
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 29 /* user option count */
+    OPTION_CT, 30 /* user option count */
 };
 
 /*
--- ntp-4.2.4p0/ntpd/ntpd-opts.h.mlock	2007-03-07 12:37:35.000000000 +0100
+++ ntp-4.2.4p0/ntpd/ntpd-opts.h	2007-03-07 16:17:07.000000000 +0100
@@ -82,14 +82,15 @@
         INDEX_OPT_VAR              = 26,
         INDEX_OPT_DVAR             = 27,
         INDEX_OPT_SLEW             = 28,
-        INDEX_OPT_VERSION          = 29,
-        INDEX_OPT_HELP             = 30,
-        INDEX_OPT_MORE_HELP        = 31,
-        INDEX_OPT_SAVE_OPTS        = 32,
-        INDEX_OPT_LOAD_OPTS        = 33
+        INDEX_OPT_MLOCK            = 29,
+        INDEX_OPT_VERSION          = 30,
+        INDEX_OPT_HELP             = 31,
+        INDEX_OPT_MORE_HELP        = 32,
+        INDEX_OPT_SAVE_OPTS        = 33,
+        INDEX_OPT_LOAD_OPTS        = 34
 } teOptIndex;
 
-#define OPTION_CT    34
+#define OPTION_CT    35
 #define NTPD_VERSION       "4.2.4p0"
 #define NTPD_FULL_VERSION  "ntpd - NTP daemon program - Ver. 4.2.4p0"
 
@@ -182,6 +183,10 @@
 #  warning undefining MODIFYMMTIMER due to option name conflict
 #  undef   MODIFYMMTIMER
 # endif
+# ifdef    MLOCK
+#  warning undefining MLOCK due to option name conflict
+#  undef   MLOCK
+# endif
 # ifdef    NOFORK
 #  warning undefining NOFORK due to option name conflict
 #  undef   NOFORK
@@ -251,6 +256,7 @@
 # undef LOGFILE
 # undef NOVIRTUALIPS
 # undef MODIFYMMTIMER
+# undef MLOCK
 # undef NOFORK
 # undef NICE
 # undef PIDFILE
@@ -293,6 +299,7 @@
 #ifdef SYS_WINNT
 #define VALUE_OPT_MODIFYMMTIMER  'M'
 #endif /* SYS_WINNT */
+#define VALUE_OPT_MLOCK          'm'
 #define VALUE_OPT_NOFORK         'n'
 #define VALUE_OPT_NICE           'N'
 #define VALUE_OPT_PIDFILE        'p'


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/ntp/FC-6/.cvsignore,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- .cvsignore	17 Jan 2007 16:06:39 -0000	1.23
+++ .cvsignore	7 Mar 2007 18:49:00 -0000	1.24
@@ -1,2 +1,2 @@
 ntpstat-0.2.tgz
-ntp-4.2.4.tar.gz
+ntp-4.2.4p0.tar.gz


Index: ntp.spec
===================================================================
RCS file: /cvs/dist/rpms/ntp/FC-6/ntp.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- ntp.spec	29 Jan 2007 13:51:21 -0000	1.63
+++ ntp.spec	7 Mar 2007 18:49:00 -0000	1.64
@@ -2,8 +2,8 @@
 
 Summary: Synchronizes system time using the Network Time Protocol (NTP).
 Name: ntp
-Version: 4.2.4
-Release: 3%{?dist}
+Version: 4.2.4p0
+Release: 1%{?dist}
 License: distributable
 Group: System Environment/Daemons
 Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-%{version}.tar.gz
@@ -17,21 +17,17 @@
 Source7: filter-requires-ntp.sh
 %define __find_requires %{SOURCE7}
 
-Patch2: ntp-4.2.4-droproot.patch
+Patch2: ntp-4.2.4p0-droproot.patch
 Patch3: ntp-4.2.4-groups.patch
 Patch4: ntp-4.1.1c-rc3-authkey.patch
 Patch5: ntp-4.2.4-linkfastmath.patch
-Patch6: ntp-4.2.4-allowbind.patch
 Patch7: ntp-4.2.4-revert452.patch
-Patch8: ntp-4.2.4-intresflags.patch
 Patch9: ntp-4.2.4-html2man.patch
 Patch10: ntp-4.2.4-htmldoc.patch
 Patch11: ntp-stable-4.2.0a-20050816-keyfile.patch
 Patch12: ntp-4.2.4-sprintf.patch
 Patch13: ntp-4.2.4-autoopts.patch
-Patch14: ntp-4.2.4-mlock.patch
-Patch15: ntp-4.2.4-optvalues.patch
-Patch16: ntp-4.2.4-bcast.patch
+Patch14: ntp-4.2.4p0-mlock.patch
 
 URL: http://www.ntp.org
 Requires(pre): shadow-utils 
@@ -61,17 +57,13 @@
 %patch2 -p1 -b .droproot
 %patch3 -p1 -b .groups
 %patch4 -p1 -b .authkey
-%patch6 -p1 -b .allowbind
 %patch7 -p1 -b .revert452
-%patch8 -p1 -b .intresflags
 %patch9 -p1 -b .html2man
 %patch10 -p1 -b .htmldoc
 %patch11 -p1 -b .keyfile
 %patch12 -p1 -b .sprintf
 %patch13 -p1 -b .autoopts
 %patch14 -p1 -b .mlock
-%patch15 -p1 -b .optvalues
-%patch16 -p1 -b .bcast
 
 %ifarch ia64
 %patch5 -p1 -b .linkfastmath
@@ -183,6 +175,13 @@
 
 
 %changelog
+* Wed Mar 07 2007 Miroslav Lichvar <mlichvar at redhat.com> 4.2.4p0-1.fc6
+- update to 4.2.4p0
+- fix init script
+  - don't add second -g to ntpd options (#228424)
+  - update getopts
+  - skip all refclocks when parsing ntp.conf
+
 * Mon Jan 29 2007 Miroslav Lichvar <mlichvar at redhat.com> 4.2.4-3.fc6
 - add option to enable memory locking (#195617)
 - fix broadcast client


Index: ntpd.init
===================================================================
RCS file: /cvs/dist/rpms/ntp/FC-6/ntpd.init,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ntpd.init	22 Nov 2006 14:57:15 -0000	1.23
+++ ntpd.init	7 Mar 2007 18:49:00 -0000	1.24
@@ -64,13 +64,15 @@
 readconf() {
 	dostep=''
 	dropstr=''
+	hasg=''
 	OPTIND=1
-	while getopts ":46aAbc:dD:f:gi:k:l:LnN:p:P:qr:s:t:u:v:V:x" args $OPTIONS;
+	while getopts ":46aAbc:dD:f:gi:I:k:l:LmnN:p:P:qr:s:t:u:U:v:V:x" args $OPTIONS;
 	do 
 	  case "$args" in
 	    x) dostep=yes;;
 	    c) ntpconf="$OPTARG";;
 	    u) dropstr="-U $(echo $OPTARG | sed 's/:.*//')";;
+	    g) hasg=yes;;
 	  esac
 	done
 
@@ -85,7 +87,7 @@
 	    # -x option is used, but step-tickers doesn't exist or contain
 	    # anything useful, use servers from ntp.conf instead
 	    tickers=$(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \
-	        fgrep -v 127.127.1.0)
+	        egrep -v '127\.127\.[0-9]+\.[0-9]+')
 	fi
 }
 
@@ -100,10 +102,10 @@
 	    echo
 	    if [ $RETVAL -eq 0 ]; then
 	        [ "$SYNC_HWCLOCK" = "yes" ] && sync_hwclock
-	    else
+	    elif [ -z "$hasg" ]; then
 	        OPTIONS="$OPTIONS -g"
 	    fi
-	else
+	elif [ -z "$hasg" ]; then
 	    # -g can replace the grep for time servers
 	    # as it permits ntpd to violate its 1000s limit once.
 	    OPTIONS="$OPTIONS -g"


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/ntp/FC-6/sources,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- sources	17 Jan 2007 16:06:39 -0000	1.24
+++ sources	7 Mar 2007 18:49:00 -0000	1.25
@@ -1,2 +1,2 @@
 6b2bedefe2e7c63ea52609b222022121  ntpstat-0.2.tgz
-eb9147d26cbe18bd8fbec07f1df55aef  ntp-4.2.4.tar.gz
+6f381e3764eac481bed9cf7e4d508952  ntp-4.2.4p0.tar.gz


--- ntp-4.2.4-allowbind.patch DELETED ---


--- ntp-4.2.4-bcast.patch DELETED ---


--- ntp-4.2.4-droproot.patch DELETED ---


--- ntp-4.2.4-intresflags.patch DELETED ---


--- ntp-4.2.4-mlock.patch DELETED ---


--- ntp-4.2.4-optvalues.patch DELETED ---




More information about the fedora-cvs-commits mailing list