zsh-users
 help / color / mirror / code / Atom feed
* "operation not permitted"
@ 2019-09-04 10:42 ` TJ Luoma
  2019-09-04 10:57   ` Peter Stephenson
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: TJ Luoma @ 2019-09-04 10:42 UTC (permalink / raw)
  To: Zsh MailingList

I just did a clean install of macOS 13 (High Sierra) and have
encountered a few zsh shell scripts which say "operation not
permitted" when I try to run them

      zsh: operation not permitted: register-fluid.sh

but if I do this

     zsh =register-fluid.sh

then it works fine.

The shell script is in my $PATH and is executable. It's not doing
anything fancy. In fact I can include it here.

#!/usr/bin/env zsh -f
# Purpose:
#
# From:     Timothy J. Luoma
# Mail:     luomat at gmail dot com
# Date:     2019-09-04

NAME="$0:t:r"

if [[ -e "$HOME/.path" ]]
then
     source "$HOME/.path"
else
     PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
fi

TARGET="${HOME}/Library/Application Support/Fluid/TimothyLuoma.fluid2license"

if [[ -e "$TARGET" ]]
then
     echo "$NAME: '$TARGET' already exists."
     exit 0
fi

[[ ! -d "$TARGET:h" ]] && mkdir -p "$TARGET:h"

cp -vn "$HOME/.config/licenses/fluid/TimothyLuoma.fluid2license" "$TARGET"

exit 0
#EOF

Any ideas why I'm getting "operation not permitted" for this?

Thanks!

Tj

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "operation not permitted"
  2019-09-04 10:42 ` "operation not permitted" TJ Luoma
@ 2019-09-04 10:57   ` Peter Stephenson
  2019-09-04 11:11     ` TJ Luoma
  2019-09-04 14:09   ` TJ Luoma
  2019-09-04 20:15   ` Bart Schaefer
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2019-09-04 10:57 UTC (permalink / raw)
  To: zsh-users

On Wed, 2019-09-04 at 06:42 -0400, TJ Luoma wrote:
> I just did a clean install of macOS 13 (High Sierra) and have
> encountered a few zsh shell scripts which say "operation not
> permitted" when I try to run them
> 
>       zsh: operation not permitted: register-fluid.sh
> 
> but if I do this
> 
>      zsh =register-fluid.sh
> 
> then it works fine.

What do

which register-fluid.sh

and

ls -l $(which register-fluid.sh)

say?

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "operation not permitted"
  2019-09-04 10:57   ` Peter Stephenson
@ 2019-09-04 11:11     ` TJ Luoma
  2019-09-04 11:14       ` TJ Luoma
  0 siblings, 1 reply; 6+ messages in thread
From: TJ Luoma @ 2019-09-04 11:11 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh MailingList

On Wed, Sep 4, 2019 at 6:58 AM Peter Stephenson
<p.stephenson@samsung.com> wrote:
> What do
>
> which register-fluid.sh
>
> and
>
> ls -l $(which register-fluid.sh)
>
> say?

/usr/local/scripts/register-fluid.sh

and

-rwxr-xr-x 1 luomat wheel 607 Sep  4 06:45 /usr/local/scripts/register-fluid.sh

respectively

PATH is /usr/local/sbin:/usr/local/di:/usr/local/scripts:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/luomat/.iterm2
in case that matters.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "operation not permitted"
  2019-09-04 11:11     ` TJ Luoma
@ 2019-09-04 11:14       ` TJ Luoma
  0 siblings, 0 replies; 6+ messages in thread
From: TJ Luoma @ 2019-09-04 11:14 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh MailingList

Here's a weird thing:

I have recently started using

#!/usr/bin/env zsh -f

at the top of my shell scripts, so they will use /usr/local/bin/zsh if
installed or /bin/zsh if not.

If I change that to

#!/bin/zsh -f

then the script will not give the "operation not permitted" error.

And once I run it that way, I can change it back to

#!/usr/bin/env zsh -f

and it will work again.

I don't understand this at all, but maybe someone else might?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "operation not permitted"
  2019-09-04 10:42 ` "operation not permitted" TJ Luoma
  2019-09-04 10:57   ` Peter Stephenson
@ 2019-09-04 14:09   ` TJ Luoma
  2019-09-04 20:15   ` Bart Schaefer
  2 siblings, 0 replies; 6+ messages in thread
From: TJ Luoma @ 2019-09-04 14:09 UTC (permalink / raw)
  To: Zsh MailingList

It appears that this may have something to do with macOS's
"Quarantine" system and be related to the fact that these scripts were
"downloaded" from another Mac. I'm still trying to figure out exactly
what was the cause but the fix seems to be running this:

find /path/to/file/ -exec xattr -d com.apple.quarantine {} 2> /dev/null \;

on any "offending" scripts.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "operation not permitted"
  2019-09-04 10:42 ` "operation not permitted" TJ Luoma
  2019-09-04 10:57   ` Peter Stephenson
  2019-09-04 14:09   ` TJ Luoma
@ 2019-09-04 20:15   ` Bart Schaefer
  2 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2019-09-04 20:15 UTC (permalink / raw)
  To: TJ Luoma; +Cc: Zsh MailingList

On Wed, Sep 4, 2019 at 3:44 AM TJ Luoma <luomat@gmail.com> wrote:
>
> I just did a clean install of macOS 13 (High Sierra) and have
> encountered a few zsh shell scripts which say "operation not
> permitted" when I try to run them
>
>       zsh: operation not permitted: register-fluid.sh

Either /usr/bin/env is having a problem, or something in the script is.

What happens if you run "/usr/bin/env zsh" from the command line?

Next would be to try putting "set -x" (or equivalently "setopt
xtrace") at the top of the file, so you can see it running and
identify the line with the problem.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-04 23:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190904104432epcas3p2d0825a22892c5a329241cd63d2d78ee6@epcas3p2.samsung.com>
2019-09-04 10:42 ` "operation not permitted" TJ Luoma
2019-09-04 10:57   ` Peter Stephenson
2019-09-04 11:11     ` TJ Luoma
2019-09-04 11:14       ` TJ Luoma
2019-09-04 14:09   ` TJ Luoma
2019-09-04 20:15   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).