You can't change the permissions of a directory that you don't own. /tmp is a system directory owned by root. Only root should be changing the permissions of /tmp. The permissions you want (1777) are the permissions that /tmp should have.
It is the ownership on the target that prevent this and not the execute permissions of /bin/chmod. The denial comes from the kernel.
In other words, the chmod command tries to run the system command to change the permissions, and the kernel refuses and returns an error to the chmod command which in turn returns with an error when it exits.
It is the kernel which performs these types of operations. It checks the permissions and ownerships. It also checks extended permissions (see man getfacl) and extended attributes (see man lsattr) as well.
Also, bear in mind that the filesystem contains the ownership and permissions of files. A foreign filesystem such as fat32 doesn't use unix inodes, do you can't use chmod and chown.
Last edited by jschiwal; 11-08-2008 at 06:20 PM.