]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Do not allow use `create` keyword as hostname when ifconfig(8) is invoked
authorAndrey V. Elsukov <ae@FreeBSD.org>
Sun, 21 Oct 2018 14:40:45 +0000 (14:40 +0000)
committerAndrey V. Elsukov <ae@FreeBSD.org>
Sun, 21 Oct 2018 14:40:45 +0000 (14:40 +0000)
commit5c88595e07a4c311931be2acb5017bb45a7f5e46
tree6db14000e0015a07a9d6f88eb00778c2e63db1a8
parentea7fdebe801f22674e8c864823ed4685e54bbddb
Do not allow use `create` keyword as hostname when ifconfig(8) is invoked
for already existing interface.

It appeared, that ifconfig(8) assumes `create` keyword as hostname and
tries to resolve it, when `ifconfig ifname create` invoked for already
existing interface. This can produce some unexpected results, when hostname
resolving has successfully happened. This patch adds check for such case.
When an interface is already exists, and create is only one argument,
return error message. But when there are some other arguments, just remove
create keyword from the arguments list.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17171
sbin/ifconfig/ifconfig.c