Results 1 to 2 of 2
Hiya,
Im looking for a program or script that could show me a list of file and folders that a specified user could access if they were logged in.
Eg, ...
- 02-25-2004 #1Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
What could a user see if they were logged in?
Hiya,
Im looking for a program or script that could show me a list of file and folders that a specified user could access if they were logged in.
Eg, out of all the files on the harddrive, what would user "X" be able to read?
Anyone know of a script/program that does this?
Thanks,
Jason
- 02-29-2004 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
I don't think that there is a command that can do that, but, correct me if I'm wrong, shouldn't it be possible to do it something like this (running as the user to check):
Code:#!/bin/sh function checkdir { for f in "$1"*; do if [ -d "$f" ]; then if [ -r "$f" -a -x "$f" ]; then checkdir "$f/" elif [ -r "$f" ]; then echo "$f" elif [ -x "$f" ]; then echo "half-warning: $f is executable, but not readable" fi fi if [ -f "$f" -a -r "$f" ]; then echo "$f" fi done } checkdir /


Reply With Quote
