File rename command and issue with privileges

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

File rename command and issue with privileges

Post by Simon Knight » Tue Dec 01, 2020 7:09 pm

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
best wishes
Skids

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: File rename command and issue with privileges

Post by Bernard » Sat Dec 26, 2020 2:25 pm

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: File rename command and issue with privileges

Post by FourthWorld » Sat Dec 26, 2020 6:06 pm

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Mac OS”