Commit Graph

213 Commits

Author SHA1 Message Date
yar
e4057c9d37 Spot places where "pathname" hasn't been checked
for NULL.  The "pathname" rule may return NULL
on a glob(3) error.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:26:40 +00:00
yar
0f7fa2de43 Disallow invalid numeric mode values for SITE CHMOD.
Earlier, a decimal number (e.g., 890) could be passed
for mode, leading to dangerous permissions set:
-1, that is, 07777.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:10:57 +00:00
yar
61397ccb80 Reflect in the ftpd(8) manpage the fact that ASCII SIZE
requests against large files will be denied.

MFC after:	10 days
2002-08-05 13:37:18 +00:00
yar
ddb606999b Deny the SIZE command on large files when in ASCII mode.
This eliminates an opportunity for DoS attack.

Pointed out by:	maxim
Inspired by:	lukemftpd, OpenBSD
MFC after:	2 weeks
2002-07-31 10:55:31 +00:00
yar
f7ea5d7c67 Conform to RFC 959, Appendix II, when replying
to a successful MKD command.

MFC after:	1 week
2002-07-29 15:54:27 +00:00
yar
656cfb8a27 Make the -v' option a synonym for -d'
(as it was intended initially)
and document it in the manpage.

MFC after:	2 weeks
2002-07-26 16:07:19 +00:00
yar
a6e27034df Document the -u (set umask) option
(which has been there at least since 4.4BSD-Lite!)

MFC after:	2 weeks
2002-07-26 16:01:24 +00:00
yar
dc4ed048aa Sort command-line options according to the mostly used style:
alphabetical order, lower and upper case of the same letter
stick together, lower case first.

MFC after:	2 weeks
2002-07-26 15:46:08 +00:00
yar
0509d722ad Use <arpa/ftp.h> stuff cleanly, without introducing
non-portable constants (in this case, hidden as offsets
to the "?AEIL" string.)

MFC after:	1 week
2002-07-25 17:41:47 +00:00
yar
a140b57f3e Re-use passive data ports with the SO_REUSEADDR
socket option to avoid exausting the passive port
space by TIME_WAIT'ing connections.

PR:		bin/36955
Submitted by:	Maxim Konovalov <maxim@FreeBSD.org>
MFC after:	2 weeks
2002-07-24 16:11:34 +00:00
yar
df4bc1ec8e Remove the outdated casts to "char *" from the setsockopt(2),
write(2), and getipnodebyaddr(3) calls.  Now all the above functions
accept "void *" in that arguments and have prototypes.  Thus, the
casts are useless under the normal circumstances (and would be harmful
if the functions had no prototypes.)

MFC after:	2 weeks
2002-07-24 15:30:53 +00:00
yar
9d5db63436 Clean up the syslog(3) messages on the setsockopt(2) errors:
o Always check a setsockopt(2) return value
o Use a consistent message format
o Don't abort if the failed setsockopt(2) was actually not vital
o Use LOG_WARNING, not LOG_ERR, in non-fatal cases

MFC after:	1 week
2002-07-24 14:50:17 +00:00
ume
437f62d13a use IPV6_V6ONLY instead of non standard IPV6_BINDV6ONLY.
MFC after:	1 week
2002-07-22 15:22:53 +00:00
yar
56933d610d Fix one RFC 959 incompliance:
Double double-quotes in a PWD result
if they appear in the directory pathname.

PR:		misc/18365
MFC after:	1 week
2002-07-22 07:41:14 +00:00
yar
3fa8e11cd8 Allow deleting and renaming stale symlinks and
deleting symlinks pointing to directories.

PR:		bin/37250
Submitted by:	Nino Dehne <TeCeEm@gmx.de>
MFC after:	1 week
2002-07-21 12:06:56 +00:00
yar
a32b560898 Avoid passing NULL to freehostent(3).
MFC after:	1 week
2002-07-17 19:29:25 +00:00
yar
1e0f696493 Fix setting parameters for getipnodebyaddr(3):
o "struct addrinfo" contains a pointer to "struct sockaddr,"
  not "struct sockaddr" itself
o the function takes a pointer to "struct in*_addr", not to
  "struct sockaddr," so the address length must be corresponding

MFC after:	1 week
2002-07-17 19:07:07 +00:00
mikeh
bd83b53462 GLOB_QUOTE has been retired. 2002-07-17 05:47:49 +00:00
yar
ddc2edf48b Use the right indent for the closing brace: it belongs to `if',
not to `for'.  The previous indent was reather misleading for
the code reader.

MFC after:	1 week
2002-07-16 16:48:15 +00:00
yar
3fab247a94 Replace the awkward hackery about strtok(3)
by conventional one-way parsing of ftphosts(5).
Don't let NULL hostname pointers into virtual
host records as well.

PR:		bin/18410
MFC after:	1 month
2002-07-16 16:30:41 +00:00
yar
a1f253fbb5 Use fgetln(3) to read lines from configuration files (ftpusers, ftphosts.)
Thus lines of any length can be handled, unlike before.

Don't assume that each line read from the files ends with a newline.

As a side effect in inithosts(), don't use automatic buffer at all,
utilize malloc(3) when getting local host name instead.

PR:		misc/21494
Reviewed by:	maxim, mikeh
MFC after:	1 month
2002-07-12 15:51:15 +00:00
charnier
bb97d03ce3 The .Nm utility 2002-07-06 19:19:48 +00:00
dan
323b66433a Make sure to reset transflag back to zero upon succesfully using sendfile()
to transfer a file.

