Please direct all questions, comments, and suggestions to: Brent Hendricks hendri27@cps.msu.edu The chmodder program is a small, simple utility for ensuring that the permissions are set correctly in a directory hierarchy. When run, it descends through the directory tree and changes the permissions of all the files and directories owned whomever ran the script. (All files/directories permissions will be changes if the user running the script has root priviledges) The script can also be used to change the group ownership of the contained files if a group name is specified on the command line, and the user running the script is indeed a member of the specified group. Instructions: -Place the chmodder file in the highest directory level of your tree. (For EE482 design groups, this will be /web/classes/ee482/designX where X is your design group number) *NOTE* The following commands must be executed on a UNIX station, or in a telnet session to a UNIX station. -Change the group ownership of the chmodder script. This is done with the following command: chgrp XXXXX chmodder (where XXXX is your group name). -Change the permsissions of the chmodder program to be execuatable by yourself and your group. This is done with the following command: chmod 770 chmodder -Be sure that you are in the directory that contains the chmodder program. This is important. The chmodder program begins recursing through subdirectories from whatever directory YOU are currently in. -Run the chmodder script simply be typing: chmodder. It will then recurse through the current directory and all subdirectories and change the permission on oall of the files which you own. If you provide your group name as a command line argument it will also change the group ownership. -In order to keep the permissions correct, each member of the group who adds/changes files will need to run the chmodder script before he/she logs out. While this may seem tedious, it beats changing permissions manually on a large number of files. Technical Notes: -This script was written in Perl5, and expects it to be installed in /opt/bin. This is true for the MSU engineering UNIX labs. -Directories will be given the permissions 2770 and all other files will be given the permissions 660. The exception to this is any directory named web, and it's files and subdirectories. Since these files need to be world-accessible, directories in the web hierarchy will be given permissions of 2775 and files will be given permissions of 664. -There is already a description of UNIX permissions on the EE482 website. I do not wish to duplicate that material, however I would like to mention the use of the setgid bit. When this bit is set on a directory file, files created in that directory will be owned by the group which owns the directory. (This is not 100% true when accessing files through DOS/Windows) This makes directories easier to maintain because you don't need to issue a chgrp command for every file. The setgid bit is set by prepending a 2 to the permissions when executing a chmod command. This is why the chmodder script changes directories to permissions 2770, and not 770. When set, this bit will appear as an 's' where the 'x' would normally appear in the group perssions block. Example: drwxrws--- 2 hendri27 ee482d3 512 Oct 3 14:27 reports ^ Whether or not the group has execute permissions is now indicated by the case of 's'. A lower-case 's' indicates the the groups HAS execute permissions, whicle an uppercase 'S' indicates that the group does not.