Subject: bin/17323: pkg_add uses hardcoded '/usr/bin/ftp' command
To: None <>
From: Stoned Elipot <>
List: netbsd-bugs
Date: 06/19/2002 14:02:01
>Number:         17323
>Category:       bin
>Synopsis:       pkg_add uses hardcoded '/usr/bin/ftp' command
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 19 05:03:00 PDT 2002
>Originator:     Stoned Elipot
>Release:        -current sources used under Solaris 8
SCRIPT, Paris VII University, France
System: SunOS voyager 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-60

pkg_add (usr.sbin/pkg_install/lib/ftpio.c in fact) uses hardcoded '/usr/bin/ftp'
for binary packages retrieval but it expects it to be lukemftp.

Install zoularis and try to do pkg_add SOMEURLTOABINARYPKG...
The following patches add FTP_CMD and FTP_FULLPATHNAME support in the spirit
of the pre-existing TAR_CMD and TAR_FULLPATHNAME.
Under Solaris those are set from to 'ftp' and
'${ZOULARISBASE}/bin/${FTP_CMD}'. Default values are set in lib/lib.h.

While here LOCALBASE in is set to '/usr/pkg' which is now
the default for Solaris (see pkgsrc/mk/

RCS file: /cvsroot/basesrc/usr.sbin/pkg_install/,v
retrieving revision 1.17
diff -u -r1.17
---	2002/06/10 09:14:26	1.17
+++	2002/06/19 10:19:35
@@ -22,11 +22,14 @@
 CHGRP?= /usr/bin/chgrp
 .elif ${OPSYS} == "SunOS"
-LOCALBASE?= /usr/local
+LOCALBASE?= /usr/pkg
 TAR_CMD?= tar
+FTP_CMD?= ftp
 CHMOD?= /usr/bin/chmod
 CHOWN?= /usr/bin/chown
cvs server: Diffing add
cvs server: Diffing admin
cvs server: Diffing create
cvs server: Diffing delete
cvs server: Diffing info
cvs server: Diffing lib
Index: lib/ftpio.c
RCS file: /cvsroot/basesrc/usr.sbin/pkg_install/lib/ftpio.c,v
retrieving revision 1.37
diff -u -r1.37 ftpio.c
--- ftpio.c	2002/06/10 09:14:28	1.37
+++ ftpio.c	2002/06/19 10:19:36
@@ -297,7 +297,7 @@
 	    if (Verbose)
 		    fprintf(stderr, "ftp -detv %s\n", base);
-	    rc1 = execl("/usr/bin/ftp", "ftp", "-detv", base, NULL);
+	    rc1 = execl(FTP_FULLPATHNAME, FTP_CMD, "-detv", base, NULL);
 	    warn("setupCoproc: execl() failed");
Index: lib/lib.h
RCS file: /cvsroot/basesrc/usr.sbin/pkg_install/lib/lib.h,v
retrieving revision 1.41
diff -u -r1.41 lib.h
--- lib.h	2002/06/10 09:14:28	1.41
+++ lib.h	2002/06/19 10:19:37
@@ -66,6 +66,16 @@
 #define TAR_FULLPATHNAME	"/usr/bin/tar"
+/* Define ftp as a string, in case the ftp client is called something else */
+#ifndef FTP_CMD
+#define FTP_CMD "ftp"
+/* Full path name of FTP_CMD */
+#define FTP_FULLPATHNAME	"/usr/bin/ftp"
 /* Where we put logging information by default, else ${PKG_DBDIR} if set */
 #ifndef DEF_LOG_DIR
 #define DEF_LOG_DIR		"/var/db/pkg"