Page 1 of 1

Change Permissions and Move file

PostPosted: Mon Apr 10, 2017 5:11 pm
by cholder
Hi

I have a spot that files are downloaded from the internet RSS feed, and then that file is in turn loaded into a program to be actioned. It seems the last apple update broke permissions.

I am trying to use Hazel to change the permissions to the correct setting for the program to be able to use the file.

I have a file in a folder called test permissions.
the Hazel script calls a script in this folder (~/Desktop/testpriv/changePer.sh)

It's a very simple script

*************
#!/bin/sh

sudo chown -R username:staff /Users/crholder/Desktop/From\ Internet

**********
it was returning this error from the hazel logs
Shellscript exited with non-successful status code: 126

I modified the script to be executable and now it returns this
Shellscript exited with non-successful status code: 1

Any help would be appreciated.

Re: Change Permissions and Move file

PostPosted: Tue Apr 11, 2017 11:13 am
by Mr_Noodle
Note that "sudo" may require you to enter a password, which Hazel cannot do for you. You'd need to do something like using a setuid bit on the script instead, which is very unsafe and not recommended.

Re: Change Permissions and Move file

PostPosted: Fri Apr 14, 2017 4:10 pm
by cholder
Tried taking the sudo out, still won't run

Is there another way to set permissions?

Re: Change Permissions and Move file

PostPosted: Mon Apr 17, 2017 10:37 am
by Mr_Noodle
You have to also setuid it to run as root. Search around on how to do that. Again, though, it's a potential security hole so make sure you read up on it fully.