• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: POSIX file permissions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX file permissions


  • Subject: Re: POSIX file permissions
  • From: Tommy Bollman <email@hidden>
  • Date: Fri, 11 Feb 2011 18:46:57 +0100

Hello.
Try googling for an mktemp script (bash/sh?), if mktemp isn't already implemented on your system. I know there is at least one over at macscripter.net.
HTH
Tommy
Den 10. feb. 2011 kl. 15.14 skrev Axel Luttgens:

> Le 9 févr. 2011 à 17:45, Hudson Barton a écrit :
>
>> I have the following script:
>>
>> property fin : "/private/tmp/in.txt"
>> property fout : "/private/tmp/out.txt"
>> property finmac : POSIX file fin
>> property foutmac : POSIX file out
>>
>> dostuff("blah blah blah", fin, fout, finmac, foutmac)
>>
>> on dostuff(sometext, fin, fout, finmac, foutmac)
>> 	open for access finmac with write permission
>> 	set eof finmac to 0
>> 	write (sometext as string) to finmac
>> 	close access finmac
>> end dostuff
>>
>> The script runs fine on one user, but when I move it to any other user, it produces the error "Network file permission error." number -5000 from file "Macintosh HD:private:tmp:in.txt"  at open for access finmac.
>
>
> Hello Hudson,
>
> Let's say user "jimmy" is the first one to run above script.
> This will create file "in.txt" with following permissions:
>
> 	-rw-r--r--@ 1 jimmy wheel 14 10 fév 14:26 /private/tmp/in.txt
>
> It appears that the owner of the file is "jimmy"; this is quite logical, since Jimmy has created that file.
>
> The group asigned to that file is "wheel"; that's a standard unix default behavior: the group is inherited from the directory where the item is created. And indeed, one has:
>
> 	drwxrwxrwt 31 root wheel 1054 10 fév 14:26 /private/tmp
>
> As a result, user "jimmy" may read from and write to file "in.txt" ("rw-"), members of group "wheel" may read from that file ("r--"), and all other users may read from that file as well ("r--"). Again, this is quite a usual default behavior in the unix world.
>
> It is to be noted that Jimmy has an additional privilege upon file "in.txt": since directory "/private/tmp" is sticky, as indicated by letter "t" appearing at the end of the permissions, Jimmy is the only one to be able to remove that file from its enclosing directory.
>
>
>> What's going on?
>
> If you now ask user "joe" to run the script while file "in.txt" created by Jimmy still exists, there will be a problem: Joe belongs to "all other users" and thus doesn't have the required rights.
>
>
>> I don't understand permissions on POSIX files, or more especially how to fix it.
>
> The fix would depend on the workflow you are considering.
> For example, do you need to have Jimmy, Joe and Sue to be able to write to the same file?
>
> Axel
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>

Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
	If an idea can survive a bureaucratic review
	and be implemented it wasn't worth doing.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >POSIX file permissions (From: Hudson Barton <email@hidden>)
 >Re: POSIX file permissions (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
  • Next by Date: More weird problems
  • Previous by thread: Re: POSIX file permissions
  • Next by thread: Re: POSIX file permissions
  • Index(es):
    • Date
    • Thread