The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Set owner of folder xxx to -1 (http://hintsforums.macworld.com/showthread.php?t=27177)

hayne 08-25-2004 10:26 AM

Quote:

Originally Posted by AHunter3
The script itself, later on in the same day, will need to do so as yet another job gets started. If Job ABCDE is created within the Client X folder, and then things are done to lock the Job ABCDE folder, I still need users to be able to run the AppleScript that creates the folders for Job FGHIJ also within the Client X folder.

I was assuming that you would run the script that created the folders, thus the script would have your permissions, the folders would be created as owned by you, etc. That was the scenario I outlined above.
If the script is not going to be run from your account, then you could make use of setuid functionality to have it effectively run as you.
See 'man chmod' and look at the section on "set-user-ID-on-execution bit".
You set this bit with 'chmod +s name_of_script'

AHunter3 08-25-2004 01:08 PM

I never got a really specific "yes that would work" response to my question, but I'd like to try doing the following:

•*use SSH session to set the permissions of the enclosing (Client X) folder so that all Job folders within it are locked (but not their contents).

• also use SSH session before creating new Job Folders within Client X folder, to temporarily un-set those permissions so things can be created within Client X again, briefly; run the AppleScript; then, from SSH session, set the permissions back again.

So, in baby talk, character for character exactly as I would type the string, what do I type on the command line so as to make the folders within Client X folder protected? What do I type to turn it back off again later? And where does this "sticky bit" thing come into play?

(I have read man pages and tutorials and still don't get it. Please help?)

AHunter3 08-25-2004 01:38 PM

Actually, I just got off the phone with xinet, and it appears that there is a way to set the appletalk "Can't move, rename or delete this item (locked)" flag on a folder from the SSH Unix command line.

I'll post again with specifics if I get that working, and if that works it looks easier than the Unix solution (which would require resetting the Client folder's permissions every time a new Job folder is created).

AHunter3 08-25-2004 01:53 PM

Got it :)

/usr/etc/appletalk/kats -l /path/to/folder

That locks the sucker from the command line for AppleShare/AppleTalk users, doing exactly what checking the little checkbox does in the Mac GUI. That checkbox, incidentally, is not visible at all in any shape way or form from a MacOS X Finder but setting that flag locks the folder for MacOS X clients as well.

This is probably xinet-specific.


All times are GMT -5. The time now is 05:57 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.