Subject: Re: bug#20979: ../lib/set-permissions.c:288:27: error: 'mode' undeclared

From: John David Anglin <[email-masked]>
Date: Sat, 4 Jul 2015 18:40:38 -0400

In this function, "mode" needs to be "ctx->mode" and "entries" needs to be "ctx->aclv_entries".
It then compiles okay.

Dave

On 2015-07-04, at 6:29 PM, John David Anglin wrote:

> We know have:
> 
>  CC       lib/set-permissions.o
> ../lib/set-permissions.c: In function 'context_aclv_from_mode':
> ../lib/set-permissions.c:307:34: error: 'mode' undeclared (first use in this function)
>   ctx->aclv_entries[0].a_perm = (mode >> 6) & 7;
>                                  ^
> ../lib/set-permissions.c:307:34: note: each undeclared identifier is reported only once for each function it appears in
> ../lib/set-permissions.c:319:38: error: 'entries' undeclared (first use in this function)
>   ret = aclsort (ctx->aclv_count, 1, entries);
>                                      ^
> 
> On 2015-07-04, at 2:10 PM, Paul Eggert wrote:
> 
>> John David Anglin wrote:
>>> The following error occurs building coreutils-8.24 on hppa2.0w-hp-hpux11.11 with gcc-5:
>>> 
>>>  CC       lib/set-permissions.o../lib/set-permissions.c: In function 'context_acl_from_mode':
>>> ../lib/set-permissions.c:288:27: error: 'mode' undeclared (first use in this function)
>>>   ctx->entries[0].mode = (mode >> 6) & 7;
>> ...
>> 
>> Thanks for reporting that.  There are some obvious typos in the recent ACL-related patches when compiled on HP-UX.  I installed the attached patch into gnulib; can you please give it a try on coreutils 8.24?  I don't have access to an HP-UX box to test it myself.
>> 
>> I'll CC: this to Andreas Gruenbacher, the author of the recent patches, to give him a heads-up.
>> 
>> <0001-file-has-acl-acl-permissions-fix-HP-UX-typos.patch>
> 
> 
>  CC       lib/set-permissions.o
> ../lib/set-permissions.c: In function 'context_aclv_from_mode':
> ../lib/set-permissions.c:307:34: error: 'mode' undeclared (first use in this function)
>   ctx->aclv_entries[0].a_perm = (mode >> 6) & 7;
>                                  ^
> ../lib/set-permissions.c:307:34: note: each undeclared identifier is reported only once for each function it appears in
> ../lib/set-permissions.c:319:38: error: 'entries' undeclared (first use in this function)
>   ret = aclsort (ctx->aclv_count, 1, entries);
>                                      ^
> 
> --
> John David Anglin	[email-masked]
> 
> 
> 
> 

--
John David Anglin	[email-masked]