Files and Directories FAQ

1999/12/05 by Crescent


Q: How do I change the owner and access rights/permissions of a directory ?
A: Log into the site and use the commands:
SITE CHOWN to change the owner and group and
SITE CHMOD and SITE CHMODR to change the permissions
of the directory.

Q: I do a "site chmod", but it doesn't change the permissions of the files. Likewise, "site chown" doesn't seem to have any effect.
A: First, check that you have the syntax right. Assuming that you do, this is probably caused by problems with permissions at the shell level. For example, you might be running your daemon as a user that does not have sufficient permissions to write the .permission file into the file directories. Check the permissions, chown if necessary from your shell, and try again; all should be fixed.

Q: I want directories or filesystems, which are mounted anywhere in the directory tree to appear as subdirectories in the site. The base directory of my site is in a completely different tree, so how do I do this ?
A: Create a symbolic link from anywhere within your site to the directory in the (system's) directory tree. Example:
Your FTP4ALL site uses basedir /site. When someone logs in, he sees /site as root directory. You have a CDROM, which is mounted on /cdrom. You want that the user sees this directory as subdirectory of his root directory. So you simply do a:
ln -s /cdrom /site/CD-ROM
When the user does a directory listing, he sees a directory called CD-ROM.

Q: OK, the directory appears, but no user has access to it. In the directory listing appears "nobody" as owner and there are no rights set.
Q: I can't use FTP4ALL with my CD-ROM drive ? I think it's because of this permission files, because it displays nobody as owner, and I cannot access it. How to fix it ?

A: FTP4ALL has it's own permissions, and yes it doesn't know how to handle a directory which misses the permission file. However, there is a special option to mount directories with predefined permissions into the directory tree, called the cdpath-option. There is a separate configuration file called cdpath.cfg that holds this information. To stick to the previous example, you should insert a line that reads like:
/CD-ROM 0 0 0x7F2323
More information here, the permission flags are documented here.

Q: Why can't I upload any files with long filenames ?
Q: What is this "edit variable MAXFILENAMELENGTH in src/tweak.h now" thing ?

A: FTP4ALL uses its own permission system. The permissions are stored in permission files, usualy named ".permissions". This file is created by the daemon in any directory to which ftp4all has write access. It contains a list with the names and permissions of each file in the directory. The filename field in this file is limited by the MAXFILENAMELENGTH variable. So, if you want to have files with filenames of more than 32 characters (default), you should edit this constant before compiling.

Q: I've been running a site with the default MAXFILENAMELENGTH. Now I want to increase this value. What do I have to do ?
A: Set the MAXFILENAMELENGTH in src/tweak.h to the desired value and compile a new daemon. Then stop the old daemon and DELETE ALL PERMISSION FILES, e.g. with the command rm `find /site -name .permissions`. This is necessary because the permission files are in a format that the new daemon does not understand. Then start the new daemon and change the permissions of the directories with the SITE CHMOD and SITE CHMODR commands.