X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fstatus.c;fp=etc%2Fafpd%2Fstatus.c;h=20db0d5a1d7a4d07c3f210c4d950c070ef19687c;hb=49cddcbb46f480c8bffa074822702be2617fc8e4;hp=86ea243ae6ed675b0a559b7eaa3fc2c92da46004;hpb=50bb4258fcc91a19f39989fbe727ffd93fbe2c2f;p=netatalk.git diff --git a/etc/afpd/status.c b/etc/afpd/status.c index 86ea243a..20db0d5a 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -491,7 +491,6 @@ static size_t status_utf8servername(char *data, int *nameoffset, const DSI *dsi _U_, const struct afp_options *options) { - char *Obj, *Type, *Zone; uint16_t namelen; size_t len; char *begin = data; @@ -501,20 +500,15 @@ static size_t status_utf8servername(char *data, int *nameoffset, offset = ntohs(offset); data += offset; - /* FIXME: - * What is the valid character range for an nbpname? - * - * Apple's server likes to use the non-qualified hostname - * This obviously won't work very well if multiple servers are running - * on the box. - */ + LOG(log_info, logtype_afpd, "servername: %s", options->hostname); - /* extract the obj part of the server */ - Obj = options->hostname; - if ((size_t) -1 == (len = convert_string ( - options->unixcharset, CH_UTF8_MAC, - Obj, -1, data+sizeof(namelen), maxstatuslen-offset )) ) { - LOG ( log_error, logtype_afpd, "Could not set utf8 servername"); + if ((len = convert_string(options->unixcharset, + CH_UTF8_MAC, + options->hostname, + -1, + data + sizeof(namelen), + maxstatuslen-offset)) == (size_t)-1) { + LOG(log_error, logtype_afpd, "Could not set utf8 servername"); /* set offset to 0 */ memset(begin + *nameoffset, 0, sizeof(offset));