summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/cmds.c
AgeCommit message (Collapse)Author
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2019-11-18various knf and whitespace; ok jcaTheo de Raadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-05-16Revert suni'ls ftp rewrite for now.Florian Obser
We are juggling too many things at the moment and we can't deal with the differences in behaviour right now.
2019-05-12Move us from old ftp(1) to Sunil's new ftp(1). The necessary modificationskmos
have been made to make it behave. Any new misbehaviors can be fixed in tree. OK florian@ deraadt@ "Have you committed ftp yet?"
2018-01-24Use closefrom(3) instead of manually closing all file descriptorsTheo Buehler
between 3 and 19. ok martijn, millert, jca
2017-01-21Nuke whitespace foolish enough to expose itself during the greatKenneth R Westerback
"warning:" rectification.
2016-08-14Convert remaining calls to strtoq/strtouq in base with strtoll/strtoull.Philip Guenther
Fix a type mismatch in ftp's "page" command and could make transfers restart at the wrong position. ok and a ull->ll tweak from natano@, ok tedu@
2016-05-25Avoid a use-after-free.Kenneth R Westerback
Diff from Vladimir Sotirov via tech@. Thanks! ok millert@
2016-03-17Last parameter to execl[e]() functions *must* be cast to a pointer.Kenneth R Westerback
Just NULL is not good practise as NULL is theoretically allowed to be an integer rather than a pointer. Use (char *)NULL consistently instead of scattering a few (char *)0 and (void *)NULL into the mix. Prompted by and probably ok deraadt@ millert@ kettenis@ Definitely ok mestre@ ratchov@
2015-10-18A whole buncha unsigned char casts for ctype function arguments.mmcc
ok guenther@
2015-01-30remove tenex transfer support. if you still have TOPS20 machines inTed Unangst
service, you'll need to stick with openbsd 5.6. bonus: remove references to ebcdic. ok deraadt
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-08-16I found a number of interactive events which can cause signals, and goTheo de Raadt
down paths not previously marked as signal handled unsafe. Try to clean up a few of them especially regarding errno, mark others as unsafe, and repair a few by avoiding stdio. Glanced at by misc people in Slovenia, but considered too risky before release..
2012-10-15Add support for recursive ftp upload. The mput command of the ftpAlexander Bluhm
client got the -r switch and -d depth option. From Jan Klemkow <j.klemkow AT wemelug DOT de> OK haesbaert@
2009-05-05make it clean removing the ifdef SMALL maze. separate cmds andMartynas Venckus
small stuff. make it a fetcher. shrinks quite a bit agreed by millert@, krw@ ok theo, sthen@
2009-04-27remove uploading and macros support from install media; to saveMartynas Venckus
some space discussed with theo, todd@, millert@ tested and looked over by sthen@
2009-04-27toast the rcsid strings which just get in the wayTheo de Raadt
2008-10-16- resume http transfers [-C], if local file does not existMartynas Venckus
- resume ftp transfers [-C, reget, mget], if local file does not exist ok theo
2008-09-18unbreak for gcc2 archs; declaration before code!Todd T. Fries
2008-09-08- simplify mget(): remove the duplicate code and just use getit(),Martynas Venckus
as a result it can do nice things getit() does such as: - -n: use 'newer' for transfers (fetches files that are newer on the server, than locally), this can be used for e.g. mirroring (mget -cnr 4.* would fetch missing files, continue interrupted transfers, and replace newer files of 4.X dirs) - -d: spedify depth of the recurrence. e.g. 'mget -rd 2 patches' in pub/openbsd would fetch only archive files, not going further into dirs - use static restartit, max_depth instead of doing the magic tested/requested&ok merdely@; ok pyr@, millert@ man page tweaks&ok jmc@
2008-08-22default file transfer type is binary, not ascii;Igor Sobrado
commands which toggle settings can take an explicit on or off argument to force the setting appropiately, show these arguments in usage; synchronize synopsis and usage of commands; spacing; KNF; other minor documentation tweaks. written with help by jmc@ ok jmc@ (documentation), martynas@ (type usage and default file transfer type)
2008-07-08- add support for recursive transfers (but not for floppies), e.g.Martynas Venckus
'mget -cr 4.*' would recursively fetch (-r), and resume the previous transfers (-c) of 4.X release directories uses local matching (fnmatch), but only for recursive transfers. current behavior is not changed in any way. - while here, ifndef SMALL debugging stuff, this saves some space, for floppies - some debugging code was enabled for non-debugging mode, checks assume debug is set to zero, but it's not initially set - all "Confirm with" prompts are forced, remove redundant argument - fix usage: -C and -c are not available for SMALL discussed a year ago w/ pyr@ looks good to millert@ previous version looked good to pyr@ man page tweaks & ok jmc@
2008-06-25- fix -Wall (no behavior change, a || b && c = a || (b && c) anyway)Martynas Venckus
- use argv[0] for "Confirm with", as other confirm()s do - fix confirm cases, pass force=1 for mdelete and mabort too, fixes a bug when you end up deleting all files when you ^C, instead of getting a confirmation - add reput command, that will allow to continue transfer uploads - add -c for mget and mput, that will allow to continue multiple transfers - fix a bug when you use restart command together with put. the progressmeter would start from zero, and eta would show fictional time. this actually allows reput/put -c to have correct progressmeter too - document everything discussed with, suggestions, reminded to ifdef SMALL the code so we're able to fit in floppies, and ok millert@, and jmc@
2008-06-16- add 'q', which does the same as eofMartynas Venckus
- add '?', which will help - make use of mflag, instead of special-case interactive - change mflag++ to mflag = 1, because theoretically it can go out of range "i like it" millert@. man page help and ok jmc@
2008-06-16fix transfer interrupting when confirmrest mode is used. changeMartynas Venckus
confirm() to have a 'force' argument, so that ointer/oconf dance is not needed, and to prevent further bugs like this; ok millert@
2008-06-15make further prompts work after eof, don't spam with prompts inMartynas Venckus
m*() cases; ok millert@
2008-05-13Remove #if 0 code that has been unused for nearly a decade (andRay Lai
probably doesn't compile, since the types for some variables have changed from long to char *). OK millert@
2007-09-11use strcspn to properly overwrite '\n' in fgets returned bufferGilles Chehade
ok pyr@, ray@, millert@, moritz@, chl@
2007-07-26Remove the space after "Password:" in password prompts where echo isTodd C. Miller
turned off. This is consistent with historic UNIX behavior.
2006-11-22Mark signal race.Ray Lai
``OK!'' deraadt@.
2006-11-02Pass full buffer size to fgets.Ray Lai
OK moritz@ and jaredy@.
2006-11-02Add checks for fgets and properly overwrite newline.Ray Lai
Initial patch from Charles Longeau <chl at tuxfamily dot org>. OK moritz@ and jaredy@.
2006-05-19Remove ``sanity check'' that is already done in loop.Ray Lai
OK beck@
2006-05-16Remove shadowing variables and properly use /* FALLTHROUGH */Ray Lai
comments. No binary change. Found by lint. OK beck@, deraadt@
2006-04-25two strtol calls that were begging to be converted to strtonumTed Unangst
2005-10-12Fix mget directory traversal vulnerability. From NetBSD. CAN-2002-1345.Otto Moerbeek
ok millert@ deraadt@, prodding by david@
2004-09-16type corrections and other delintingTheo de Raadt
2004-07-20ansi; khalek@linuxgamers.netTheo de Raadt
2003-12-16for -DSMALL, do not include rcsid[]sTheo de Raadt
2003-06-03Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-04-05string fixes; ok miod henningTheo de Raadt
2003-03-31Treat empty environment variables the same as NULL. henning@ OKTodd C. Miller
2003-01-03be more aware of directory change failures; s@msmith.netTheo de Raadt
2002-07-12malloc/strdup failure not handled; cloder@acm.orgTheo de Raadt
2002-01-04Don't longjmp(..., 0)Artur Grabowski
2001-10-24Misplaced space in fprintf "Execute get, put orappend to initiate transfer"Todd C. Miller
2001-10-01Typo, assign the new restart point to nrestart_point, not restart_point.Todd C. Miller
Fixes an uninitialized use of nrestart_point.
2001-07-12first pass at a -Wall cleanupTheo de Raadt
2001-06-26use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.lebel