Home
| Calendar
| Mail Lists
| List Archives
| Desktop SIG
| Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU |
Derek Martin wrote: > I'd use Python or C (or <shudder> Perl for this). > >>>> import stat, os >>>> mode = os.stat(".bashrc") >>>> print ((mode.st_mode | stat.S_IWGRP) and mode.st_gid == 0) > False Shudder yourself. This operation is perfectly legible in Perl: use File::stat; use Fcntl qw(S_IWGRP S_IWOTH); # import fcntl.h symbols my $fs = stat($filename); print "$filename is group or other writable\n" if $fs && $fs->mode & (S_IWGRP | S_IWOTH); (Are you sure your code tests that the file is group or other writable? You seem to be only testing for group write and that the group owner is root.) -Tom -- Tom Metro Venture Logic, Newton, MA, USA "Enterprise solutions through open source." Professional Profile: http://tmetro.venturelogic.com/
BLU is a member of BostonUserGroups | |
We also thank MIT for the use of their facilities. |