[Git][NTPsec/ntpsec][master] ntpd: do not mung argv. Fail on duplicate -u.

Gary E. Miller gitlab at mg.gitlab.com
Thu Jun 1 19:07:26 UTC 2017


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


Commits:
34c53c97 by Gary E. Miller at 2017-06-01T11:53:16-07:00
ntpd: do not mung argv.  Fail on duplicate -u.

- - - - -


1 changed file:

- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -351,7 +351,13 @@ parse_cmdline_opts(
                         char *gp;
 
 			droproot = true;
-			user = ntp_optarg;
+                        if ( user ) {
+			    fputs("ERROR: more than one -u given.\n",
+				  stderr);
+			    ntpd_usage();
+			    exit(1);
+                        }
+                        user = estrdup(ntp_optarg);
 
 			gp = strrchr(user, ':');
 			if (gp) {



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/34c53c9716de7f580cb3b5ba8029733c1a7ffeae

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/34c53c9716de7f580cb3b5ba8029733c1a7ffeae
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/20170601/c82a7ef3/attachment.html>


More information about the vc mailing list