diff options
author | Ron Yorston | 2012-04-28 17:04:19 +0200 |
---|---|---|
committer | Denys Vlasenko | 2012-04-28 17:04:19 +0200 |
commit | 576b1d3c417ddea79481063401837ec0bdb91658 (patch) | |
tree | 10ad0b85a5fa746442c3ad6e3607709f86d16aa6 /libbb/safe_gethostname.c | |
parent | 0c62f20454b55a932d59c50b7418b8b634a8a23f (diff) | |
download | busybox-576b1d3c417ddea79481063401837ec0bdb91658.zip busybox-576b1d3c417ddea79481063401837ec0bdb91658.tar.gz |
sendmail: use host rather than NIS domain name for HELO
According to RFC 5321 the argument to HELO "contains the fully-qualified
domain name of the SMTP client" or its IP address if no FQDN is available.
BusyBox sendmail uses the NIS domain name instead which, in many cases,
is likely to be the default "(none)". [vda: yes, I checked my machine
and its uts.domainname was indeed "(none)"]
Using the host name is more likely to satisfy the intent of the RFC while
allowing the otherwise unused safe_getdomainname function to be removed.
Signed-off-by: Ron Yorston <rmy@tigress.co.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/safe_gethostname.c')
-rw-r--r-- | libbb/safe_gethostname.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c index bdb9896..cac99ae 100644 --- a/libbb/safe_gethostname.c +++ b/libbb/safe_gethostname.c @@ -50,25 +50,3 @@ char* FAST_FUNC safe_gethostname(void) uname(&uts); return xstrndup(!uts.nodename[0] ? "?" : uts.nodename, sizeof(uts.nodename)); } - -/* - * On success return the current malloced and NUL terminated domainname. - * On error return malloced and NUL terminated string "?". - * This is an illegal first character for a domainname. - * The returned malloced string must be freed by the caller. - */ -char* FAST_FUNC safe_getdomainname(void) -{ -#if defined(__linux__) -/* The field domainname of struct utsname is Linux specific. */ - struct utsname uts; - uname(&uts); - return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); -#else - /* We really don't care about people with domain names wider than most screens */ - char buf[256]; - int r = getdomainname(buf, sizeof(buf)); - buf[sizeof(buf)-1] = '\0'; - return xstrdup(r < 0 ? "?" : buf); -#endif -} |