Page MenuHomeFreeBSD

nscd step4
Needs ReviewPublic

Authored by david_crossfamilyweb.com on Oct 16 2024, 2:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 27, 8:39 PM
Unknown Object (File)
Mon, Feb 23, 11:35 PM
Unknown Object (File)
Thu, Feb 19, 11:51 AM
Unknown Object (File)
Fri, Feb 13, 10:44 AM
Unknown Object (File)
Jan 19 2026, 3:25 PM
Unknown Object (File)
Jan 17 2026, 1:00 AM
Unknown Object (File)
Jan 14 2026, 9:24 AM
Unknown Object (File)
Jan 8 2026, 10:50 AM
Subscribers

Details

Reviewers
markj
Summary

Fix password agent not being threadsafe by using reentrant functions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

usr.sbin/nscd/agents/passwd.c
74

Please remove the extra newline before each return statement. It's inconsistent with the code styles used elsewhere in nscd (and in FreeBSD generally).

89

It'd be a bit more efficient to use realloc() in these loops.

96

This assignment to errno should happen right before returning from this function. It may get clobbered by free(), for example.

235
283

There should be a newline after variable declarations, and here there's an extra newline before the declaration.

This one looks good to me, I just made one suggestion that should simplify error handling a bit.

usr.sbin/nscd/agents/passwd.c
240

A suggestion which would simplify this patch a bit: don't use errno to pass error numbers between these internal subroutines. Instead, add an extra parameter of type int * to getpw(), and modify getpw() to use it to return an error number instead of (ab)using errno.