PR: 39362
Submitted by: TANAKA Hiroyuki <kattyo@abk.nu>
MFC after: 1 week
2002-07-03 00:12:00 +00:00
ume
506bcd21eb Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attach
scope identifier).

MFC after:	3 weeks
2002-07-02 11:11:17 +00:00
maxim
5b95ced4cb Remove trailing whitespaces. 2002-07-01 14:30:38 +00:00
maxim
96310a1120 Move 'byte_count' calculation just before 'recvurg' check. It is a global
variable and used in myoob().

PR:		bin/38928
Submitted by:	Oliver Fromme <olli@secnetix.de>
MFC after:	1 month
2002-07-01 14:29:44 +00:00
mdodd
ac2966f87c Implement a flag to disable directory creation for anonymous users.
PR:		misc/38987
Submitted by:	Peter da Silva <peter@abbnm.com>
MFC after:	1 week
2002-07-01 02:30:11 +00:00
markm
51e0421ed2 Remove a GCC-specific command-line option. We should be using WARNS=n
for this stuff.
2002-06-28 10:36:14 +00:00
alfred
a98e595fc9 Assume __STDC__, remove non-__STDC__ code. 2002-05-28 18:57:20 +00:00
maxim
288ba692bf Teach REST how to restart a file transfer after 2^31 bytes: now yylex()
returns off_t in yylval.u.o. REST is the only user of yylval.u.o at the
moment.

NB: seems lukemftpd has the same bug.

PR:		misc/28629
Reviewed by:	ru
Approved by:	ru
MFC after:	1 month
2002-03-14 16:05:06 +00:00
maxim
ebc5fa3617 Remove duplicated yacc nonterminals declarations, sort includes.
No functional changes from rev. 1.31.

Reviewed by:	ru
Approved by:	ru
MFC after:	1 week
2002-03-11 11:48:55 +00:00
obrien
82293161c1 Put the last added source file in proper order.
(and dcc the committer a dictionary)
2002-02-27 18:29:11 +00:00
des
52a021a953 Rewrite the part of the conversation function that allocates the reply array;
it was inelegant and neglected to check the return value from malloc(3).

Sponsored by:	DARPA, NAI Labs
2002-02-25 16:39:34 +00:00
maxim
506b5e2c1a Fix infinite loop around sendfile(2) after sending >4GB file.
PR:		bin/33770
Submitted by:	Vladislav Shabanov <vs@rambler-co.ru>
Reviewed by:	ru
Approved by:	ru
MFC after:	1 month
2002-02-13 09:00:05 +00:00
kris
eb02f726dd Lock down with WFORMAT?=1, with overrides in the subdirectories which
are not yet warning-clean.  Tested on i386 and alpha.
2002-02-04 02:33:51 +00:00
kris
4c37ccc7f2 Silence some FORMAT_AUDIT warnings (one left) 2002-02-04 01:23:44 +00:00
imp
8341395a27 o Eliminate __P
o Use new-style function definitions
o remove some !__STDC__ code
o eliminate register
2002-02-03 15:53:02 +00:00
yar
29aa85d88a Remove the setjmp/longjmp stuff completely. Use signal
handlers to set flags only (with exception for sigquit(),
which still seems to call some non-reentrant functions on
its way to _exit(2).)  That must eliminate the possibility
of catching SIGSEGV from following non-reentrant paths from
signal handlers.

PR:		bin/32740 bin/33846
Submitted by:	Maxim Konovalov <maxim@macomnet.ru>
Obtained from:	OpenBSD
2002-01-28 19:28:14 +00:00
ume
0088551328 Log wtmp according to an address family properly.
Reported by:	matusita
Reviewed by:	matusita
MFC after:	1 week
2002-01-28 14:50:07 +00:00
ache
30c0357658 Remove my workaround fallback since PAM now do it properly. 2002-01-21 19:07:15 +00:00
des
1a0c96bd43 Really back out ache's commits. These files are now precisely as they were
twentyfour hours ago, except for RCS ids.
2002-01-19 18:29:50 +00:00
ache
6f50c9384a Back out PAM_CRED_ERR addition 2002-01-19 18:06:05 +00:00
ache
10701651c5 Add PAM_CRED_ERR as valid failure case 2002-01-19 09:01:17 +00:00
ache
6dc8bb685b Call opieunlock() only if we skip opieverify() part 2002-01-19 05:59:24 +00:00
ache
b78b2a65a2 Remove conditional 'pwok' fallback for PAM which now
is implemented in pam_opie module

For non-PAM variant rewrite empty password checking code to do the right thing
and not disallow empty passwords in all cases.
2002-01-19 03:18:33 +00:00
dwmalone
1d569d0268 Be more careful about freeing memory after parsing commands.
Hiroyuki YAMAMORI gave a patch for the EPRT command in the
PR below. Problems with the rest of the patch are my fault.

PR:		33268
Reviewed by:	iedowse, sheldonh
2002-01-05 20:13:01 +00:00
ache
809ded1ba4 Fix OPIE auth 2002-01-01 13:14:25 +00:00
bde
e739c8244a Fixed missing DPADD in previous commit. Fixed most style bugs related to
DPADD and LDADD.
2001-12-29 12:06:59 +00:00
joe
5834b251b7 Link with libm to take advantage of the -h flag to ls.
Submitted by:	Mike Makonnen <mike_makonnen@yahoo.com>
2001-12-29 10:22:13 +00:00
green
a6b2099b8a Add lomac.c.
Found by:	ken
2001-11-27 06:15:12 +00:00