• 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: Tomas Zahradnicky <email@hidden>
  • Date: Mon, 27 Jan 2003 12:34:27 +0100

Hello Quinn,

your sample looks great. However I have few comments.

Shouldn't one close stdin and stdout prior dup2-ing something into their numbers (MoreSecExecuteRequestInHelperTool)?

MoreSecurity.c : 1578

and second question. wouldn't better be to call vfork instead of fork? that need not to copy the whole address space and if you're willing to use exec, then it would be better.



third thing. MoreSecurity.c : 463 & 533 & ..., there's
assert(fdIn >= 0);
assert(fdOut >= 0);

but zero is valid file descriptor. I suggest testing it either against -1 (invalid fd) or against > 0. what if you do:

close(0);
fdIn = dup2(1,0);

then you had stdout with fd = 0 :-)

also, calls to UNIX read/write can get interrupted with signals such as alarm. There should probably be test for EINTR to happen and retry it rather then returning an error.

CopyDictionaryFromDescriptor & WriteDictionaryToDescriptor functions will crash on free if dictBuffer failed... or is valid to call free(NULL)?.. this shows more times in the file...

-Tomas
--
# Tomas Zahradnicky, Jr
# The Czech Technical University
# Dept of Computer Science, FEE-CTU Prague
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

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

  • Prev by Date: Re: OTNotifier in shared libraries
  • Next by Date: Re: MoreAuthSample
  • Previous by thread: MoreAuthSample
  • Next by thread: Re: MoreAuthSample
  • Index(es):
    • Date
    • Thread