NetBSD Problem Report #805

From gnats  Sat Feb 18 10:02:22 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id KAA05383 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sat, 18 Feb 1995 10:02:21 -0800
Message-Id: <199410162342.AAA06145@gluon.city.ac.uk>
Date: Mon, 17 Oct 1994 00:42:14 +0100
From: sh391@city.ac.uk
Reply-To: sh391@city.ac.uk
To: gnats-bugs@NetBSD.ORG
Subject: tftp -s must be run as root - should be documented
X-Send-Pr-Version: 3.2

>Number:         805
>Category:       bin
>Synopsis:       tftp -s must be run as root - should be documented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 18 10:05:07 +0000 1995
>Closed-Date:    Sun Jun 04 13:59:54 +0000 1995
>Last-Modified:  
>Originator:     David Brownlee
>Release:        Feb-95
>Organization:
Private
>Environment:
sparc, 1.0A, current
System: NetBSD gluon.city.ac.uk 1.0A NetBSD 1.0A (GLUON) #1: Thu Feb 9 11:25:40 GMT 1995 monoadm@gluon.city.ac.uk:/mono/u1/NetBSD/src/sys/arch/sparc/compile/GLUON sparc


>Description:
	When tftpd is given '-s' it must be run as root, otherwise the
	chroot() call fails. This should be documented. (17 dork points
	awarded here for getting deep into debugging the source before
	thinking "Wait a minute... only root can chroot()..." :)
>How-To-Repeat:
	man chroot
>Fix:

*** libexec/tftpd/tftpd.8.orig	Mon Oct 17 00:15:01 1994
--- libexec/tftpd/tftpd.8	Mon Oct 17 00:16:31 1994
***************
*** 92,99 ****
  flag with a directory name, tftpd will
  .Xr chroot 2
  on startup; therefore the remote host is not expected to pass the directory
! as part of the file name to transfer.  This option is intended primarily for
! compatibility with SunOS boot ROMs which do not include a directory name.
  .Sh SEE ALSO
  .Xr tftp 1 ,
  .Xr inetd 8
--- 92,100 ----
  flag with a directory name, tftpd will
  .Xr chroot 2
  on startup; therefore the remote host is not expected to pass the directory
! as part of the file name to transfer.  It must be run as root to permit this.
! This option is intended primarily for compatibility with SunOS boot ROMs which
! do not include a directory name.
  .Sh SEE ALSO
  .Xr tftp 1 ,
  .Xr inetd 8
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->analyzed
State-Changed-By: jtc
State-Changed-When: Wed Mar  1 00:05:53 1995
State-Changed-Why:
Another alternative is to run tftpd as root out of inetd, and have it
release its privleges by setuid'ing to nobody.  This seems to be what
SunOS does.  The pro's and con's of both approaches should be 
considered before this bug is fixed.

State-Changed-From-To: analyzed->closed
State-Changed-By: jtc
State-Changed-When: Sun Jun  4 13:59:54 1995
State-Changed-Why:
Making tftpd setuid is a major security hole and changing inetd.conf to
run it as root is too (especially if the -s option is not selected). So
I checked in code that explicitly sets the user and group id's to non-
privleged values and changed the default inetd.conf to invoke tftpd
as root.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.