NetBSD Problem Report #33261
From fun@mail.fukaumi.org Sat Apr 15 07:11:05 2006
Return-Path: <fun@mail.fukaumi.org>
Received: from mail.fukaumi.org (mail.fukaumi.org [221.186.40.204])
by narn.netbsd.org (Postfix) with ESMTP id 700BA63BA4F
for <gnats-bugs@gnats.NetBSD.org>; Sat, 15 Apr 2006 07:11:04 +0000 (UTC)
Message-Id: <200604150710.k3F7Awp15701@mail.fukaumi.org>
Date: Sat, 15 Apr 2006 16:10:58 +0900 (JST)
From: fun@naobsd.org
Reply-To: fun@naobsd.org
To: gnats-bugs@netbsd.org
Subject: [PATCH] ftpd does not update wtmpx
X-Send-Pr-Version: 3.95
>Number: 33261
>Category: bin
>Synopsis: [PATCH] ftpd does not update wtmpx
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 15 07:15:00 +0000 2006
>Closed-Date: Sat Sep 23 16:04:20 +0000 2006
>Last-Modified: Tue Sep 26 06:25:01 +0000 2006
>Originator: FUKAUMI Naoki
>Release: NetBSD 3.99.17
>Organization:
FUKAUMI Naoki
>Environment:
System: NetBSD gigalandisk.naobsd.org 3.99.17 NetBSD 3.99.17 (GENERIC) #0: Sun Apr 9 22:46:24 JST 2006 root@build.naobsd.org:/usr/obj/gigalandisk/sys/arch/gigalandisk/compile/GENERIC gigalandisk
Architecture: arm
Machine: gigalandisk
>Description:
ftpd(8) does not update wtmpx.
>How-To-Repeat:
Enable ftpd and login ftpd.
No ftp session is listed in last(1).
>Fix:
The latter half of this patch fixes this problem.
Index: libexec/ftpd/logwtmp.c
===================================================================
RCS file: /cvsroot/src/libexec/ftpd/logwtmp.c,v
retrieving revision 1.24
diff -u -p -r1.24 logwtmp.c
--- libexec/ftpd/logwtmp.c 23 Jun 2005 04:20:41 -0000 1.24
+++ libexec/ftpd/logwtmp.c 15 Apr 2006 06:59:24 -0000
@@ -89,7 +89,7 @@ ftpd_logwtmp(const char *line, const cha
struct utmp ut;
struct stat buf;
- if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
+ if (fd < 0)
return;
if (fstat(fd, &buf) == 0) {
(void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
@@ -110,7 +110,7 @@ void
ftpd_initwtmpx(void)
{
const char *wf = _PATH_WTMPX;
- if ((fd = open(wf, O_WRONLY|O_APPEND, 0)) == -1)
+ if ((fdx = open(wf, O_WRONLY|O_APPEND, 0)) == -1)
syslog(LOG_ERR, "Cannot open `%s' (%m)", wf);
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: xtraeme@netbsd.org
State-Changed-When: Sat, 23 Sep 2006 16:04:20 +0000
State-Changed-Why:
Patch applied, thank you very much.
From: Juan Romero Pardines <xtraeme@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/33261 CVS commit: src/libexec/ftpd
Date: Sat, 23 Sep 2006 16:03:50 +0000 (UTC)
Module Name: src
Committed By: xtraeme
Date: Sat Sep 23 16:03:50 UTC 2006
Modified Files:
src/libexec/ftpd: logwtmp.c
Log Message:
Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
"ftpd does not update wtmpx".
Thanks.
To generate a diff of this commit:
cvs rdiff -r1.24 -r1.25 src/libexec/ftpd/logwtmp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Luke Mewburn <lukem@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/33261 CVS commit: src/libexec/ftpd
Date: Mon, 25 Sep 2006 06:30:55 +0000 (UTC)
Module Name: src
Committed By: lukem
Date: Mon Sep 25 06:30:55 UTC 2006
Modified Files:
src/libexec/ftpd: version.h
Log Message:
Update to 20060923 for the following changes:
20060201
debug -> ftpd_debug
xstrdup -> ftpd_strdup
20060317
* Make sure that "su" is initialized before dereferencing it.
Fixes Coverity CID 1075.
* Set file to NULL after calling fclose().
Fixes Coverity CID 2669.
* Remove unreachable code (res could never be NULL here).
Fixes Coverity CID 712.
20060509
change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
20060923
Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
"ftpd does not update wtmpx".
To generate a diff of this commit:
cvs rdiff -r1.64 -r1.65 src/libexec/ftpd/version.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Luke Mewburn <lukem@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/33261 CVS commit: othersrc/libexec/tnftpd/src
Date: Tue, 26 Sep 2006 06:20:00 +0000 (UTC)
Module Name: othersrc
Committed By: lukem
Date: Tue Sep 26 06:19:59 UTC 2006
Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv24492
Log Message:
Import NetBSD-ftpd 20060923:
* Rename debug -> ftpd_debug, xstrdup -> ftpd_strdup
* Fix comment about DEFAULT_UMASK.
Pointed out in private mail by Tetsuya Isaki and Dmitry Sivachenko.
* Add recvbufsize configuration option.
This allows for setting the passive socket's SO_RCVBUF. Option works
similarly to the current sendbufsize configuration option.
* Change how recveive_data() works.
When reading data from the socket for passive transfers to the server,
receive_data() now works very similar to send_data_with_read(). Reads
from the network are now done using either the filesystem block size or
the configuration option readsize chunks.
* Add hidesymlinks configuration option.
This adds a -L to all ls command arguments so that the file or directory
the link references is listed rather than the link itself. This was
inspired by IRIX ftpd's -S option.
* Change _PATH_FOO to _NAME_FOO where FOO is not a path.
* Reorder some declarations so that parsers generated by bison can compile.
Fix from Michael Richardson.
* Implement option "-D", for running ftpd in standalone mode (daemon).
ftpd will listen on the default FTP port for incoming connections and fork
a child for each connection. This is lower overhead than starting ftpd from
inetd(8) and thus might be useful on busy servers to reduce load.
Inspired by FreeBSD.
* Change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
* Remove unreachable code (res could never be NULL here).
Fixes Coverity CID 712.
* Set file to NULL after calling fclose().
Fixes Coverity CID 2669.
* Make sure that "su" is initialized before dereferencing it.
Fixes Coverity CID 1075.
* Fix some typos.
* NLST should return 450 instead of 550 upon error, per RFC 959.
* logxfer(): don't use the same buffer to store the results of two separate
concurrent realpath(3)s, otherwise we'll log the wrong information
for a rename.
Noted by Dmitry Sivachenko in private mail.
* s/getpwnam/sgetpwnam/ Found by John Nemeth.
* Add PAM and LOGIN_CAP support. Mostly from FreeBSD. If pam is defined,
then we don't fall back to other authentications even if PAM fails due
to a system error (e.g. configuration problem).
* Fix inverted test for expired passwords.
* Cleanup utmp and utmpx support.
- make them symmetric
- add a function to open the wtmp file explicitly very early in the game
* Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
"ftpd does not update wtmpx".
Status:
Vendor Tag: TNF
Release Tags: NetBSD-20060923
C othersrc/libexec/tnftpd/src/Makefile
C othersrc/libexec/tnftpd/src/popen.c
C othersrc/libexec/tnftpd/src/ftpd.8
C othersrc/libexec/tnftpd/src/ftpd.conf.5
C othersrc/libexec/tnftpd/src/ftpd.c
C othersrc/libexec/tnftpd/src/cmds.c
C othersrc/libexec/tnftpd/src/ftpcmd.y
C othersrc/libexec/tnftpd/src/extern.h
U othersrc/libexec/tnftpd/src/version.h
C othersrc/libexec/tnftpd/src/conf.c
C othersrc/libexec/tnftpd/src/pathnames.h
U othersrc/libexec/tnftpd/src/logutmp.c
U othersrc/libexec/tnftpd/src/ftpusers.5
U othersrc/libexec/tnftpd/src/logwtmp.c
10 conflicts created by this import.
Use the following command to help the merge:
cvs checkout -jTNF:yesterday -jTNF othersrc/libexec/tnftpd/src
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.