lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Feb 2018 09:34:15 -0700
From:   David Ahern <dsahern@...il.com>
To:     Sabrina Dubroca <sd@...asysnail.net>, netdev@...r.kernel.org
Cc:     sbrivio@...hat.com, serhe.popovych@...il.com
Subject: Re: [PATCH iproute2-next v2] ip link: add support to display extended
 tun attributes

On 2/20/18 5:43 AM, Sabrina Dubroca wrote:
> Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
> Reviewed-by: Stefano Brivio <sbrivio@...hat.com>
> ---
> v2: define print_onoff to print flags, fix checkpatch warnings, drop
> header changes
> 
>  ip/iptuntap.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)

applied to iproute2-next.

> 
> diff --git a/ip/iptuntap.c b/ip/iptuntap.c
> index 4628db2832b4..07253870472f 100644
> --- a/ip/iptuntap.c
> +++ b/ip/iptuntap.c
> @@ -469,3 +469,89 @@ int do_iptuntap(int argc, char **argv)
>  		*argv);
>  	exit(-1);
>  }
> +
> +static void print_owner(FILE *f, uid_t uid)
> +{
> +	struct passwd *pw = getpwuid(uid);
> +
> +	if (pw)
> +		fprintf(f, "user %s ", pw->pw_name);
> +	else
> +		fprintf(f, "user %u ", uid);
> +}
> +
> +static void print_group(FILE *f, gid_t gid)
> +{
> +	struct group *group = getgrgid(gid);
> +
> +	if (group)
> +		fprintf(f, "group %s ", group->gr_name);
> +	else
> +		fprintf(f, "group %u ", gid);
> +}
> +


Those helpers can be re-used to make 'ip tuntap show' better too.

Powered by blists - more mailing lists