Fix password agent not being threadsafe by using reentrant functions.
Details
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. |