hurbas

Q: TextEdit quarantines files

After an OS X Lion update which happened this afternoon, TextEdit is suddenly behaving in a strange way.

When I open a bash script with TextEdit and leave the script unchanged, the script still runs normally.

But as soon as I hit any key on the keyboard (even without saving the file), the script cannot be run any

more and, assuming the script's name is kaps, I get this message:

 

-bash: ./kaps: Operation not permitted

 

If I issue the command xattr kaps, I get this:

 

com.apple.TextEncoding

com.apple.quarantine

 

If I reset the xattr, the file will run again, but as soon as I modify the script with TextEdit, the above

happens again. And this occurs with any script (old or new).

 

Strangely enough, this seems to affect only files run with the  x attribute (chmod +x), because, even

if they are now quarantined, the scripts can be run if sourced (ex:   . kaps  o r   bash ./kaps).

 

Any idea how to prevent TextEdit from arbitrarily quarantining the files it edits?

iMac (21.5-inch Late 2009), Mac OS X (10.7.2)

Posted on Feb 2, 2012 10:55 PM

Close

Q: TextEdit quarantines files

  • All replies
  • Helpful answers

  • by Thomas Halenbeck,

    Thomas Halenbeck Thomas Halenbeck Feb 9, 2012 9:39 AM in response to hurbas
    Level 2 (395 points)
    Feb 9, 2012 9:39 AM in response to hurbas

    Same here. After updateing to 10.7.3 all my Shellscripts do not run anymore.

     

        -bash: ./my_shellscript.sh: Operation not permitted

     

    I have no idea. All permission are still as correct as they used to be prior 10.7.3. To say it harmless: Lion is not the best Apple ever made. I do not like it to much

  • by hurbas,

    hurbas hurbas Feb 9, 2012 2:36 PM in response to Thomas Halenbeck
    Level 1 (0 points)
    Feb 9, 2012 2:36 PM in response to Thomas Halenbeck

    I just discovered that since I did this Lion upgrade TextEdit now considers ANY file (old or new) as freshly downloaded from the internet and therefore treats it as a potential hazard.

    Very annoying.

    Hope someone will post a technique which will permit to stop this behavior by TextEdit.

    Thanks in advance for any insight from anyone.

  • by Thomas Halenbeck,

    Thomas Halenbeck Thomas Halenbeck Feb 9, 2012 11:38 PM in response to hurbas
    Level 2 (395 points)
    Feb 9, 2012 11:38 PM in response to hurbas

    Yep, same here as well. I had this symptom as well. Not with all files but with some.

    No idea what happened, since it is not reproducable. Just the same as with my "Operation not permitted" problem. I found out that this is not reproducable as well!  It happened that I just needed to open the ShellScript  with TextEdit. Just to open it was sufficient No changes, nothing! If I now started the script on the command line it worked as expected !!!???   Lion is

  • by tombaeyens,

    tombaeyens tombaeyens May 8, 2012 2:04 AM in response to hurbas
    Level 1 (0 points)
    May 8, 2012 2:04 AM in response to hurbas

    Same problem here.  It seems silly that you're not allowed to execute a shell script that you just edited in TextEdit.

  • by Bradley Ross,

    Bradley Ross Bradley Ross May 22, 2012 6:49 AM in response to hurbas
    Level 1 (70 points)
    May 22, 2012 6:49 AM in response to hurbas

    It looks like using XCode to edit script files does not set the flags.