PDA

View Full Version : Complete 4 digit CHMOD


epp_b
03-23-2003, 08:15 PM
Would it be possible for FlashFXP to have the ability to CHMOD files to 4 digits, instead of 3, via checkboxes?

You can already use advanced permission settings (like set GID, set UID, and sticky) by typing in four digits for the permissions. They just aren't displayed in the permissions dialogue, and are not available to be changed via checkboxes.

eg.:


owner: read/write/exec
group: read
public: read

-rw-r--r


FlashFXP will read this in as 744

Technically, the permissions should be 0744.

bigstar
03-24-2003, 03:28 AM
Do you have complete documentation on 4 digit CHMOD, or can you provide me with more information?

Also is this supported by all ftp servers?

epp_b
03-24-2003, 11:11 AM
Nothing official, but take a look at http://www.eng.ufl.edu/cgi-bin/html-man-page?page=chmod

As far as I know, this should be supported by any FTP server running on *nix.

darkone
03-28-2003, 06:58 AM
Originally posted by epp_b
Would it be possible for FlashFXP to have the ability to CHMOD files to 4 digits, instead of 3, via checkboxes?

FlashFXP will read this in as 744

Technically, the permissions should be 0744.

This is not entirely true (from linux man page):

A numeric mode is from one to four octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. Any omitted digits are assumed to be leading zeros.

What comes to setting 'sticky' bits (the missing octal), I see no reason to set them via ftp client.

Raccoon
03-28-2003, 03:15 PM
First time I've ever heard of a 4 digit CHMOD, and I'm the one who designed the CHMOD dialog in FFXP (if I recall) :D

There MAY be some servers that support it, just like some servers support the SITE command, but it is definitely no standard mentioned in any RFC I've ever read.

If it increases in popularity among multiple platforms or popular FTPd's, I'm sure Charles may be willing to add a detection that includes a 4th permission column.

There is one bug with FFXP now with this brings to light. When adding preceeding digits to the CHMOD value, the checkboxes align to the left of the digits, not the right...

That is: 0777 (the check boxes see 077, not 777)

We have to also make sure that older FTP servers are not confused the same way. If FFXP passes 0777 to older servers, they may interpret it as 077 as well.

- Raccoon

darkone
03-28-2003, 11:59 PM
I'd assume that all servers are using strtoul(,,8) & bitwise operators to convert permissions to machine readable form;

& 0001 // Executable (other)
& 0002 // Writable
& 0004 // Readable
& 0010 // Executable (group)
& 0020
& 0040
& 0100 // Executable (user)
& 0200
& 0400

Therefore 4digit form should work as well.

hw_tph
04-10-2003, 04:00 AM
I'm just curious and going out on a limb here: I would too like 4-digit chmodding, since some of the applications I often run on servers require specific 4-digit permission flags.

An example: Pine, at least when running on x86/Linux, won't accept (0)777 (drwxrwxrwx) as permissions for /var/spool/mail - it wants 1777 (drwxrwxrwt) in order to function properly.

Now, when I usually do this I have to ssh to the host in case and do the chmodding from the command line.


hw

bigstar
04-10-2003, 04:48 AM
4 digit chmod was added in the latest public beta

hw_tph
04-10-2003, 04:58 AM
*smacks himself*

Thanks a million, I'll go get it. :)

hw