aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2004-10-30 16:11:15 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2004-10-30 16:11:15 +0000
commitc29b9b47976dc28c3824de9dbe74a11a1635d13b (patch)
tree25d4611fbb7fa4696030663a69e78222ed4273f7 /libexec
parentcf181f3b7119247304d39c2e4aab69d4fb54511f (diff)
downloadsrc-c29b9b47976dc28c3824de9dbe74a11a1635d13b.tar.gz
src-c29b9b47976dc28c3824de9dbe74a11a1635d13b.zip
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.
Notes
Notes: svn path=/head/; revision=137076
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 10e438787b36..fdcb76e0edeb 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -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)