• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Making folders and files as non-admin user [WAS: Re: Privileged shutdown]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making folders and files as non-admin user [WAS: Re: Privileged shutdown]


  • Subject: Making folders and files as non-admin user [WAS: Re: Privileged shutdown]
  • From: Paul Berkowitz <email@hidden>
  • Date: Sat, 24 Jul 2004 11:13:43 -0700

On 7/24/04 6:46 AM, "Axel Luttgens" <email@hidden> wrote:

> First,
> do shell script "<some command>" with administrator privileges
> in fact results in executing:
> sudo <some command>
> By default, only users in the 'admin' group are allowed to do a 'sudo'.
> And by default, a 'sudo' performed by those users will execute <some
> command> as user 'root'.
> So, yes, the current user (the one who is logged in and executing the
> script) as to be an administrator.

A related question. I want my script (actually an AS-S app) to create a
folder and a file in /Library/Application Support/. But when logged in as a
standard, non-admin user, it doesn't have permission. I suppose that's
understandable.

The best solution to this is if I could throw up a dialog asking for an
admin name and password, like you see when doing very sorts of installing in
non-admin users. I have no problem with requiring an admin to do the first
run in any user. After first run, this file will only have to be read, not
written to. Unfortunately even AS-S dialogs don't have a password format
(bullets) and I don't want to license 24U just for this, but that's a side
issue. It's too cumbersome to force admins to install first in an admin user
- I'd like any user to be accessible. There are certainly lots of
applications that put things in this folder. It may be possible to chmod the
permissions on the folder temporarily, make the folder and file. then
restore them. Doing that after entering a password would be acceptable, if
it's considered ethical.

Has anyone gone this route before? Creating a folder and file in
/Library/Application Support/ or just /Library when in a non-admin user? Is
there an easy way?

My script first tries to get the Finder to do it and, on error , do shell
script "mkdir" . Both fail.

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Making folders and files as non-admin user [WAS: Re: Privileged shutdown]
      • From: Axel Luttgens <email@hidden>
    • Re: Making folders and files as non-admin user [WAS: Re: Privileged shutdown]
      • From: John Stewart <email@hidden>
References: 
 >Re: Privileged shutdown (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Getting the default language with AppleScript
  • Next by Date: Re: Getting the default language with AppleScript
  • Previous by thread: Re: Privileged shutdown
  • Next by thread: Re: Making folders and files as non-admin user [WAS: Re: Privileged shutdown]
  • Index(es):
    • Date
    • Thread