Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to build a dynamic module using ld

Status
Not open for further replies.

zym123

Programmer
Jul 1, 2003
2
CN
Hi,
I want to build a loadable authentication module on AIX 4.3.3.The operations are:

1 cc -c SAMBA.c
success
2 ld -o SAMBA SAMBA.o -bM:SRE -e SAMBA_initialize
error£º
ld: 0711-327 WARNING: Entry point not found: SAMBA_initialize
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
Can anyone give me some advice?

the SAMBA.C

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
#include <usersec.h>




/* the smb authentication method */
static int SAMBA_authenticate(char* ntuser,
char* passwd,
int* reenter,
char** msg)
{
#ifdef SMB_DEBUG
printf(&quot;user : %s, password : %s\n&quot;, ntuser, passwd);
#endif

*reenter = 0;
printf(&quot;SAMBA: authentication ok for user : %s\n&quot;, ntuser);
return 0;
}


/*
* This is the module entry point
*
* Note : I'm not sure the prototype is correct (it's why I added the
&quot;...&quot;
* as second parameter). I'm not even sure the return value is
meaningfull.
*/
int SAMBA_initialize(struct secmethod_table* method, ...)
{
memset(method, 0, sizeof(*method)); /* should I do that ??? */

/* set the authentication routine */
method->method_authenticate = SAMBA_authenticate;

/* do I have to fill the other method ??? */

/* meaningfull ??? */
return 0;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top