Cyrus-sasl 2.2.0.15 (?!) headers - Mac OS X 10.4+

Sebastian Hagedorn Hagedorn at uni-koeln.de
Wed Nov 21 15:44:06 EST 2007


-- Evan Schoenberg <evan at adiumx.com> is rumored to have mumbled on 19. 
November 2007 13:14:51 -0600 regarding Re: Cyrus-sasl 2.2.0.15 (?!) headers 
- Mac OS X 10.4+:

>> I don't think you can read the version number that way. Internally
>> it's 2.1.18.I'm not sure how Apple number their libraries.
> Ah! Thanks.  Is there a way I could have found that out without asking
> the list, or is it just Something One Knows?

No. I did it the lazy way:

% strings /usr/lib/libsasl2.dylib | grep 2\.1
2.1.18

But you can also do it the official way, e.g. something like this (probably 
way more #includes than necessary):

#include <stdio.h>
#include <strings.h>
#include <ctype.h>
#include <assert.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "sysexits.h"

#include "sasl.h"

void saslerr(int why, const char *what)
{
	  fprintf(stderr, "%s: %s", what, sasl_errstring(why, NULL, NULL));
}

void saslfail(int why, const char *what)
{
	    saslerr(why, what);
	        exit(EX_TEMPFAIL);
}


int main(int argc, char *argv[])
{
    sasl_conn_t *conn;

    int r;
    int sasl_version_number = 0;
    const char *sasl_implementation;
	
    /* initialize the sasl library */
    r = sasl_client_init(NULL);
    if (r != SASL_OK) saslfail(r, "initializing libsasl");

    sasl_implementation = (char *) malloc(80);
    sasl_version(&sasl_implementation, &sasl_version_number);
    printf("Locally used implementation: %s, version: %d.%d.%d\n", 
sasl_implementation,
        sasl_version_number >> 24, (sasl_version_number >> 16) & 0xFF, 
sasl_version_number & 0xFFFF);

    sasl_dispose(&conn);
    sasl_done();
	
	return 0;
}
--
Sebastian Hagedorn - RZKR-R1 (Flachbau), Zi. 18, Robert-Koch-Str. 10
Zentrum für angewandte Informatik - Universitätsweiter Service RRZK
Universität zu Köln / Cologne University - Tel. +49-221-478-5587
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : https://lists.andrew.cmu.edu/mailman/private/cyrus-sasl/attachments/20071121/90b8e9fd/attachment.bin 


More information about the Cyrus-sasl mailing list