Write a python program to do some file system checks as indicated below. Submit your commented program and a sample output.
1) Do checks related to the PATH variable.
(a) Check to see if the PATH variable contains . (current directory) and give an error message if it does.
(b) Check the executable programs that exist in each of the directories specified by PATH. You should check to see which programs have the setuid bit turned on and which have write permission for anyone other than the owner. The output should be three listings of the full path names of problem files: (1) those with the setuid bit on and writable by non-owner first, (2) those with the setuid bit on but only writable by the owner second, and (3) those with the setuid bit off and writable by non-owner last. Each group of file names should be sorted alphabetically.
2) Do checks related to the contents of the /etc directory and its subdirectories:
(a) Check for any files in /etc that have write access by anyone other than root. Display these files with their name, owner name and permissions, alphabetically ordered by file name.
(b) Check if any files in /etc have been modified in the past 24 hours (look at the time module for useful functions). List these by file name and time modified, sorted by modify time.
(c) Check if any files in /etc have had their properties changed in the past 24 hours. List these by file name, permissions and time changed, sorted by change time.
|Due By (Pacific Time)
||04/11/2014 12:00 am