• 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: MoreAuthSample
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MoreAuthSample


  • Subject: Re: MoreAuthSample
  • From: Quinn <email@hidden>
  • Date: Tue, 21 Mar 2006 11:55:30 +0000

At 21:32 +0000 20/3/06, Andy Cave wrote:
However, I think I have one more previously unknown issue with AuthorizationExecuteWithPrivileges which is not dealt with in your code. If the file descriptors for stdin and stdout have been closed, then AuthorizationExecuteWithPrivileges silently fails(!!). [...]

Question is, can you confirm that this is a bug in AEWP and not covered in your code?

Let me get this straight. You're saying that, if file descriptors 0 and 1 are closed in the /application/, AEWP fails silently? Interesting. I've not encountered it before. Closing the standard file descriptors in an application is quite unusual. [It's common to do in a daemon, but daemons don't go around calling AEWP.]


Looking at the code, it seems that both MoreAuthSample and Authorization Services suffer from problems with 0 and 1 are closed. Code like this:

  err = socketpair(..., fds);

  err = dup(fds[0], 0);
  err = dup(fds[1], 1);

runs into trouble if fds contains low numbers.

Traditionally, one does not close these low numbered descriptors; instead, you open /dev/null and dup it down on to them.

Still, smells like a bug to me.  Please feel free to file it.

<http://developer.apple.com/bugreporter/>

[In general DTS asks developers to file their own bugs because it emphasises that the issue is affecting real developers. Also, it has the added benefit that you can track the bug's status yourself.]

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: MoreAuthSample
      • From: "Andy Cave" <email@hidden>
References: 
 >Re: MoreAuthSample (From: "Andy Cave" <email@hidden>)

  • Prev by Date: RE: OTEnterNotifier
  • Next by Date: Re: MoreAuthSample
  • Previous by thread: Re: MoreAuthSample
  • Next by thread: Re: MoreAuthSample
  • Index(es):
    • Date
    • Thread