Re: git: 7e49aa86a282 - main - ifconfig(8): Teach ifconfig to attach and run itself in a jail

From: Steffen Nurpmeso <steffen_at_sdaoden.eu>
Date: Tue, 23 May 2023 22:03:40 UTC
Hello.

Hm, from only looking at the mailed diff, and without real
knowledge of getopt(3) (i "always" used my own thing) ...

Li-Wen Hsu wrote in
 <202305232056.34NKuLHU059109@gitrepo.freebsd.org>:
 ...
 |URL: https://cgit.FreeBSD.org/src/commit/?id=7e49aa86a2824e76e9d9becf61d\
 |b12066bc0d79d
 |
 |commit 7e49aa86a2824e76e9d9becf61db12066bc0d79d
 |Author:     Yan Ka Chiu <nyan@myuji.xyz>
 |AuthorDate: 2023-05-23 20:39:22 +0000
 |Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
 |CommitDate: 2023-05-23 20:39:22 +0000
 |
 |    ifconfig(8): Teach ifconfig to attach and run itself in a jail
 ...

[cool thing, by the way!]

  ...
 |-     strlcpy(options, "G:adf:klmnuv", sizeof(options));
 |+     strlcpy(options, "G:adf:j:klmnuv", sizeof(options));
 ...
 |+             case 'j':
 |+#ifdef JAIL
 |+                     if (optarg == NULL)
 |+                             usage();

... i think for "j:" getopt(3) guarantees 'j' has an argument?

 |+                     args->jail_name = optarg;
 ...

Ciao!

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
|~~
|..and in spring, hear David Leonard sing..
|
|The black bear,          The black bear,
|blithely holds his own   holds himself at leisure
|beating it, up and down  tossing over his ups and downs with pleasure
|~~
|Farewell, dear collar bear