Describe the semantics of the sgetpwnam() helper function

in the comment above it so that nobody will save pointers
returned inside "struct passwd" across the calls to the function.
This commit is contained in:
Yaroslav Tykhiy 2004-10-30 16:11:15 +00:00
parent cf181f3b71
commit c29b9b4797

View File

@ -934,6 +934,9 @@ sgetsave(char *s)
* Save the result of a getpwnam. Used for USER command, since
* the data returned must not be clobbered by any other command
* (e.g., globbing).
* NB: The data returned by sgetpwnam() will remain valid until
* the next call to this function. Its difference from getpwnam()
* is that sgetpwnam() is known to be called from ftpd code only.
*/
static struct passwd *
sgetpwnam(char *name)