Skip to content

getpwent: infinite loop because of inverted result_status in _nss_exec_getpwent_r_locked #4

@alexburt

Description

@alexburt

Hello,
What is a purpose of invertion of result_status in _nss_exec_getpwent_r_locked ?

NSS_STATUS_SUCCESS is 1.
From the _nss_exec_getpwent_r_locked return will be NSS_STATUS_SUCCESS even if it get error from nss_exec_script_long.
That may cause infinite loop when getpwent is used to enumerate users because getpwent will always return pointer instead of 0.

https://github.com/tests-always-included/libnss_exec/blob/master/nss_exec-passwd.c#L86

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