22.12.2012 Views

Front cover - IBM Redbooks

Front cover - IBM Redbooks

Front cover - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example: B-3 UNIX-specific code<br />

/*************************************************************************<br />

PROGRAM: SECDOM<br />

FILE: U_SECDOM.C (Unix specific code)<br />

PURPOSE: C API Sample program that illustrates how to create a library that will, from<br />

the web, authenticate a Domino user through his Operating System user account<br />

via DSAPI.<br />

*************************************************************************/<br />

/* Input and output include files */<br />

#include <br />

#include <br />

#include <br />

/* unix authentication includes */<br />

#ifdef SOLARIS<br />

#include <br />

#endif<br />

#ifdef AIX<br />

#include <br />

#include <br />

#endif<br />

int unixAuthenticate(char *userName, char *password)<br />

{<br />

char buffer[1024];<br />

int error = -1;<br />

int success = 0;<br />

int unknown = 1;<br />

/* Get the unix record for this user */<br />

#ifdef SOLARIS<br />

struct spwd result;<br />

#endif<br />

#ifdef AIX<br />

struct passwd *result;<br />

#endif<br />

/* Get the unix record for this user */<br />

#ifdef SOLARIS<br />

Appendix B. A sample DSAPI program 655

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!