Module Name: src
Committed By: hubertf
Date: Thu Apr 29 20:13:46 UTC 2010
Modified Files:
src/doc: CHANGES
src/libexec/tftpd: tftpd.8 tftpd.c
Log Message:
Rename -w to -c by popular demand
(allow file 'c'reation - 'w'riting was always available, with some twist;
plus there's already such a feature elsewhere, so let's try to not
diverge needlessly)
To generate a diff of this commit:
cvs rdiff -u -r1.1384 -r1.1385 src/doc/CHANGES
cvs rdiff -u -r1.26 -r1.27 src/libexec/tftpd/tftpd.8
cvs rdiff -u -r1.37 -r1.38 src/libexec/tftpd/tftpd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1384 src/doc/CHANGES:1.1385
--- src/doc/CHANGES:1.1384 Wed Apr 28 22:21:51 2010
+++ src/doc/CHANGES Thu Apr 29 20:13:46 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1384 $>
+# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1385 $>
#
#
# [Note: This file does not mention every change made to the NetBSD source tree.
@@ -599,6 +599,6 @@
The database cache for services(5) has been updated to use
this. services_mkdb(8) can still be used to create the old
format. [joerg 20100425]
- tftpd(8): Add -w so files can be uploaded without requiring them
+ tftpd(8): Add -c so files can be uploaded without requiring them
to be created before the upload. See the section on security
considerations before enabling. [hubertf 20100429]
Index: src/libexec/tftpd/tftpd.8
diff -u src/libexec/tftpd/tftpd.8:1.26 src/libexec/tftpd/tftpd.8:1.27
--- src/libexec/tftpd/tftpd.8:1.26 Thu Apr 29 07:04:44 2010
+++ src/libexec/tftpd/tftpd.8 Thu Apr 29 20:13:46 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: tftpd.8,v 1.26 2010/04/29 07:04:44 wiz Exp $
+.\" $NetBSD: tftpd.8,v 1.27 2010/04/29 20:13:46 hubertf Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -39,7 +39,7 @@
Internet Trivial File Transfer Protocol server
.Sh SYNOPSIS
.Nm
-.Op Fl dlnw
+.Op Fl cdln
.Op Fl g Ar group
.Op Fl p Ar pathsep
.Op Fl s Ar directory
@@ -70,8 +70,8 @@
or containing
.Dq Pa /../
are not allowed.
-Unless
-.Fl w
+Unless option
+.Fl c
is used,
files may be written to only if they already exist and are publicly writable.
.Pp
@@ -95,6 +95,9 @@
.Pp
The options are:
.Bl -tag -width "XsXdirectoryX"
+.It Fl c
+Allow unrestricted creation of new files, with no need for
+a prior existance.
.It Fl d
Enable verbose debugging messages to
.Xr syslogd 8 .
@@ -151,9 +154,6 @@
isn't also given, change the gid to that of
.Ar user
as well.
-.It Fl w
-Allow unrestricted writing of new files, without need of
-prior existence.
.El
.Sh SEE ALSO
.Xr tftp 1 ,
@@ -240,7 +240,7 @@
difficult to document here.
.Pp
If unrestricted file upload is enabled via the
-.Fl w
+.Fl c
option, care should be taken that this can be used
to fill up disk space in an uncontrolled manner
if this is used in an insecure environment.
Index: src/libexec/tftpd/tftpd.c
diff -u src/libexec/tftpd/tftpd.c:1.37 src/libexec/tftpd/tftpd.c:1.38
--- src/libexec/tftpd/tftpd.c:1.37 Wed Apr 28 22:21:51 2010
+++ src/libexec/tftpd/tftpd.c Thu Apr 29 20:13:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: tftpd.c,v 1.37 2010/04/28 22:21:51 hubertf Exp $ */
+/* $NetBSD: tftpd.c,v 1.38 2010/04/29 20:13:46 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tftpd.c,v 1.37 2010/04/28 22:21:51 hubertf Exp $");
+__RCSID("$NetBSD: tftpd.c,v 1.38 2010/04/29 20:13:46 hubertf Exp $");
#endif
#endif /* not lint */
@@ -172,8 +172,12 @@
curuid = getuid();
curgid = getgid();
- while ((ch = getopt(argc, argv, "dg:lnp:s:u:w")) != -1)
+ while ((ch = getopt(argc, argv, "cdg:lnp:s:u:")) != -1)
switch (ch) {
+ case 'w':
+ unrestricted_writes = 1;
+ break;
+
case 'd':
debug++;
break;
@@ -205,10 +209,6 @@
tgtuser = optarg;
break;
- case 'w':
- unrestricted_writes = 1;
- break;
-
default:
usage();
break;