--- libexec/ftpd/ftpd.c Tue Jul 22 00:10:20 2003 +++ libexec/ftpd/ftpd.c Tue Oct 28 09:21:14 2003 @@ -134,6 +134,7 @@ int restricted_data_ports = 1; int paranoid = 1; /* be extra careful about security */ int anon_only = 0; /* Only anonymous ftp allowed */ +int no_fdelete = 0; /* Do not delete files */ int guest; int dochroot; int dowtmp = 1; @@ -310,7 +311,7 @@ while ((ch = getopt(argc, argv, - "46a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) { + "46a:AdDEhKlmMoOp:P:rRSt:T:u:UvW")) != -1) { switch (ch) { case '4': enable_v4 = 1; @@ -346,6 +347,10 @@ hostinfo = 0; break; + case 'K': + no_fdelete = 1; + break; + case 'l': logging++; /* > 1 == extra logging */ break; @@ -2456,6 +2461,10 @@ struct stat st; LOGCMD("delete", name); + if (no_fdelete) { + reply(550, "%s: permission denied", name); + return; + } if (lstat(name, &st) < 0) { perror_reply(550, name); return; --- libexec/ftpd/ftpd.8 Fri Sep 5 03:34:18 2003 +++ libexec/ftpd/ftpd.8 Tue Oct 28 09:23:10 2003 @@ -110,6 +110,8 @@ .It Fl h Disable printing host-specific information, such as the server software version or hostname, in server messages. +.It Fl K +Forbid file deletion .It Fl l Each successful and failed .Xr ftp 1