summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-04-27 22:51:52 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-04-27 22:51:52 +0000
commit1b11c13ec312f9f017cd364afb866f81fcec2462 (patch)
tree5c309bb8ab706488fd53415883079b24c514be60 /usr.bin
parenta7fe12b15241d64dfb725abb9a74b5fda6fd637a (diff)
remove uploading and macros support from install media; to save
some space discussed with theo, todd@, millert@ tested and looked over by sthen@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/cmds.c14
-rw-r--r--usr.bin/ftp/cmdtab.c14
-rw-r--r--usr.bin/ftp/domacro.c6
-rw-r--r--usr.bin/ftp/extern.h16
-rw-r--r--usr.bin/ftp/ftp.c4
-rw-r--r--usr.bin/ftp/ftp_var.h4
-rw-r--r--usr.bin/ftp/main.c4
-rw-r--r--usr.bin/ftp/util.c4
8 files changed, 57 insertions, 9 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index 7d5ebe2e75b..d050003c2dc 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.68 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: cmds.c,v 1.69 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
@@ -270,16 +270,19 @@ reput(int argc, char *argv[])
}
#endif /* !SMALL */
+#ifndef SMALL
void
put(int argc, char *argv[])
{
(void)putit(argc, argv, 0);
}
+#endif /* !SMALL */
/*
* Send a single file.
*/
+#ifndef SMALL
void
putit(int argc, char *argv[], int restartit)
{
@@ -342,10 +345,12 @@ usage:
if (oldargv1 != argv[1]) /* free up after globulize() */
free(argv[1]);
}
+#endif /* !SMALL */
/*
* Send multiple files.
*/
+#ifndef SMALL
void
mput(int argc, char *argv[])
{
@@ -514,6 +519,7 @@ usage:
(void)signal(SIGINT, oldintr);
mflag = 0;
}
+#endif /* !SMALL */
#ifndef SMALL
void
@@ -857,13 +863,13 @@ status(int argc, char *argv[])
epsv4bad ? " (disabled for this connection)" : "");
#ifndef SMALL
fprintf(ttyout, "Command line editing: %s.\n", onoff(editing));
-#endif /* !SMALL */
if (macnum > 0) {
fputs("Macros:\n", ttyout);
for (i=0; i<macnum; i++) {
fprintf(ttyout, "\t%s\n", macros[i].mac_name);
}
}
+#endif /* !SMALL */
code = 0;
}
@@ -1682,9 +1688,11 @@ disconnect(int argc, char *argv[])
cout = NULL;
connected = 0;
data = -1;
+#ifndef SMALL
if (!proxy) {
macnum = 0;
}
+#endif /* !SMALL */
}
void
@@ -2122,6 +2130,7 @@ syst(int argc, char *argv[])
(void)command("SYST");
}
+#ifndef SMALL
void
macdef(int argc, char *argv[])
{
@@ -2179,6 +2188,7 @@ macdef(int argc, char *argv[])
}
}
}
+#endif /* !SMALL */
/*
* Get size of file on remote machine
diff --git a/usr.bin/ftp/cmdtab.c b/usr.bin/ftp/cmdtab.c
index 71bf7441a44..b96a9004e26 100644
--- a/usr.bin/ftp/cmdtab.c
+++ b/usr.bin/ftp/cmdtab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmdtab.c,v 1.24 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: cmdtab.c,v 1.25 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: cmdtab.c,v 1.17 1997/08/18 10:20:17 lukem Exp $ */
/*
@@ -131,9 +131,13 @@ char empty[] = "";
struct cmd cmdtab[] = {
{ "!", H(shellhelp), 0, 0, 0, CMPL0 shell },
+#ifndef SMALL
{ "$", H(domachelp), 1, 0, 0, CMPL0 domacro },
+#endif /* !SMALL */
{ "account", H(accounthelp), 0, 1, 1, CMPL0 account},
+#ifndef SMALL
{ "append", H(appendhelp), 1, 1, 1, CMPL(lr) put },
+#endif /* !SMALL */
{ "ascii", H(asciihelp), 0, 1, 1, CMPL0 setascii },
{ "bell", H(beephelp), 0, 0, 0, CMPL0 setbell },
{ "binary", H(binaryhelp), 0, 1, 1, CMPL0 setbinary },
@@ -168,7 +172,9 @@ struct cmd cmdtab[] = {
{ "less", H(pagehelp), 1, 1, 1, CMPL(r) page },
{ "lpwd", H(lpwdhelp), 0, 0, 0, CMPL0 lpwd },
{ "ls", H(lshelp), 1, 1, 1, CMPL(rl) ls },
+#ifndef SMALL
{ "macdef", H(macdefhelp), 0, 0, 0, CMPL0 macdef },
+#endif /* !SMALL */
{ "mdelete", H(mdeletehelp), 1, 1, 1, CMPL(R) mdelete },
{ "mdir", H(mdirhelp), 1, 1, 1, CMPL(R) mls },
{ "mget", H(mgethelp), 1, 1, 1, CMPL(R) mget },
@@ -177,8 +183,10 @@ struct cmd cmdtab[] = {
{ "mode", H(modehelp), 0, 1, 1, CMPL0 setftmode },
{ "modtime", H(modtimehelp), 0, 1, 1, CMPL(r) modtime },
{ "more", H(pagehelp), 1, 1, 1, CMPL(r) page },
+#ifndef SMALL
{ "mput", H(mputhelp), 1, 1, 1, CMPL(L) mput },
{ "msend", H(mputhelp), 1, 1, 1, CMPL(L) mput },
+#endif /* !SMALL */
{ "newer", H(newerhelp), 1, 1, 1, CMPL(r) newer },
{ "nlist", H(nlisthelp), 1, 1, 1, CMPL(rl) ls },
{ "nmap", H(nmaphelp), 0, 0, 1, CMPL0 setnmap },
@@ -190,7 +198,9 @@ struct cmd cmdtab[] = {
{ "progress", H(progresshelp),0, 0, 0, CMPL0 setprogress },
{ "prompt", H(prompthelp), 0, 0, 0, CMPL0 setprompt },
{ "proxy", H(proxyhelp), 0, 0, 1, CMPL(c) doproxy },
+#ifndef SMALL
{ "put", H(sendhelp), 1, 1, 1, CMPL(lr) put },
+#endif /* !SMALL */
{ "pwd", H(pwdhelp), 0, 1, 1, CMPL0 pwd },
{ "quit", H(quithelp), 0, 0, 0, CMPL0 quit },
{ "quote", H(quotehelp), 1, 1, 1, CMPL0 quote },
@@ -208,7 +218,9 @@ struct cmd cmdtab[] = {
{ "rmdir", H(rmdirhelp), 0, 1, 1, CMPL(r) removedir },
{ "rstatus", H(rmtstatushelp),0, 1, 1, CMPL(r) rmtstatus },
{ "runique", H(runiquehelp), 0, 0, 1, CMPL0 setrunique },
+#ifndef SMALL
{ "send", H(sendhelp), 1, 1, 1, CMPL(lr) put },
+#endif /* !SMALL */
{ "sendport", H(porthelp), 0, 0, 0, CMPL0 setport },
{ "site", H(sitehelp), 0, 1, 1, CMPL0 site },
{ "size", H(sizecmdhelp), 1, 1, 1, CMPL(r) sizecmd },
diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c
index 40bd6122417..69013024023 100644
--- a/usr.bin/ftp/domacro.c
+++ b/usr.bin/ftp/domacro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: domacro.c,v 1.15 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: domacro.c,v 1.16 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: domacro.c,v 1.10 1997/07/20 09:45:45 lukem Exp $ */
/*
@@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
+#ifndef SMALL
+
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
@@ -142,3 +144,5 @@ TOP:
goto TOP;
}
}
+
+#endif /* !SMALL */
diff --git a/usr.bin/ftp/extern.h b/usr.bin/ftp/extern.h
index 7891c696512..fd6ec8b7bcc 100644
--- a/usr.bin/ftp/extern.h
+++ b/usr.bin/ftp/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.37 2009/04/26 21:26:03 martynas Exp $ */
+/* $OpenBSD: extern.h,v 1.38 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: extern.h,v 1.17 1997/08/18 10:20:19 lukem Exp $ */
/*
@@ -66,7 +66,9 @@
void abort_remote(FILE *);
void abortpt(int);
void abortrecv(int);
+#ifndef SMALL
void abortsend(int);
+#endif /* !SMALL */
void account(int, char **);
void alarmtimer(int);
int another(int *, char ***, const char *);
@@ -88,7 +90,9 @@ void deletecmd(int, char **);
void disconnect(int, char **);
void do_chmod(int, char **);
void do_umask(int, char **);
+#ifndef SMALL
void domacro(int, char **);
+#endif /* !SMALL */
char *domap(char *);
void doproxy(int, char **);
char *dotrans(char *);
@@ -113,14 +117,18 @@ void lostpeer(void);
void lpwd(int, char **);
void ls(int, char **);
void mabort(int);
+#ifndef SMALL
void macdef(int, char **);
+#endif /* !SMALL */
void makeargv(void);
void makedir(int, char **);
void mdelete(int, char **);
void mget(int, char **);
void mls(int, char **);
void modtime(int, char **);
+#ifndef SMALL
void mput(int, char **);
+#endif /* !SMALL */
char *onoff(int);
void newer(int, char **);
void page(int, char **);
@@ -132,8 +140,10 @@ void psabort(int);
void psummary(int);
void pswitch(int);
void ptransfer(int);
+#ifndef SMALL
void put(int, char **);
void putit(int, char **, int);
+#endif /* !SMALL */
void pwd(int, char **);
void quit(int, char **);
void quote(int, char **);
@@ -149,12 +159,16 @@ off_t remotesize(const char *, int);
time_t remotemodtime(const char *, int);
void removedir(int, char **);
void renamefile(int, char **);
+#ifndef SMALL
void reput(int, char **);
+#endif /* !SMALL */
void reset(int, char **);
void restart(int, char **);
void rmthelp(int, char **);
void rmtstatus(int, char **);
+#ifndef SMALL
void sendrequest(const char *, const char *, const char *, int);
+#endif /* !SMALL */
void setascii(int, char **);
void setbell(int, char **);
void setbinary(int, char **);
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index c1509e63b60..4842050c920 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.76 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: ftp.c,v 1.77 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -524,6 +524,7 @@ getreply(int expecteof)
}
}
+#ifndef SMALL
jmp_buf sendabort;
/* ARGSUSED */
@@ -822,6 +823,7 @@ abort:
if (bytes > 0)
ptransfer(0);
}
+#endif /* !SMALL */
jmp_buf recvabort;
diff --git a/usr.bin/ftp/ftp_var.h b/usr.bin/ftp/ftp_var.h
index 05990783b3e..ac5ec68981b 100644
--- a/usr.bin/ftp/ftp_var.h
+++ b/usr.bin/ftp/ftp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp_var.h,v 1.27 2008/07/08 21:07:57 martynas Exp $ */
+/* $OpenBSD: ftp_var.h,v 1.28 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: ftp_var.h,v 1.18 1997/08/18 10:20:25 lukem Exp $ */
/*
@@ -216,8 +216,10 @@ struct macel {
char *mac_end; /* end of macro in macbuf */
};
+#ifndef SMALL
int macnum; /* number of defined macros */
struct macel macros[16];
char macbuf[4096];
+#endif /* !SMALL */
FILE *ttyout; /* stdout or stderr, depending on interactive */
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index d16eadb8b45..32b78c18863 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.75 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.76 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -334,7 +334,9 @@ main(volatile int argc, char *argv[])
if (!retry_connect)
break;
if (!connected) {
+#ifndef SMALL
macnum = 0;
+#endif /* !SMALL */
fputs("Retrying...\n", ttyout);
sleep(retry_connect);
}
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c
index fb5e1a735bc..bc32c337552 100644
--- a/usr.bin/ftp/util.c
+++ b/usr.bin/ftp/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.60 2009/04/27 21:37:13 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.61 2009/04/27 22:51:51 martynas Exp $ */
/* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */
/*-
@@ -316,6 +316,7 @@ tryagain:
if (proxy)
return (1);
connected = -1;
+#ifndef SMALL
for (n = 0; n < macnum; ++n) {
if (!strcmp("init", macros[n].mac_name)) {
(void)strlcpy(line, "$init", sizeof line);
@@ -324,6 +325,7 @@ tryagain:
break;
}
}
+#endif /* SMALL */
return (1);
}