Subject: fopen on /dev/null failed error

From: [email-masked]
Date: Mon, 4 Aug 1997 10:12:59 -0500

I'm seeing one particular message in my syslog for every login (anonymous &
guest ids) entry.  My syslog.conf has one line:
     *.debug        /var/adm/syslog

Here's a sample of my /var/adm/syslog:
     Aug  4   09:16:08  ftp  ftpd[6996]:  ftp FTP server (Version wu-2.4(7)
Tue Jul 29 09:54:53 CDT 1997) ready.
     Aug  4  09:16:10   ftp  ftpd[6996]:  command:  USER   guestid^M
     Aug  4  09:16:13   ftp  ftpd[6996]:  command:  PASS    password^M
     Aug  4  09:16:13   ftp  ftpd[6996]:  syslog:  fopen on /dev/null
failed, errno 2

Does anybody know what this is all about and how to clean it up?  I'm
running wu-2.4 on AIX 4.2.0

Thanks, Thuy

---

From: Ben Mehlman <[email-masked]>
Date: Mon, 4 Aug 1997 14:58:54 -0400 (EDT)

> running wu-2.4 on AIX 4.2.0

Yes.  For some reason, the syslog() function in AIX (or some function it
calls) wants to open /dev/null.  If the ftp user is anonymous or a guest
user, they are chrooted at that point and the device can't be opened.  The
solution is to make sure the syslog function that's included in the wu-ftpd
support library is linked into your executable.

-Ben

----------------------------------------------------------------------------
Ben Mehlman             The reasonable man adapts himself to the world; the 
Prodigy Services Corp   unreasonable one persists in trying to adapt the
[email-masked]   world to himself.  Therefore all progress depends on
                        the unreasonable man. -George Bernard Shaw

---

From: Kent Landfield <[email-masked]>
Date: Mon, 4 Aug 1997 14:51:43 -0500 (CDT)

# 
# > I'm seeing one particular message in my syslog for every login (anonymous &
# > guest ids) entry.  My syslog.conf has one line:
# >      *.debug        /var/adm/syslog
# > 
# > Here's a sample of my /var/adm/syslog:
# >      Aug  4   09:16:08  ftp  ftpd[6996]:  ftp FTP server (Version wu-2.4(7)
# > Tue Jul 29 09:54:53 CDT 1997) ready.
# >      Aug  4  09:16:10   ftp  ftpd[6996]:  command:  USER   guestid^M
# >      Aug  4  09:16:13   ftp  ftpd[6996]:  command:  PASS    password^M
# >      Aug  4  09:16:13   ftp  ftpd[6996]:  syslog:  fopen on /dev/null
# > failed, errno 2
# > 
# > Does anybody know what this is all about and how to clean it up?  I'm
# > running wu-2.4 on AIX 4.2.0
# > 
# 
# Yes.  For some reason, the syslog() function in AIX (or some function it
# calls) wants to open /dev/null.  If the ftp user is anonymous or a guest
# user, they are chrooted at that point and the device can't be opened.  The
# solution is to make sure the syslog function that's included in the wu-ftpd
# support library is linked into your executable.

Doesn't simply creating the /dev/null in the chroot area solve the problem ?

-- 
Kent Landfield                        Phone: 1-817-545-2502             
The Landfield Group                   FAX:   1-817-545-7650             
Email: [email-masked]             http://www.landfield.com/
Please send comp.sources.misc related mail to [email-masked].
Search the Usenet Hypertext FAQ Archive at http://www.faqs.org/faqs/

---

From: Shane Castle <[email-masked]>
Date: Mon, 4 Aug 1997 15:31:44 -0600 (MDT)

On Mon, 4 Aug 1997, Kent Landfield wrote:

># > guest ids) entry.

Absolutely.  Here's how:

   mknod <chrooted-dir>/dev/null c 2 2

BTW, Kent, you should keep all attribution lines.  We have no idea who
you were quoting above.

Shane Castle             | "Perfection, then, is finally achieved, not
Boulder County Info Svcs | when there is nothing left to add, but when
Boulder CO USA           | there is nothing left to take away."
                         |                - Antoine de Saint-Exupery

---

From: Kent Landfield <[email-masked]>
Date: Mon, 4 Aug 1997 16:51:09 -0500 (CDT)

Shane Castle ([email-masked]) writes:

# BTW, Kent, you should keep all attribution lines.  We have no idea who
# you were quoting above.

:-)  I intentionally delete attribution lines in the event that things 
can make someone look not-quite-up-to-speed and when I think the topic 
should be the focus, not the submitters.  I also do it in the event that 
the participants may themselves be controversial. (This was not the case 
here.)

But your point is well taken. ;)

---

From: Tim Bandy <[email-masked]>
Date: Mon, 4 Aug 1997 17:19:09 -0500 (CDT)

Shane Castle writes:
!: On Mon, 4 Aug 1997, Kent Landfield wrote:
!: >
!: >Doesn't simply creating the /dev/null in the chroot area solve the problem ?
!: 
!: Absolutely.  Here's how:
!: 
!:    mknod <chrooted-dir>/dev/null c 2 2

I believe that /dev/null's major and minor device numbers are os
dependent.  You should check the real /dev/null for its major and
minor before you create the device.  Then, the syntax is:
# mknod <chrooted-dir>/dev/null c <real major> <real minor>

-- 
Tim Bandy			<[email-masked]>
GeneSys, LLC