Add extra arguments to recvrequest.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3805 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -428,133 +428,131 @@ mabort(int signo)
|
|||||||
void
|
void
|
||||||
mput(int argc, char **argv)
|
mput(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
RETSIGTYPE (*oldintr)();
|
RETSIGTYPE (*oldintr)();
|
||||||
int ointer;
|
int ointer;
|
||||||
char *tp;
|
char *tp;
|
||||||
|
|
||||||
if (argc < 2 && !another(&argc, &argv, "local-files")) {
|
if (argc < 2 && !another(&argc, &argv, "local-files")) {
|
||||||
printf("usage: %s local-files\n", argv[0]);
|
printf("usage: %s local-files\n", argv[0]);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mname = argv[0];
|
mname = argv[0];
|
||||||
mflag = 1;
|
mflag = 1;
|
||||||
oldintr = signal(SIGINT, mabort);
|
oldintr = signal(SIGINT, mabort);
|
||||||
setjmp(jabort);
|
setjmp(jabort);
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
char *cp, *tp2, tmpbuf[MaxPathLen];
|
char *cp, *tp2, tmpbuf[MaxPathLen];
|
||||||
|
|
||||||
while ((cp = remglob(argv,0)) != NULL) {
|
while ((cp = remglob(argv,0)) != NULL) {
|
||||||
if (*cp == 0) {
|
if (*cp == 0) {
|
||||||
mflag = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (mflag && confirm(argv[0], cp)) {
|
|
||||||
tp = cp;
|
|
||||||
if (mcase) {
|
|
||||||
while (*tp && !islower(*tp)) {
|
|
||||||
tp++;
|
|
||||||
}
|
|
||||||
if (!*tp) {
|
|
||||||
tp = cp;
|
|
||||||
tp2 = tmpbuf;
|
|
||||||
while ((*tp2 = *tp) != '\0') {
|
|
||||||
if (isupper(*tp2)) {
|
|
||||||
*tp2 = 'a' + *tp2 - 'A';
|
|
||||||
}
|
|
||||||
tp++;
|
|
||||||
tp2++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tp = tmpbuf;
|
|
||||||
}
|
|
||||||
if (ntflag) {
|
|
||||||
tp = dotrans(tp);
|
|
||||||
}
|
|
||||||
if (mapflag) {
|
|
||||||
tp = domap(tp);
|
|
||||||
}
|
|
||||||
sendrequest((sunique) ? "STOU" : "STOR",
|
|
||||||
cp, tp, cp != tp || !interactive);
|
|
||||||
if (!mflag && fromatty) {
|
|
||||||
ointer = interactive;
|
|
||||||
interactive = 1;
|
|
||||||
if (confirm("Continue with","mput")) {
|
|
||||||
mflag++;
|
|
||||||
}
|
|
||||||
interactive = ointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
signal(SIGINT, oldintr);
|
|
||||||
mflag = 0;
|
mflag = 0;
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
for (i = 1; i < argc; i++) {
|
if (mflag && confirm(argv[0], cp)) {
|
||||||
char **cpp;
|
tp = cp;
|
||||||
glob_t gl;
|
if (mcase) {
|
||||||
int flags;
|
while (*tp && !islower(*tp)) {
|
||||||
|
tp++;
|
||||||
if (!doglob) {
|
}
|
||||||
if (mflag && confirm(argv[0], argv[i])) {
|
if (!*tp) {
|
||||||
tp = (ntflag) ? dotrans(argv[i]) : argv[i];
|
tp = cp;
|
||||||
tp = (mapflag) ? domap(tp) : tp;
|
tp2 = tmpbuf;
|
||||||
sendrequest((sunique) ? "STOU" : "STOR",
|
while ((*tp2 = *tp) != '\0') {
|
||||||
argv[i], tp, tp != argv[i] || !interactive);
|
if (isupper(*tp2)) {
|
||||||
if (!mflag && fromatty) {
|
*tp2 = 'a' + *tp2 - 'A';
|
||||||
ointer = interactive;
|
}
|
||||||
interactive = 1;
|
tp++;
|
||||||
if (confirm("Continue with","mput")) {
|
tp2++;
|
||||||
mflag++;
|
|
||||||
}
|
|
||||||
interactive = ointer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
continue;
|
}
|
||||||
|
tp = tmpbuf;
|
||||||
}
|
}
|
||||||
|
if (ntflag) {
|
||||||
memset(&gl, 0, sizeof(gl));
|
tp = dotrans(tp);
|
||||||
flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
|
|
||||||
if (glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) {
|
|
||||||
warnx("%s: not found", argv[i]);
|
|
||||||
globfree(&gl);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
for (cpp = gl.gl_pathv; cpp && *cpp != NULL; cpp++) {
|
if (mapflag) {
|
||||||
if (mflag && confirm(argv[0], *cpp)) {
|
tp = domap(tp);
|
||||||
tp = (ntflag) ? dotrans(*cpp) : *cpp;
|
|
||||||
tp = (mapflag) ? domap(tp) : tp;
|
|
||||||
sendrequest((sunique) ? "STOU" : "STOR",
|
|
||||||
*cpp, tp, *cpp != tp || !interactive);
|
|
||||||
if (!mflag && fromatty) {
|
|
||||||
ointer = interactive;
|
|
||||||
interactive = 1;
|
|
||||||
if (confirm("Continue with","mput")) {
|
|
||||||
mflag++;
|
|
||||||
}
|
|
||||||
interactive = ointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
globfree(&gl);
|
sendrequest((sunique) ? "STOU" : "STOR",
|
||||||
|
cp, tp, cp != tp || !interactive);
|
||||||
|
if (!mflag && fromatty) {
|
||||||
|
ointer = interactive;
|
||||||
|
interactive = 1;
|
||||||
|
if (confirm("Continue with","mput")) {
|
||||||
|
mflag++;
|
||||||
|
}
|
||||||
|
interactive = ointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signal(SIGINT, oldintr);
|
signal(SIGINT, oldintr);
|
||||||
mflag = 0;
|
mflag = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (i = 1; i < argc; i++) {
|
||||||
|
char **cpp;
|
||||||
|
glob_t gl;
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
if (!doglob) {
|
||||||
|
if (mflag && confirm(argv[0], argv[i])) {
|
||||||
|
tp = (ntflag) ? dotrans(argv[i]) : argv[i];
|
||||||
|
tp = (mapflag) ? domap(tp) : tp;
|
||||||
|
sendrequest((sunique) ? "STOU" : "STOR",
|
||||||
|
argv[i], tp, tp != argv[i] || !interactive);
|
||||||
|
if (!mflag && fromatty) {
|
||||||
|
ointer = interactive;
|
||||||
|
interactive = 1;
|
||||||
|
if (confirm("Continue with","mput")) {
|
||||||
|
mflag++;
|
||||||
|
}
|
||||||
|
interactive = ointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&gl, 0, sizeof(gl));
|
||||||
|
flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
|
||||||
|
if (glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) {
|
||||||
|
warnx("%s: not found", argv[i]);
|
||||||
|
globfree(&gl);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (cpp = gl.gl_pathv; cpp && *cpp != NULL; cpp++) {
|
||||||
|
if (mflag && confirm(argv[0], *cpp)) {
|
||||||
|
tp = (ntflag) ? dotrans(*cpp) : *cpp;
|
||||||
|
tp = (mapflag) ? domap(tp) : tp;
|
||||||
|
sendrequest((sunique) ? "STOU" : "STOR",
|
||||||
|
*cpp, tp, *cpp != tp || !interactive);
|
||||||
|
if (!mflag && fromatty) {
|
||||||
|
ointer = interactive;
|
||||||
|
interactive = 1;
|
||||||
|
if (confirm("Continue with","mput")) {
|
||||||
|
mflag++;
|
||||||
|
}
|
||||||
|
interactive = ointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
globfree(&gl);
|
||||||
|
}
|
||||||
|
signal(SIGINT, oldintr);
|
||||||
|
mflag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
reget(int argc, char **argv)
|
reget(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
getit(argc, argv, 1, "r+w");
|
||||||
getit(argc, argv, 1, "r+w");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
get(int argc, char **argv)
|
get(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
getit(argc, argv, 0, restart_point ? "r+w" : "w" );
|
||||||
getit(argc, argv, 0, restart_point ? "r+w" : "w" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -658,7 +656,7 @@ usage:
|
|||||||
}
|
}
|
||||||
|
|
||||||
recvrequest("RETR", argv[2], argv[1], mode,
|
recvrequest("RETR", argv[2], argv[1], mode,
|
||||||
argv[1] != oldargv1 || argv[2] != oldargv2);
|
argv[1] != oldargv1 || argv[2] != oldargv2, argv[2] != NULL);
|
||||||
restart_point = 0;
|
restart_point = 0;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -702,7 +700,7 @@ mget(int argc, char **argv)
|
|||||||
tp = domap(tp);
|
tp = domap(tp);
|
||||||
}
|
}
|
||||||
recvrequest("RETR", tp, cp, "w",
|
recvrequest("RETR", tp, cp, "w",
|
||||||
tp != cp || !interactive);
|
tp != cp || !interactive, 0);
|
||||||
if (!mflag && fromatty) {
|
if (!mflag && fromatty) {
|
||||||
ointer = interactive;
|
ointer = interactive;
|
||||||
interactive = 1;
|
interactive = 1;
|
||||||
@@ -755,7 +753,7 @@ remglob(char **argv, int doswitch)
|
|||||||
pswitch(!proxy);
|
pswitch(!proxy);
|
||||||
}
|
}
|
||||||
for (mode = "w"; *++argv != NULL; mode = "a")
|
for (mode = "w"; *++argv != NULL; mode = "a")
|
||||||
recvrequest ("NLST", temp, *argv, mode, 0);
|
recvrequest ("NLST", temp, *argv, mode, 0, 0);
|
||||||
if (doswitch) {
|
if (doswitch) {
|
||||||
pswitch(!proxy);
|
pswitch(!proxy);
|
||||||
}
|
}
|
||||||
@@ -1036,38 +1034,38 @@ delete(int argc, char **argv)
|
|||||||
void
|
void
|
||||||
mdelete(int argc, char **argv)
|
mdelete(int argc, char **argv)
|
||||||
{
|
{
|
||||||
sighand oldintr;
|
sighand oldintr;
|
||||||
int ointer;
|
int ointer;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
if (argc < 2 && !another(&argc, &argv, "remote-files")) {
|
if (argc < 2 && !another(&argc, &argv, "remote-files")) {
|
||||||
printf("usage: %s remote-files\n", argv[0]);
|
printf("usage: %s remote-files\n", argv[0]);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
mname = argv[0];
|
||||||
|
mflag = 1;
|
||||||
|
oldintr = signal(SIGINT, mabort);
|
||||||
|
setjmp(jabort);
|
||||||
|
while ((cp = remglob(argv,0)) != NULL) {
|
||||||
|
if (*cp == '\0') {
|
||||||
|
mflag = 0;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
mname = argv[0];
|
if (mflag && confirm(argv[0], cp)) {
|
||||||
mflag = 1;
|
command("DELE %s", cp);
|
||||||
oldintr = signal(SIGINT, mabort);
|
if (!mflag && fromatty) {
|
||||||
setjmp(jabort);
|
ointer = interactive;
|
||||||
while ((cp = remglob(argv,0)) != NULL) {
|
interactive = 1;
|
||||||
if (*cp == '\0') {
|
if (confirm("Continue with", "mdelete")) {
|
||||||
mflag = 0;
|
mflag++;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (mflag && confirm(argv[0], cp)) {
|
|
||||||
command("DELE %s", cp);
|
|
||||||
if (!mflag && fromatty) {
|
|
||||||
ointer = interactive;
|
|
||||||
interactive = 1;
|
|
||||||
if (confirm("Continue with", "mdelete")) {
|
|
||||||
mflag++;
|
|
||||||
}
|
|
||||||
interactive = ointer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
interactive = ointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signal(SIGINT, oldintr);
|
}
|
||||||
mflag = 0;
|
signal(SIGINT, oldintr);
|
||||||
|
mflag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1113,11 +1111,12 @@ ls(int argc, char **argv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(argv[2], "-") && *argv[2] != '|')
|
if (strcmp(argv[2], "-") && *argv[2] != '|')
|
||||||
if (!globulize(&argv[2]) || !confirm("output to local-file:", argv[2])) {
|
if (!globulize(&argv[2]) || !confirm("output to local-file:",
|
||||||
code = -1;
|
argv[2])) {
|
||||||
return;
|
code = -1;
|
||||||
}
|
return;
|
||||||
recvrequest(cmd, argv[2], argv[1], "w", 0);
|
}
|
||||||
|
recvrequest(cmd, argv[2], argv[1], "w", 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1154,7 +1153,7 @@ usage:
|
|||||||
setjmp(jabort);
|
setjmp(jabort);
|
||||||
for (i = 1; mflag && i < argc-1; ++i) {
|
for (i = 1; mflag && i < argc-1; ++i) {
|
||||||
*mode = (i == 1) ? 'w' : 'a';
|
*mode = (i == 1) ? 'w' : 'a';
|
||||||
recvrequest(cmd, dest, argv[i], mode, 0);
|
recvrequest(cmd, dest, argv[i], mode, 0, 1);
|
||||||
if (!mflag && fromatty) {
|
if (!mflag && fromatty) {
|
||||||
ointer = interactive;
|
ointer = interactive;
|
||||||
interactive = 1;
|
interactive = 1;
|
||||||
|
Reference in New Issue
Block a user