• 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
Re: Mount With Password
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mount With Password


  • Subject: Re: Mount With Password
  • From: Axel Luttgens <email@hidden>
  • Date: Mon, 29 Mar 2010 00:05:19 +0200

Le 28 mars 2010 à 23:05:50, Luther Fuller a écrit :

> I have created a sparsebundle image file encrypted with the password "abcd".
> When I do this from the terminal ...
>
> $ echo -n abcd | hdiutil attach -stdinpass /Users/lutherfuller/Desktop/PassWordTest.sparsebundle
>
> The disk mounts correctly.
>
> But, I want to do this from an AppleScript, so I do this ...
>
> set imageAlias to alias "OS_X:Users:lutherfuller:Desktop:PassWordTest.sparsebundle"
> quoted form of (POSIX path of imageAlias)
> do shell script "echo -n abcd | hdiutil attach -stdinpass " & the result
>
> The disk does not mount and I get "hdiutil: attach failed - Authentication error".
> Anyone know why?

Hello Luther,

Apparently because stdin isn't a tty in the context created by "do shell script":

	do shell script "test -t 0; echo $?"
	--> 1

On the other hand, without the -stdinpass, hdiutil should raise a password dialog with the option to save the password in the user's keychain; in all cases, this would be safer than having a cleartext password stored in a script...


HTH,
Axel

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Mount With Password
      • From: Luther Fuller <email@hidden>
References: 
 >Mount With Password (From: Luther Fuller <email@hidden>)

  • Prev by Date: Mount With Password
  • Next by Date: Re: Mount With Password
  • Previous by thread: Mount With Password
  • Next by thread: Re: Mount With Password
  • Index(es):
    • Date
    • Thread