[PATCH] adjust RPC function declarations to match Sun's (BZ 26686)

Martin Sebor msebor@gmail.com
Tue Oct 6 20:21:36 GMT 2020


On 10/6/20 5:13 AM, Florian Weimer wrote:
> * Martin Sebor via Libc-alpha:
> 
>> diff --git a/sunrpc/rpc/auth.h b/sunrpc/rpc/auth.h
>> index e01b077214..6302e6e83b 100644
>> --- a/sunrpc/rpc/auth.h
>> +++ b/sunrpc/rpc/auth.h
>> @@ -179,12 +179,15 @@ extern AUTH *authdes_pk_create (const char *, netobj *, u_int,
>>    *  Netname manipulating functions
>>    *
>>    */
>> -extern int getnetname (char *) __THROW;
>> -extern int host2netname (char *, const char *, const char *) __THROW;
>> -extern int user2netname (char *, const uid_t, const char *) __THROW;
>> -extern int netname2user (const char *, uid_t *, gid_t *, int *, gid_t *)
>> -     __THROW;
>> -extern int netname2host (const char *, char *, const int) __THROW;
>> +extern int getnetname (char [MAXNETNAMELEN + 1]) __THROW;
>> +extern int host2netname (char [MAXNETNAMELEN + 1], const char *,
>> +			 const char *) __THROW;
>> +extern int user2netname (char [MAXNETNAMELEN + 1], const uid_t,
>> +			 const char *) __THROW;
>> +extern int netname2user (const char [MAXNETNAMELEN + 1], uid_t *, gid_t *,
>> +			 int *, gid_t *) __THROW;
>> +extern int netname2host (const char[MAXNETNAMELEN + 1], char *,
>> +			 const int);
> 
> I think for the read-only strings (the const arguments), you need to fix
> the implementation, not the public header.  It's perfectly fine to use
> these functions with shorter strings, I believe.

You're right.  I've changed the signatures in the definitions of these
last two functions instead.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-26686.diff
Type: text/x-patch
Size: 1628 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20201006/37c4e156/attachment.bin>


More information about the Libc-alpha mailing list