What does errAuthorizationToolEnvironmentError mean?

  • I'm using AuthorizationExecuteWithPrivileges() to run /bin/rm within
    some uninstaller code.  I thought I had everything working, but today
    it returned errAuthorizationToolEnvironmentError, which according to
    the docs means "The attempt to execute the tool failed to return a
    success or an error code."  What does this mean?  Under what
    circumstances might rm return nothing?  The arguments I'm passing are
    "-rf" and the fully qualified path name, which contains a space but no
    wildcards or any other special characters.

    In case it matters, I call AuthorizationExecuteWithPrivileges() a few
    times with the same AuthorizationRef.

    --Andy
  • On Jan 22, 2009, at 6:48 PM, Andy Lee wrote:

    > I'm using AuthorizationExecuteWithPrivileges() to run /bin/rm within
    > some uninstaller code.  I thought I had everything working, but
    > today it returned errAuthorizationToolEnvironmentError, which
    > according to the docs means "The attempt to execute the tool failed
    > to return a success or an error code."  What does this mean?  Under
    > what circumstances might rm return nothing?  The arguments I'm
    > passing are "-rf" and the fully qualified path name, which contains
    > a space but no wildcards or any other special characters.
    >
    > In case it matters, I call AuthorizationExecuteWithPrivileges() a
    > few times with the same AuthorizationRef.

    Andy,

    I don't know why you are running into this problem. Chances are others
    might not know either. This is not a sanctioned/supported use of AEWP.

    In other words, if the answer to the problem is to (repeatedly) call
    rm, cp, mv or chmod via AEWP, the problem is usually misdefined.

    Generally, you want to factor out the code that needs elevated
    privileges into your own tool, and execute that using Authorization
    Services. There is sample code on developer.apple.com which does this.

    Jim
  • On Jan 22, 2009, at 11:03 PM, Jim Correia wrote:
    > I don't know why you are running into this problem. Chances are
    > others might not know either. This is not a sanctioned/supported use
    > of AEWP.
    >
    > In other words, if the answer to the problem is to (repeatedly) call
    > rm, cp, mv or chmod via AEWP, the problem is usually misdefined.
    >
    > Generally, you want to factor out the code that needs elevated
    > privileges into your own tool, and execute that using Authorization
    > Services. There is sample code on developer.apple.com which does this.

    Thanks, Jim.  I see advice on another thread as well to look at
    Apple's sample code.  In this case the "sample code" I looked at was
    code I inherited. :)

    --Andy
previous month january 2009 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today