Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Rename -w to -c by popular demand



details:   https://anonhg.NetBSD.org/src/rev/2f8ff92e847b
branches:  trunk
changeset: 754402:2f8ff92e847b
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Thu Apr 29 20:13:46 2010 +0000

description:
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)

diffstat:

 doc/CHANGES           |   4 ++--
 libexec/tftpd/tftpd.8 |  16 ++++++++--------
 libexec/tftpd/tftpd.c |  14 +++++++-------
 3 files changed, 17 insertions(+), 17 deletions(-)

diffs (118 lines):

diff -r fa6e295183ee -r 2f8ff92e847b doc/CHANGES
--- a/doc/CHANGES       Thu Apr 29 18:14:09 2010 +0000
+++ b/doc/CHANGES       Thu Apr 29 20:13:46 2010 +0000
@@ -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]
diff -r fa6e295183ee -r 2f8ff92e847b libexec/tftpd/tftpd.8
--- a/libexec/tftpd/tftpd.8     Thu Apr 29 18:14:09 2010 +0000
+++ b/libexec/tftpd/tftpd.8     Thu Apr 29 20:13:46 2010 +0000
@@ -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.
diff -r fa6e295183ee -r 2f8ff92e847b libexec/tftpd/tftpd.c
--- a/libexec/tftpd/tftpd.c     Thu Apr 29 18:14:09 2010 +0000
+++ b/libexec/tftpd/tftpd.c     Thu Apr 29 20:13:46 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index