From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Cc: ltp-list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] lib/tst_uid_gid.c: fix checking return value errors about getpwuid_r/getgrgid_r
Date: Thu, 06 Mar 2014 16:36:21 +0400 [thread overview]
Message-ID: <53186BC5.7050406@oracle.com> (raw)
In-Reply-To: <1394105651.2061.12.camel@G08JYZSD130126>
On 06.03.2014 15:34, Zeng Linggang wrote:
> On Thu, 2014-02-20 at 11:53 +0400, Stanislav Kholmanskikh wrote:
>> Hi!
>>
>> On 02/20/2014 06:10 AM, Zeng Linggang wrote:
>>> When we call getgrgid_r() to verify whether the corresponding gid is
>>> existent, if not, getgrgid_r() will return 0 or ENOENT or ESRCH or
>>> EBADF or EPERM...
>>>
>>> But tst_get_unused_gid() only check return value 0, this is not complete.
>>> For example, if the gid is not existent, getgrgid_r() in RHEL7 beta will
>>> return ENOENT, which will cause tst_get_unused_gid failed incorrectly.
>>> This is the same for getpwuid_r().
>>
>> Thank you.
>>
>> I was puzzled by these two sentences in the getgrgid_r man (RHEL6):
>> "If no matching group record was found, these functions return 0
>> and store NULL in *result. In case of error, an error number is
>> returned, and NULL is stored in *result."
>>
>> Maybe update the man page according with
>> http://www.gnu.org/software/libc/manual/html_node/Lookup-Group.html. I
>> think that there the return values are described more clear.
>>
>> What do you think?
>>
>
> Hi,
> So sorry for the late response.
> I think there is a little different in RHEL7.0Beta.
> If no gid was found, it returned ENOENT in RHEL7.0Beta.
>
Yes, I got this difference at that time:)
I don't have any objections/comments about your patch. I just wanted to
mention one logic "collision" (for me) in the man page. After reading
this page it's not clear whether we should treat the "no matching group
record" situation as a special case or as one of possible errors. But
glibc documentation makes everything clear.
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-03-06 12:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 2:10 [LTP] [PATCH] lib/tst_uid_gid.c: fix checking return value errors about getpwuid_r/getgrgid_r Zeng Linggang
2014-02-20 7:53 ` Stanislav Kholmanskikh
2014-03-06 11:34 ` Zeng Linggang
2014-03-06 12:36 ` Stanislav Kholmanskikh [this message]
2014-03-10 8:13 ` Zeng Linggang
2014-03-13 8:33 ` Zeng Linggang
[not found] ` <1396944482.2100.1.camel@G08JYZSD130126>
2014-04-08 11:19 ` chrubis
[not found] ` <5344069B.8010101@oracle.com>
2014-04-08 14:49 ` chrubis
2014-04-08 15:52 ` chrubis
[not found] ` <5344E5C8.3070306@oracle.com>
2014-04-09 13:08 ` chrubis
[not found] ` <53454939.2030704@oracle.com>
2014-04-09 13:23 ` chrubis
2014-04-09 14:39 ` chrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53186BC5.7050406@oracle.com \
--to=stanislav.kholmanskikh@oracle.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=zenglg.jy@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox