[Git][NTPsec/ntpsec][master] ntpd: add missing option cases.

Gary E. Miller gitlab at mg.gitlab.com
Fri Apr 14 18:35:54 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
88be996a by Gary E. Miller at 2017-04-14T11:34:39-07:00
ntpd: add missing option cases.

'b' and 'r' options can never work as they aare not in ALL_OPTIONS.

- - - - -


1 changed file:

- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -244,6 +244,7 @@ parse_cmdline_opts(
 		opt_ipv6 = true;
 		break;
 	    case 'b':
+                /* huh?? */
 		break;
 	    case 'c':
 		if (ntp_optarg != NULL)
@@ -325,6 +326,7 @@ parse_cmdline_opts(
 		nofork = true;
 		break;
 	    case 'r':
+                /* huh? */
 		if (ntp_optarg != NULL)
 		{
 		    double tmp;
@@ -700,9 +702,21 @@ ntpdmain(
 	while ((op = ntp_getopt_long(argc, argv, ALL_OPTIONS,
 				     longoptions, NULL)) != -1) {
 	    switch (op) {
+            case '4':
+            case '6':
+            case 'c':
+            case 'd':
+            case 'D':
+                /* handled elsewhere */
+                break;
 	    case 'f':
 		stats_config(STATS_FREQ_FILE, driftfile);
 		break;
+            case 'g':
+            case 'h':
+            case 'i':
+                /* handled elsewhere */
+                break;
 	    case 'I':
 		if (ntp_optarg != NULL)
 	        {
@@ -718,9 +732,21 @@ ntpdmain(
 		if (ntp_optarg != NULL)
 			getauthkeys(ntp_optarg);
 		break;
+            case 'l':
+            case 'L':
+            case 'm':
+            case 'n':
+            case 'N':
+                /* handled elsewhere */
+                break;
 	    case 'p':
 		stats_config(STATS_PID_FILE, pidfile);
 		break;
+            case 'P':
+            case 'q':
+            case 'R':
+                /* handled elsewhere */
+                break;
 	    case 's':
 		stats_config(STATS_STATSDIR, statsdir);
 		break;
@@ -738,6 +764,12 @@ ntpdmain(
 		    }
 	        }
 		break;
+	    case 'u':
+	    case 'U':
+	    case 'v':
+	    case 'w':
+                /* handled elsewhere */
+                break;
 	    case 'x':
 		loop_config(LOOP_MAX, 600);
 		break;
@@ -747,10 +779,11 @@ ntpdmain(
 		break;
 	    case 'Z':
 		if (ntp_optarg != NULL)
-			set_sys_var(ntp_optarg, strlen(ntp_optarg) + 1, (u_short) (RW | DEF));
+			set_sys_var(ntp_optarg, strlen(ntp_optarg) + 1,
+                                    (u_short) (RW | DEF));
                 break;
             default:
-		msyslog(LOG_ERR, "invalid op: %d", op);
+		msyslog(LOG_ERR, "Unknown option: %c", (char)op);
 		exit(1);
 	    }
 	}



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/88be996a1512141df8868d0ed569b8070866834e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/88be996a1512141df8868d0ed569b8070866834e
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170414/19f4a60c/attachment.html>


More information about the vc mailing list