I'll look into this tonight - but if you want some speculation before
I leave for work, I think you're right to suspect it's simply not
being called. You might have better results using the lower-level
FSEvents API - it's slightly different in that FSEvents will only tell
you when a directory has changed so you'd basically need to look for
changes to the desktop and scan for .apps. The good news about
FSEvents is that it's a low-level API and should catch things which
the higher level workspace notifications are missing.
The config file will be (IIRC) something like this:
<key>FSEvents</key>
<dict>
<key>/Users/foo/Desktop</key>
<dict>
<key>method</key>
<array>
<string>CopyBlocker</string>
<string>onFileOperation</string>
</array>
</dict>
</dict>
Chris
> We have some problems when users copy a .app folder to their desktop
> when trying to put it on their dock; specifically, this prevents
> network users from logging in. Also, I'm aware of another system
> administrator who wants to prevents students from copying .apps to
> their USB drives.
Trying to catch this by watching filesystem events is the wrong
approach, you will always be chasing after things. The better
approach, at least for users who aren't going to resort to the command
line, is to prevent the Finder from copying the apps. There is an easy
trick to this: put a folder inside the .app bundles (next to
"Contents") that starts with "A" and don't give users read or execute
permissions on that folder (I would go with root:wheel:0000). When the
Finder enumerates the files it is going to copy it will run into that
and stop.
This is easy to circumvent by either copying things by opening
the .app bundle, or by working on the command line, but it does put up
a big enough barrier that most users won't be able to cross it.
--
Karl Kuehn
lar...@softhome.net
I did forget to mention that there is one dark side to doing this: it
breaks application signing. Apple has only started to use this, so
unless you are using MCX to restrict what applications a user can use
this will have no effect at the moment (this needs to be reviewed when
10.6 comes out). You can still work with it, you just have to make
sure that the application signing happens with your modification in
place. For a lab image this should be very doable.
--
Karl Kuehn
lar...@softhome.net
> We have some problems when users copy a .app folder to their desktop
> when trying to put it on their dock; specifically, this prevents
> network users from logging in. Also, I'm aware of another system
> administrator who wants to prevents students from copying .apps to
> their USB drives.
Is the problem you're trying to prevent specifically with the applications
in the Dock? Do you care if applications are copied elsewhere if they don't
prevent network users from logging in?
--
Jeremy
Ditto if students can _delete_ applications from the /Applications
folder.
I'd fix the basic permissions issues before I went scripting elaborate
workarounds.
-Greg