diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2001-08-25 10:14:13 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2001-08-25 10:14:13 +0000 |
commit | 0e61002d04e343a2cf1763fb32e27bef65ce1073 (patch) | |
tree | 7e39a6c21046df1f2eb64d2efff4206f0b48c1e0 /mail/smtpclient/files/patch-smtpclient_main_c | |
parent | Clean empty etc directories. (diff) |
Add smtpclient-1.0.0
This program is a minimal SMTP client that takes an email
message body and passes it on to a SMTP server (default is the
MTA on the local host). Since it is completely self-supporting,
it is especially suitable for use in restricted environments.
Obtained from: OpenBSD
Notes
Notes:
svn path=/head/; revision=46874
Diffstat (limited to 'mail/smtpclient/files/patch-smtpclient_main_c')
-rw-r--r-- | mail/smtpclient/files/patch-smtpclient_main_c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/smtpclient/files/patch-smtpclient_main_c b/mail/smtpclient/files/patch-smtpclient_main_c new file mode 100644 index 000000000000..4d2a7838895a --- /dev/null +++ b/mail/smtpclient/files/patch-smtpclient_main_c @@ -0,0 +1,31 @@ +--- smtpclient_main.c.orig Wed Aug 1 15:25:22 2001 ++++ smtpclient_main.c Wed Aug 1 15:33:07 2001 +@@ -86,7 +86,7 @@ void log(char *str, ...) + char buf[1024]; + + va_start(ap, str); +- vsprintf(buf, str, ap); ++ vsnprintf(buf, 1024, str, ap); + if (usesyslog) + syslog(LOG_ERR, "SMTPclient: %s", buf); + else +@@ -395,16 +395,16 @@ int main(int argc, char **argv) + log("%s: unknown host\n", my_name); + exit(1); + } +- strcpy(my_name, hp->h_name); ++ strlcpy(my_name, hp->h_name, sizeof(my_name)); + + /* + * Determine from address. + */ + if (from_addr == NULL) { + if ((pwd = getpwuid(getuid())) == 0) { +- sprintf(buf, "userid-%d@%s", getuid(), my_name); ++ snprintf(buf, (sizeof(buf) - 1), "userid-%d@%s", getuid(), my_name); + } else { +- sprintf(buf, "%s@%s", pwd->pw_name, my_name); ++ snprintf(buf, (sizeof(buf) - 1), "%s@%s", pwd->pw_name, my_name); + } + from_addr = strdup(buf); + } |