ftpd: support SITE CHMOD 0777 /path/to/file

Aleksander Mazur deweloper at wp.pl
Fri Jun 2 18:04:15 UTC 2023


Hi,

This patch allows changing file permissions via ftp.
Mode is limited to octal values (no a+rwx etc.) and just access permissions (0777, no suid), like in vsftpd.
Verified with following FTP clients: Midnight Commander, ncftp (in the latter case explicit chmod command is needed).
Without this patch the executable bit is lost and you have to recover permissions of uploaded files on your own.

function                                             old     new   delta
ftpd_main                                           2061    2280    +219
.rodata                                            33114   33120      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 225/0)             Total: 225 bytes
   text	   data	    bss	    dec	    hex	filename
 300584	   1331	   1212	 303127	  4a017	busybox_old
 300809	   1331	   1212	 303352	  4a0f8	busybox_unstripped
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 012-ftpd-site_chmod.patch
Type: text/x-patch
Size: 2134 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20230602/af7de583/attachment.bin>


More information about the busybox mailing list