| Summary: | ftpd can't handle /etc/chroot entries without a NL | ||
|---|---|---|---|
| Product: | Base System | Reporter: | djhill <djhill> |
| Component: | misc | Assignee: | Yar Tikhiy <yar> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
djhill
2000-09-23 06:56:38 UTC
When adding a user to /etc/ftpchroot without hitting enter at the end
(does not at \n), ftpd will fail to check the username. Ok, maybe I
am being picky, but when I had to add only one username to
/etc/ftpchroot, and it wasn't working, I finally remembered to hit enter.
A patch is available below (could it hurt it add it?)
Fix:
if ((fd = fopen(fname, "r")) != NULL) {
while (!found && fgets(line, sizeof(line), fd) != NULL)
- if ((p = strchr(line, '\n')) != NULL) {
+ if (((p = strchr(line, '\n')) != NULL) || (p = strchr(line, '\0')) != NULL) {
*p = '\0';
if (line[0] == '#')
continue;--wXTmFNHi4qkbkmTj3hg3qckcSwo9dWcKSBi6dGm3skTktKN5
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"
--- ftpd.c.orig Wed Sep 20 05:57:57 2000
+++ ftpd.c Sat Sep 23 01:53:33 2000
@@ -977,7 +977,7 @@
How-To-Repeat: add a user to /etc/ftpchroot without hitting enter at the end.
Responsible Changed From-To: freebsd-bugs->mikeh I'll look at this. Responsible Changed From-To: mikeh->yar Yar has looked at this and made more progress than I have so far. State Changed From-To: open->patched CURRENT fixed, MFC pending. State Changed From-To: patched->feedback The bug is fixed in STABLE & CURRENT. Is the problem gone in your configuration? State Changed From-To: feedback->closed Originator's email is gone. |