Page 1 of 1

File rename command and issue with privileges

Posted: Tue Dec 01, 2020 7:09 pm
by Simon Knight
Hi,

I am in the process of writing a utility to conduct the batch renaming of files in my user account. Unfortunately some files have "custom privileges" set and can not be renamed unless I enter my account password. My Livecode application just ignores them and moves along. I have checked with Apple and they suggest that the privileges should be left as is and that my application or my command should be granted SUDO privileges. I wonder if there is anyway of granting a Livecode Application the SUDO privilege ?

This is an example of a file with custom privileges which I now know means "too complicated for the get info window". They have probably come about by either being created on a Windows machine or round tripping via Windows.

Code: Select all

drwxr-xr-x@  4 skids  staff        128  7 Nov  2019 SCR IOA_Build18.rtfd
This command works when issued in the Terminal but it requires a password :

Code: Select all

sudo mv "SCR IOA_Build18.rtfd" SCRIOA_Build18.rtfd
So is there anyway of granting my application permission to rename all files ?

best wishes

Simon

Re: File rename command and issue with privileges

Posted: Sat Dec 26, 2020 2:25 pm
by Bernard
if there is anyway of granting a Livecode Application the SUDO privilege
sudo (generally) requires a password. The standard way round this is to edit the sudoers file to stipulate that a particular account name should not require a password.

If this is for a convenience utility for yourself you could do this. If it was for a utility for other people to use, I suspect it's too complex/undesirable for most users to implement.

The entry in the sudoers file for nopasswd can point to an individual program to run.
https://www.oreilly.com/library/view/li ... 05s04.html

Suggest you look further into sudoers file, particularly the issues with editing it correctly.

Re: File rename command and issue with privileges

Posted: Sat Dec 26, 2020 6:06 pm
by FourthWorld