acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] use thread-safe getpwuid_r and getgrgid_r


From: Mike Frysinger
Subject: Re: [PATCH 2/4] use thread-safe getpwuid_r and getgrgid_r
Date: Wed, 24 Jan 2024 08:51:11 -0500

On 24 Jan 2024 13:06, Pavel Simovec wrote:
> --- a/include/misc.h
> +++ b/include/misc.h
>  
> +char *
> +user_name(uid_t uid, int numeric);
> +char *
> +group_name(gid_t uid, int numeric);

keep them on one line please

> --- a/libacl/__acl_to_any_text.c
> +++ b/libacl/__acl_to_any_text.c
> @@ -158,9 +158,10 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char 
> *text_p, ssize_t size,
>                       if (type == ACL_USER) {
>                               if (options & TEXT_NUMERIC_IDS)
>                                       str = NULL;
> -                             else
> -                                     str = __acl_quote(user_name(
> -                                             entry_obj_p->eid.qid), ":, 
> \t\n\r");
> +                             else {
> +                                     un = user_name(entry_obj_p->eid.qid, 0);
> +                                     str = __acl_quote(un, ":, \t\n\r");
> +                             }

if the else case gains braces, please put them on the prior if parts too.

> --- /dev/null
> +++ b/libmisc/user_group.c
>
> +char *
> +user_name(uid_t uid, int numeric)
> +
> +char *
> +group_name(gid_t gid, int numeric)

we have this in a few other places, but we shouldn't make it worse.
we have symbol visibility to control namespace pollution with shared
libs, but this doesn't work for static libs.  please use `__acl_`
prefix for internal symbols that we don't want to export.
-mike

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]