This revision was automatically updated to reflect the committed changes.
Closed by commit rS298385: dhclient: Log a warning instead of bailing upon 
"illegal" options (authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D5853?vs=14915&id=15413#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5853?vs=14915&id=15413

REVISION DETAIL
  https://reviews.freebsd.org/D5853

AFFECTED FILES
  head/sbin/dhclient/dhclient.c

CHANGE DETAILS
  diff --git a/head/sbin/dhclient/dhclient.c b/head/sbin/dhclient/dhclient.c
  --- a/head/sbin/dhclient/dhclient.c
  +++ b/head/sbin/dhclient/dhclient.c
  @@ -2275,6 +2275,17 @@
   {
        int i, j, namelen;
   
  +     /* No `` or $() command substitution allowed in environment values! */
  +     for (j=0; j < strlen(value); j++)
  +             switch (value[j]) {
  +             case '`':
  +             case '$':
  +                     warning("illegal character (%c) in value '%s'",
  +                         value[j], value);
  +                     /* Ignore this option */
  +                     return;
  +             }
  +
        namelen = strlen(name);
   
        for (i = 0; client->scriptEnv[i]; i++)
  @@ -2311,16 +2322,6 @@
            strlen(value) + 1);
        if (client->scriptEnv[i] == NULL)
                error("script_set_env: no memory for variable assignment");
  -
  -     /* No `` or $() command substitution allowed in environment values! */
  -     for (j=0; j < strlen(value); j++)
  -             switch (value[j]) {
  -             case '`':
  -             case '$':
  -                     error("illegal character (%c) in value '%s'", value[j],
  -                         value);
  -                     /* not reached */
  -             }
        snprintf(client->scriptEnv[i], strlen(prefix) + strlen(name) +
            1 + strlen(value) + 1, "%s%s=%s", prefix, name, value);
   }

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: sepherosa_gmail.com, network, secteam, delphij, glebius, adrian, 
honzhan_microsoft.com, howard0su_gmail.com, decui_microsoft.com, 
freebsd-net-list, pkelsey, gnn, jhb
Cc: sbruno
diff --git a/head/sbin/dhclient/dhclient.c b/head/sbin/dhclient/dhclient.c
--- a/head/sbin/dhclient/dhclient.c
+++ b/head/sbin/dhclient/dhclient.c
@@ -2275,6 +2275,17 @@
 {
 	int i, j, namelen;
 
+	/* No `` or $() command substitution allowed in environment values! */
+	for (j=0; j < strlen(value); j++)
+		switch (value[j]) {
+		case '`':
+		case '$':
+			warning("illegal character (%c) in value '%s'",
+			    value[j], value);
+			/* Ignore this option */
+			return;
+		}
+
 	namelen = strlen(name);
 
 	for (i = 0; client->scriptEnv[i]; i++)
@@ -2311,16 +2322,6 @@
 	    strlen(value) + 1);
 	if (client->scriptEnv[i] == NULL)
 		error("script_set_env: no memory for variable assignment");
-
-	/* No `` or $() command substitution allowed in environment values! */
-	for (j=0; j < strlen(value); j++)
-		switch (value[j]) {
-		case '`':
-		case '$':
-			error("illegal character (%c) in value '%s'", value[j],
-			    value);
-			/* not reached */
-		}
 	snprintf(client->scriptEnv[i], strlen(prefix) + strlen(name) +
 	    1 + strlen(value) + 1, "%s%s=%s", prefix, name, value);
 }

_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to