From owner-freebsd-ports Fri Oct 13 8:10: 8 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0CB2A37B670 for ; Fri, 13 Oct 2000 08:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA78133; Fri, 13 Oct 2000 08:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131]) by hub.freebsd.org (Postfix) with ESMTP id EE87E37B66F for ; Fri, 13 Oct 2000 08:03:24 -0700 (PDT) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.11.0/8.11.0) with ESMTP id e9DF3Nq07878 for ; Fri, 13 Oct 2000 17:03:23 +0200 (MET DST) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail2.siemens.de (8.11.0/8.11.0) with ESMTP id e9DF3MG08721 for ; Fri, 13 Oct 2000 17:03:22 +0200 (MET DST) Received: (from localhost) by curry.mchp.siemens.de (8.11.1/8.11.1) id e9DF3Mb73609 for FreeBSD-gnats-submit@freebsd.org; Fri, 13 Oct 2000 17:03:22 +0200 (CEST) Message-Id: <200010131503.e9DF3Mk48055@curry.mchp.siemens.de> Date: Fri, 13 Oct 2000 17:03:22 +0200 (CEST) From: Andre Albsmeier To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/21957: [PATCH] optionally do not open TCP port in xfstt Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21957 >Category: ports >Synopsis: [PATCH] optionally do not open TCP port in xfstt >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 13 08:10:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.1.1-STABLE i386 >Organization: >Environment: All systems using the xfstt port >Description: When using xfstt there is always a TCP port created to serve clients. When running xfstt only to serve the localhost you don't need (and probably don't want) this since it communicates perfectly over unix domain sockets. >How-To-Repeat: run xfstt and then "netstat -a -f inet" and find the line with port 7101 >Fix: The path below adds an option --notcp. I haven't updated the manpage (only the --help output) but can do so if desired. It fits perfectly in x11-servers/Xfstt/files/patch-ae Note: I have sent this suggestion to sjc@debian.org who is listed as being responsible for xfstt in the distfile. I have also sent it to the maintainer but both didn't respond. Anyway, I have now made this PR since others might be interested in it or even someone likes to commit it to the ports tree. --- xfstt.cpp.ORI Tue Sep 26 15:57:32 2000 +++ xfstt.cpp Tue Sep 26 16:26:22 2000 @@ -73,6 +73,7 @@ char* fontdir = TTFONTDIR; char* cachedir = TTCACHEDIR; int defaultres = 0; +int NoTCP = 0; uid_t newuid = (uid_t)(-2); gid_t newgid = (uid_t)(-2); @@ -95,6 +96,7 @@ printf( "\t--sync put ttf-fonts in \"%s\" in database\n", fontdir); printf( "\t--gslist print ghostscript style ttf fontlist\n "); printf( "\t--port change port number from default 7101\n"); + printf( "\t--notcp don't open TCP socket, use unix domain only\n"); printf( "\t--dir use other font directory than "TTFONTDIR"\n"); printf( "\t--cache use other font cache directory than "TTCACHEDIR"\n"); printf( "\t--res force default resolution to this value\n"); @@ -654,7 +656,7 @@ listen( sd_unix, 1); // only one connection } - if( !sd_inet) { + if( !NoTCP && !sd_inet) { // prepare inet connection sd_inet = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP); @@ -670,7 +672,8 @@ fd_set sdlist; FD_ZERO( &sdlist); FD_SET( sd_unix, &sdlist); - FD_SET( sd_inet, &sdlist); + if( !NoTCP ) + FD_SET( sd_inet, &sdlist); int maxsd = (sd_inet > sd_unix) ? sd_inet : sd_unix; select( maxsd+1, &sdlist, 0L, 0L, 0L); @@ -678,7 +681,7 @@ unsigned int saLength = sizeof(struct sockaddr); if( FD_ISSET( sd_unix, &sdlist)) sd = accept( sd_unix, (struct sockaddr*)&s_unix, &saLength); - else if( FD_ISSET( sd_inet, &sdlist)) + else if( !NoTCP && FD_ISSET( sd_inet, &sdlist)) sd = accept( sd_inet, (struct sockaddr*)&s_inet, &saLength); dprintf2( "accept( saLength = %d) = %d\n", saLength, sd); @@ -1606,6 +1609,8 @@ inetdConnection = 1; } else if( !strcmp( argv[i], "--multi")) { multiConnection = 1; + } else if( !strcmp( argv[i], "--notcp")) { + NoTCP = 1; } else if( !strcmp( argv[i], "--once")) { multiConnection = 0; } else if( !strcmp( argv[i], "--unstrap")) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message