[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Setting file sharing permissions?



I'm trying to plug a security hole in Personal File Sharing, which 
is exhibiting itself when running NetPresenz.  A co-worker of mine
is looking for a solution in Frontier, and I'm seeing if I can find
a solution with MacPerl.

Here's the problem.

You share a directory.  You assign that directory so that "Everyone" 
can "See Folders" and "Make Changes", but not "See Files".  The intention
is to make an ftp incoming directory which can be used to drop files off,
but for which a guest user can't see the files that other people have 
put there.

This works, and you can impose this permission structure on a hierarchy
of directories.  "Make Changes" will allow user anonymous to create a
new directory.  The owner of the new directory becomes "<Any User>" and
has all permissions enabled for that user.  Effectively, making it 
possible to turn "See Files" on for some part within the "incoming"
directory.

What I'm thinking.

I'd like to set up a simple cron job to watch a given directory on the
server and impose the proper owner and permission structure on all 
new directories which get created in it.

I was hoping that I could use 'chmod' within MacPerl to change the 
permissions, but to my limited testing, chmod appears to be a null
function, and chown unimplemented (for rather obvious reasons - there's
no notion of numerical uid or gid under MacOS).

We tried to record the Finder actions with Frontier.  It only seemed
to be able to record selecting the directory, opening the Personal
File Sharing Window and closing the window again.  None of the
selections seemed to be settable.

Is there a way to do this with Perl, or would I be better off using 
something else, like KeyQuencer?

Thanks in Advance,

-Charles Albrecht
 charlesa@aol.net