Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

network security & moreunix



I am using moreunix and having a problem in moreunixread. I call moreunixread from MoreSecHelperToolMain. The MoreSecHelperToolMain's code is:

AuthorizationExternalForm extAuth;
// The caller gave us a AuthorizationRef, but we're don't use
// it in this case. Just throw it away.
if( auth != NULL )
{
#if MORE_DEBUG
fprintf( stderr, "MoreSecurity: MoreSecHelperToolMain: auth != NULL, about to call AuthorizationFree...\n" );
#endif
junk = AuthorizationFree( auth, kAuthorizationFlagDefaults );
assert( junk == noErr );
auth = NULL;
}
// Started directly by the application. Read the authorization
// "byte blob" from our input, and use that to create our
// AuthorizationRef.
err = MoreUNIXRead( fdIn, &extAuth, sizeof(extAuth), NULL );



When I call moreunixread, I set fdIn to STDIN_FILENO. The problem I get is at the read. At this point, the computer hangs. Has anyone seen this problem before and know what to do? Quinn wrote both bits of source.


extern int MoreUNIXRead( int fd, void *buf, size_t bufSize, size_t *bytesRead )
// See comment in header.
{
int err;
char * cursor;
size_t bytesLeft;
ssize_t bytesThisTime;

assert(fd >= 0);
assert(buf != NULL);


err = 0;
bytesLeft = bufSize;
cursor = (char *) buf;
while ( (err == 0) && (bytesLeft != 0) ) {
bytesThisTime = read(fd, cursor, bytesLeft);

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.