[SSSD] [PATCH] Fix segmentation fault in test_io.

Abhishek Singh abhishekkumarsingh.cse at gmail.com
Tue Apr 16 13:57:20 UTC 2013


Changes done. Please check the patch.

thanks,


On Tue, Apr 16, 2013 at 4:19 PM, Jakub Hrozek <jhrozek at redhat.com> wrote:

> On Mon, Apr 15, 2013 at 05:46:25PM +0530, Abhishek Singh wrote:
> > Hi Jakub,
> >
> > I am bit puzzled here, since all the test files get created/destroyed
> under
> > TEST_DIR and runs well(absolute paths are already provided), so why do we
> > need to change current working dir to TEST_DIR (use of tests_set_cwd)
> > before running test?
> >
>
> Mostly as an additional precation or in case the tests had some kind of
> side-effect.
>
> >
> > On Mon, Apr 15, 2013 at 3:58 PM, Jakub Hrozek <jhrozek at redhat.com>
> wrote:
> >
> > > On Sat, Apr 13, 2013 at 02:38:45AM +0530, Abhishek Singh wrote:
> > > > Please check this patch, previous patch contained extra changes
> which is
> > > > not required.
> > > >
> > >
> > > I would prefer if the src/conf_macros.m4 and src/tests/common.c changes
> > > were a separate patch (with attribution set to Lukas) But more
> importantly:
> > >
> > > @@ -113,8 +121,8 @@ void test_sss_openat_cloexec_success(void **state)
> > >      char path[PATH_MAX] = {'\0'};
> > >      const char *relativepath;
> > >
> > > -    relativepath = strchr(get_filepath(path), 't');
> > >      dir_fd = dirfd((DIR *)*state);
> > > +    relativepath = get_filepath(path) + strlen(TEST_DIR) + 1;
> > >
> > > This is still guesswork, can you simply use basename() here? See man 3
> > > basename,
> > > I think you could easily call basename() on the return value of
> > > get_filepath().
> > >
> > > Also the test still doesn't call tests_set_cwd(). It should call it
> right
> > > before
> > > calling run_tests, I think.
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130416/3cc0f780/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-segmentation-fault-in-test_io.patch
Type: application/octet-stream
Size: 2412 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130416/3cc0f780/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-segmentation-fault-in-test_io.patch
Type: application/octet-stream
Size: 2947 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130416/3cc0f780/attachment-0001.obj>


More information about the sssd-devel mailing list