Skip to content

check for errno value EINTR after fgetpwent_r() failure missing #2009

@eriksjolund

Description

@eriksjolund

There is no check if errno has the value EINTR after a fgetpwent_r() faillure

crun/src/libcrun/utils.c

Lines 1462 to 1482 in 0d7ed80

for (;;)
{
struct passwd *ret_pw = NULL;
ret = fgetpwent_r (stream, &pwd, buf, buf_size, &ret_pw);
if (UNLIKELY (ret != 0))
{
if (errno != ERANGE)
goto error;
buf_size *= 2;
buf = xrealloc (buf, buf_size);
continue;
}
if (ret_pw && ret_pw->pw_uid == id)
{
setenv ("HOME", ret_pw->pw_dir, 1);
return 0;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions