From 7751b3b7ebbe473641047686373e32899e147f84 Mon Sep 17 00:00:00 2001 From: Henning Geinitz Date: Wed, 2 Jun 2004 18:38:28 +0000 Subject: [PATCH] Changed service name from "sane" to "sane-port". This is the IANA registered service name for port 6566 (bug #300758). --- backend/net.c | 6 +++--- doc/sane-net.man | 4 ++-- doc/saned.man | 12 +++++++----- frontend/saned.c | 10 +++++----- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/backend/net.c b/backend/net.c index 7100908a3..88467a58d 100644 --- a/backend/net.c +++ b/backend/net.c @@ -156,7 +156,7 @@ add_device (const char *name, Net_Device ** ndp) hints.ai_family = PF_INET; # endif /* ENABLE_IPV6 */ - error = getaddrinfo (name, "sane", &hints, &res); + error = getaddrinfo (name, "sane-port", &hints, &res); if (error) { error = getaddrinfo (name, NULL, &hints, &res); @@ -665,7 +665,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) #ifndef NET_USES_AF_INDEP DBG (2, "sane_init: determining sane service port\n"); - serv = getservbyname ("sane", "tcp"); + serv = getservbyname ("sane-port", "tcp"); if (serv) { @@ -675,7 +675,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) else { saned_port = htons (6566); - DBG (1, "sane_init: could not find `sane' service (%s); using default " + DBG (1, "sane_init: could not find `sane-port' service (%s); using default " "port %d\n", strerror (errno), ntohs (saned_port)); } #endif /* !NET_USES_AF_INDEP */ diff --git a/doc/sane-net.man b/doc/sane-net.man index 7d3ac2a13..10a732d57 100644 --- a/doc/sane-net.man +++ b/doc/sane-net.man @@ -77,7 +77,7 @@ and are contacted in addition to the hosts listed above. .PP For this backend to function properly, it is also necessary to define the -.B sane +.B sane-port service in .IR /etc/services . The @@ -85,7 +85,7 @@ The service should be defined using a line of the following form: .PP .RS -sane 6566/tcp # SANE network scanner daemon +sane-port 6566/tcp # SANE network scanner daemon .RE .PP .SH FILES diff --git a/doc/saned.man b/doc/saned.man index cf2868199..7d5ef91e9 100644 --- a/doc/saned.man +++ b/doc/saned.man @@ -1,4 +1,4 @@ -.TH saned 1 "29 Oct 2003" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" +.TH saned 1 "30 May 2004" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" .IX saned .SH NAME saned \- SANE network daemon @@ -92,7 +92,7 @@ support IPv6, check the documentation for your inetd daemon. The configuration line normally looks like this: .PP .RS -sane stream tcp nowait saned.saned @SBINDIR@/saned saned +sane-port stream tcp nowait saned.saned @SBINDIR@/saned saned .RE .PP However, if your system uses @@ -105,7 +105,7 @@ and use a line of the following form in instead: .PP .RS -sane stream tcp nowait saned.saned /usr/sbin/tcpd @SBINDIR@/saned +sane-port stream tcp nowait saned.saned /usr/sbin/tcpd @SBINDIR@/saned .RE .PP Note that both examples assume that there is a @@ -130,7 +130,7 @@ for xinetd.conf may be helpful: .br # network. .br -service sane +service sane-port .br { .br @@ -153,9 +153,11 @@ Finally, it is also necessary to add a line of the following form to .IR /etc/services : .PP .RS -sane 6566/tcp # SANE network scanner daemon +sane-port 6566/tcp # SANE network scanner daemon .RE .PP +The official IANA short name for port 6566 is "sane-port". The older name "sane" +is now deprecated. .SH "RESTRICTIONS" In addition to the control connection (port 6566) saned also uses a data diff --git a/frontend/saned.c b/frontend/saned.c index 268f5d8a2..d65bb145d 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -2074,7 +2074,7 @@ main (int argc, char *argv[]) DBG (DBG_WARN, "main: starting debug mode (level %d)\n", debug); DBG (DBG_DBG, - "main: trying to get port for service `sane' (getaddrinfo)\n"); + "main: trying to get port for service `sane-port' (getaddrinfo)\n"); memset (&hints, 0, sizeof (struct addrinfo)); @@ -2082,11 +2082,11 @@ main (int argc, char *argv[]) hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; - err = getaddrinfo (NULL, "sane", &hints, &res); + err = getaddrinfo (NULL, "sane-port", &hints, &res); if (err) { - DBG (DBG_WARN, "main: \"sane\" service unknown on your host; you should add\n"); - DBG (DBG_WARN, "main: sane 6566/tcp saned # SANE network scanner daemon\n"); + DBG (DBG_WARN, "main: \"sane-port\" service unknown on your host; you should add\n"); + DBG (DBG_WARN, "main: sane-port 6566/tcp saned # SANE network scanner daemon\n"); DBG (DBG_WARN, "main: to your /etc/services file (or equivalent). Proceeding anyway.\n"); err = getaddrinfo (NULL, "6566", &hints, &res); if (err) @@ -2326,7 +2326,7 @@ main (int argc, char *argv[]) DBG (DBG_DBG, "main: trying to get port for service `sane' (getservbyname)\n"); - serv = getservbyname ("sane", "tcp"); + serv = getservbyname ("sane-port", "tcp"); if (serv) { port = serv->s_port;