Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Alex Baule
Humm... if you get the remote ip, sometimes the PAM don't have this
information to use...

Well...it's better you do the plugin.



2010/11/16 Antonio Perez-Aranda 

> It take login user, pass and other dat from connection like remote ip
> and send to a Java App with special security. If the result of Java
> App is correct (more difficult to explain), then it pass ask to
> standard courier ldap plugin.
>
> 2010/11/16 Alex Baule :
> > What the preauthcustom.c does ? something special or setting some rights
> > from users ?
> >
> > If was only auth, PAM is much more easy
> >
> > 2010/11/16 Antonio Perez-Aranda 
> >
> >> Maybe, but I haven't got any experience with PAM modules as with
> dovecot.
> >>
> >> I have a preauthcustom.c from courier which I have to migrate to
> dovecot.
> >>
> >> 2010/11/16 Alex Baule :
> >> > Dovecot plugins works with hooks. This hooks allow you customize some
> >> > actions.
> >> >
> >> > You need to find the authentication hook, and rewrite it's actions.
> >> >
> >> > Inside the userdb.c have it void userdbs_init(void), but you change
> the
> >> > shared name, so you need to change inside your plugin too.
> >> >
> >> > But, you're trying to do something with auth, you can use PAM, it's
> more
> >> > easy. (i think)
> >> >
> >> > 2010/11/16 Antonio Perez-Aranda 
> >> >
> >> >> Well, all modules start with ifdef like this:
> >> >>
> >> >> #ifdef USERDB_CUSTOM
> >> >>
> >> >> And in this case, this isn't defined. I commet out this ifdef/else/if
> >> >> block and then I have got more errors, I can continure.
> >> >>
> >> >> 2010/11/16 Antonio Perez-Aranda :
> >> >> > Not, userdb-custom and passdb-custom are copies from
> >> >> > userdb-passwd-file and passdb-passwd-file.
> >> >> >
> >> >> > I try with this function now, thanks.
> >> >> >
> >> >> > 2010/11/16 Alex Baule :
> >> >> >> inside your plugin, have this function ? 
> >> >> >>
> >> >> >> Every plugin must have a "init" function and it must call
> >> >> "plugin-name_init"
> >> >> >>
> >> >> >>
> >> >> >> 2010/11/16 Antonio Perez-Aranda 
> >> >> >>
> >> >> >>> Is it needed to include custom db on usedb.c and passdb.c ?
> >> >> >>>
> >> >> >>> I can see at userdb.c:
> >> >> >>>
> >> >> >>> void userdbs_init(void)
> >> >> >>>
> >> >> >>> with all userdb registered, and similar at passdb.c
> >> >> >>>
> >> >> >>>
> >> >> >>> At now, I get the follow line loading the module and trying to
> >> access
> >> >> >>> vía imap login
> >> >> >>>
> >> >> >>> Nov 16 17:54:28 auth: Error: module
> >> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so:
> >> dlsym(authdb_custom_init)
> >> >> >>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined
> >> symbol:
> >> >> >>> authdb_custom_init
> >> >> >>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
> >> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> 2010/11/16 Antonio Perez-Aranda :
> >> >> >>> > Well, I didn't execute ./configure on $DOVECOT path
> >> >> >>> >
> >> >> >>> > 2010/11/16 Antonio Perez-Aranda :
> >> >> >>> >>  gcc -fPIC -shared -g -Wall \
> >> >> >>> >>  -I$DOVECOT \
> >> >> >>> >>  -I$DOVECOT/src/lib \
> >> >> >>> >>  -I$DOVECOT/src/lib-auth  \
> >> >> >>> >>  -I$DOVECOT/src/lib-sql \
> >> >> >>> >>  -I$DOVECOT/src/lib-settings \
> >> >> >>> >>  -I$DOVECOT/src/lib-ntlm \
> >> >> >>> >>  -I$DOVECOT/src/lib-master \
> >> >> >>> >>  -I$DOVECOT/src/auth \
> >> >> >>> >>  -DHAVE_CONFIG_H \
> >> >> >>> >>  -DAUTH_MODULE_DIR=\"passdb-custom\"\
> >> >> >>> >>  passdb-custom.c -o passdb-custom.o
> >> >> >>> >>
> >> >> >>> >> With this I get:
> >> >> >>> >>
> >> >> >>> >> error on auth-common.h
> >> >> >>> >> ...
> >> >> >>> >> config.h Not found.
> >> >> >>> >>
> >> >> >>> >>
> >> >> >>> >> But config.h are in $DOVECOT path
> >> >> >>> >>
> >> >> >>> >>
> >> >> >>> >> 2010/11/15 Timo Sirainen :
> >> >> >>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
> >> >> >>> >>>
> >> >> >>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
> >> >> >>>  -I$DOVECOT/src/lib \
> >> >> >>>  -I$DOVECOT/src/lib-auth  \
> >> >> >>>  -I$DOVECOT/src/lib-sql \
> >> >> >>>  -I$DOVECOT/src/lib-settings \
> >> >> >>>  -I$DOVECOT/src/lib-ntlm \
> >> >> >>>  -I$DOVECOT/src/lib-master \
> >> >> >>>  -I$DOVECOT/src/auth \
> >> >> >>>  passdb-passwd-file.c -o passdb-passwd-file.o
> >> >> >>> 
> >> >> >>>  With this, I get errors relate with uoff_t
> >> >> >>> >>>
> >> >> >>> >>> You need to add -DHAVE_CONFIG_H
> >> >> >>> >>>
> >> >> >>> >>>
> >> >> >>> >>
> >> >> >>> >
> >> >> >>>
> >> >> >>
> >> >> >
> >> >>
> >> >
> >>
> >
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
It take login user, pass and other dat from connection like remote ip
and send to a Java App with special security. If the result of Java
App is correct (more difficult to explain), then it pass ask to
standard courier ldap plugin.

2010/11/16 Alex Baule :
> What the preauthcustom.c does ? something special or setting some rights
> from users ?
>
> If was only auth, PAM is much more easy
>
> 2010/11/16 Antonio Perez-Aranda 
>
>> Maybe, but I haven't got any experience with PAM modules as with dovecot.
>>
>> I have a preauthcustom.c from courier which I have to migrate to dovecot.
>>
>> 2010/11/16 Alex Baule :
>> > Dovecot plugins works with hooks. This hooks allow you customize some
>> > actions.
>> >
>> > You need to find the authentication hook, and rewrite it's actions.
>> >
>> > Inside the userdb.c have it void userdbs_init(void), but you change the
>> > shared name, so you need to change inside your plugin too.
>> >
>> > But, you're trying to do something with auth, you can use PAM, it's more
>> > easy. (i think)
>> >
>> > 2010/11/16 Antonio Perez-Aranda 
>> >
>> >> Well, all modules start with ifdef like this:
>> >>
>> >> #ifdef USERDB_CUSTOM
>> >>
>> >> And in this case, this isn't defined. I commet out this ifdef/else/if
>> >> block and then I have got more errors, I can continure.
>> >>
>> >> 2010/11/16 Antonio Perez-Aranda :
>> >> > Not, userdb-custom and passdb-custom are copies from
>> >> > userdb-passwd-file and passdb-passwd-file.
>> >> >
>> >> > I try with this function now, thanks.
>> >> >
>> >> > 2010/11/16 Alex Baule :
>> >> >> inside your plugin, have this function ? 
>> >> >>
>> >> >> Every plugin must have a "init" function and it must call
>> >> "plugin-name_init"
>> >> >>
>> >> >>
>> >> >> 2010/11/16 Antonio Perez-Aranda 
>> >> >>
>> >> >>> Is it needed to include custom db on usedb.c and passdb.c ?
>> >> >>>
>> >> >>> I can see at userdb.c:
>> >> >>>
>> >> >>> void userdbs_init(void)
>> >> >>>
>> >> >>> with all userdb registered, and similar at passdb.c
>> >> >>>
>> >> >>>
>> >> >>> At now, I get the follow line loading the module and trying to
>> access
>> >> >>> vía imap login
>> >> >>>
>> >> >>> Nov 16 17:54:28 auth: Error: module
>> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so:
>> dlsym(authdb_custom_init)
>> >> >>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined
>> symbol:
>> >> >>> authdb_custom_init
>> >> >>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
>> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> 2010/11/16 Antonio Perez-Aranda :
>> >> >>> > Well, I didn't execute ./configure on $DOVECOT path
>> >> >>> >
>> >> >>> > 2010/11/16 Antonio Perez-Aranda :
>> >> >>> >>  gcc -fPIC -shared -g -Wall \
>> >> >>> >>      -I$DOVECOT \
>> >> >>> >>      -I$DOVECOT/src/lib \
>> >> >>> >>      -I$DOVECOT/src/lib-auth  \
>> >> >>> >>      -I$DOVECOT/src/lib-sql \
>> >> >>> >>      -I$DOVECOT/src/lib-settings \
>> >> >>> >>      -I$DOVECOT/src/lib-ntlm \
>> >> >>> >>      -I$DOVECOT/src/lib-master \
>> >> >>> >>      -I$DOVECOT/src/auth \
>> >> >>> >>      -DHAVE_CONFIG_H \
>> >> >>> >>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>> >> >>> >>      passdb-custom.c -o passdb-custom.o
>> >> >>> >>
>> >> >>> >> With this I get:
>> >> >>> >>
>> >> >>> >> error on auth-common.h
>> >> >>> >> ...
>> >> >>> >> config.h Not found.
>> >> >>> >>
>> >> >>> >>
>> >> >>> >> But config.h are in $DOVECOT path
>> >> >>> >>
>> >> >>> >>
>> >> >>> >> 2010/11/15 Timo Sirainen :
>> >> >>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>> >> >>> >>>
>> >> >>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
>> >> >>>      -I$DOVECOT/src/lib \
>> >> >>>      -I$DOVECOT/src/lib-auth  \
>> >> >>>      -I$DOVECOT/src/lib-sql \
>> >> >>>      -I$DOVECOT/src/lib-settings \
>> >> >>>      -I$DOVECOT/src/lib-ntlm \
>> >> >>>      -I$DOVECOT/src/lib-master \
>> >> >>>      -I$DOVECOT/src/auth \
>> >> >>>      passdb-passwd-file.c -o passdb-passwd-file.o
>> >> >>> 
>> >> >>>  With this, I get errors relate with uoff_t
>> >> >>> >>>
>> >> >>> >>> You need to add -DHAVE_CONFIG_H
>> >> >>> >>>
>> >> >>> >>>
>> >> >>> >>
>> >> >>> >
>> >> >>>
>> >> >>
>> >> >
>> >>
>> >
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Alex Baule
What the preauthcustom.c does ? something special or setting some rights
from users ?

If was only auth, PAM is much more easy

2010/11/16 Antonio Perez-Aranda 

> Maybe, but I haven't got any experience with PAM modules as with dovecot.
>
> I have a preauthcustom.c from courier which I have to migrate to dovecot.
>
> 2010/11/16 Alex Baule :
> > Dovecot plugins works with hooks. This hooks allow you customize some
> > actions.
> >
> > You need to find the authentication hook, and rewrite it's actions.
> >
> > Inside the userdb.c have it void userdbs_init(void), but you change the
> > shared name, so you need to change inside your plugin too.
> >
> > But, you're trying to do something with auth, you can use PAM, it's more
> > easy. (i think)
> >
> > 2010/11/16 Antonio Perez-Aranda 
> >
> >> Well, all modules start with ifdef like this:
> >>
> >> #ifdef USERDB_CUSTOM
> >>
> >> And in this case, this isn't defined. I commet out this ifdef/else/if
> >> block and then I have got more errors, I can continure.
> >>
> >> 2010/11/16 Antonio Perez-Aranda :
> >> > Not, userdb-custom and passdb-custom are copies from
> >> > userdb-passwd-file and passdb-passwd-file.
> >> >
> >> > I try with this function now, thanks.
> >> >
> >> > 2010/11/16 Alex Baule :
> >> >> inside your plugin, have this function ? 
> >> >>
> >> >> Every plugin must have a "init" function and it must call
> >> "plugin-name_init"
> >> >>
> >> >>
> >> >> 2010/11/16 Antonio Perez-Aranda 
> >> >>
> >> >>> Is it needed to include custom db on usedb.c and passdb.c ?
> >> >>>
> >> >>> I can see at userdb.c:
> >> >>>
> >> >>> void userdbs_init(void)
> >> >>>
> >> >>> with all userdb registered, and similar at passdb.c
> >> >>>
> >> >>>
> >> >>> At now, I get the follow line loading the module and trying to
> access
> >> >>> vía imap login
> >> >>>
> >> >>> Nov 16 17:54:28 auth: Error: module
> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so:
> dlsym(authdb_custom_init)
> >> >>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined
> symbol:
> >> >>> authdb_custom_init
> >> >>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
> >> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so
> >> >>>
> >> >>>
> >> >>>
> >> >>> 2010/11/16 Antonio Perez-Aranda :
> >> >>> > Well, I didn't execute ./configure on $DOVECOT path
> >> >>> >
> >> >>> > 2010/11/16 Antonio Perez-Aranda :
> >> >>> >>  gcc -fPIC -shared -g -Wall \
> >> >>> >>  -I$DOVECOT \
> >> >>> >>  -I$DOVECOT/src/lib \
> >> >>> >>  -I$DOVECOT/src/lib-auth  \
> >> >>> >>  -I$DOVECOT/src/lib-sql \
> >> >>> >>  -I$DOVECOT/src/lib-settings \
> >> >>> >>  -I$DOVECOT/src/lib-ntlm \
> >> >>> >>  -I$DOVECOT/src/lib-master \
> >> >>> >>  -I$DOVECOT/src/auth \
> >> >>> >>  -DHAVE_CONFIG_H \
> >> >>> >>  -DAUTH_MODULE_DIR=\"passdb-custom\"\
> >> >>> >>  passdb-custom.c -o passdb-custom.o
> >> >>> >>
> >> >>> >> With this I get:
> >> >>> >>
> >> >>> >> error on auth-common.h
> >> >>> >> ...
> >> >>> >> config.h Not found.
> >> >>> >>
> >> >>> >>
> >> >>> >> But config.h are in $DOVECOT path
> >> >>> >>
> >> >>> >>
> >> >>> >> 2010/11/15 Timo Sirainen :
> >> >>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
> >> >>> >>>
> >> >>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
> >> >>>  -I$DOVECOT/src/lib \
> >> >>>  -I$DOVECOT/src/lib-auth  \
> >> >>>  -I$DOVECOT/src/lib-sql \
> >> >>>  -I$DOVECOT/src/lib-settings \
> >> >>>  -I$DOVECOT/src/lib-ntlm \
> >> >>>  -I$DOVECOT/src/lib-master \
> >> >>>  -I$DOVECOT/src/auth \
> >> >>>  passdb-passwd-file.c -o passdb-passwd-file.o
> >> >>> 
> >> >>>  With this, I get errors relate with uoff_t
> >> >>> >>>
> >> >>> >>> You need to add -DHAVE_CONFIG_H
> >> >>> >>>
> >> >>> >>>
> >> >>> >>
> >> >>> >
> >> >>>
> >> >>
> >> >
> >>
> >
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
Maybe, but I haven't got any experience with PAM modules as with dovecot.

I have a preauthcustom.c from courier which I have to migrate to dovecot.

2010/11/16 Alex Baule :
> Dovecot plugins works with hooks. This hooks allow you customize some
> actions.
>
> You need to find the authentication hook, and rewrite it's actions.
>
> Inside the userdb.c have it void userdbs_init(void), but you change the
> shared name, so you need to change inside your plugin too.
>
> But, you're trying to do something with auth, you can use PAM, it's more
> easy. (i think)
>
> 2010/11/16 Antonio Perez-Aranda 
>
>> Well, all modules start with ifdef like this:
>>
>> #ifdef USERDB_CUSTOM
>>
>> And in this case, this isn't defined. I commet out this ifdef/else/if
>> block and then I have got more errors, I can continure.
>>
>> 2010/11/16 Antonio Perez-Aranda :
>> > Not, userdb-custom and passdb-custom are copies from
>> > userdb-passwd-file and passdb-passwd-file.
>> >
>> > I try with this function now, thanks.
>> >
>> > 2010/11/16 Alex Baule :
>> >> inside your plugin, have this function ? 
>> >>
>> >> Every plugin must have a "init" function and it must call
>> "plugin-name_init"
>> >>
>> >>
>> >> 2010/11/16 Antonio Perez-Aranda 
>> >>
>> >>> Is it needed to include custom db on usedb.c and passdb.c ?
>> >>>
>> >>> I can see at userdb.c:
>> >>>
>> >>> void userdbs_init(void)
>> >>>
>> >>> with all userdb registered, and similar at passdb.c
>> >>>
>> >>>
>> >>> At now, I get the follow line loading the module and trying to access
>> >>> vía imap login
>> >>>
>> >>> Nov 16 17:54:28 auth: Error: module
>> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
>> >>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
>> >>> authdb_custom_init
>> >>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
>> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so
>> >>>
>> >>>
>> >>>
>> >>> 2010/11/16 Antonio Perez-Aranda :
>> >>> > Well, I didn't execute ./configure on $DOVECOT path
>> >>> >
>> >>> > 2010/11/16 Antonio Perez-Aranda :
>> >>> >>  gcc -fPIC -shared -g -Wall \
>> >>> >>      -I$DOVECOT \
>> >>> >>      -I$DOVECOT/src/lib \
>> >>> >>      -I$DOVECOT/src/lib-auth  \
>> >>> >>      -I$DOVECOT/src/lib-sql \
>> >>> >>      -I$DOVECOT/src/lib-settings \
>> >>> >>      -I$DOVECOT/src/lib-ntlm \
>> >>> >>      -I$DOVECOT/src/lib-master \
>> >>> >>      -I$DOVECOT/src/auth \
>> >>> >>      -DHAVE_CONFIG_H \
>> >>> >>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>> >>> >>      passdb-custom.c -o passdb-custom.o
>> >>> >>
>> >>> >> With this I get:
>> >>> >>
>> >>> >> error on auth-common.h
>> >>> >> ...
>> >>> >> config.h Not found.
>> >>> >>
>> >>> >>
>> >>> >> But config.h are in $DOVECOT path
>> >>> >>
>> >>> >>
>> >>> >> 2010/11/15 Timo Sirainen :
>> >>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>> >>> >>>
>> >>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
>> >>>      -I$DOVECOT/src/lib \
>> >>>      -I$DOVECOT/src/lib-auth  \
>> >>>      -I$DOVECOT/src/lib-sql \
>> >>>      -I$DOVECOT/src/lib-settings \
>> >>>      -I$DOVECOT/src/lib-ntlm \
>> >>>      -I$DOVECOT/src/lib-master \
>> >>>      -I$DOVECOT/src/auth \
>> >>>      passdb-passwd-file.c -o passdb-passwd-file.o
>> >>> 
>> >>>  With this, I get errors relate with uoff_t
>> >>> >>>
>> >>> >>> You need to add -DHAVE_CONFIG_H
>> >>> >>>
>> >>> >>>
>> >>> >>
>> >>> >
>> >>>
>> >>
>> >
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Alex Baule
Dovecot plugins works with hooks. This hooks allow you customize some
actions.

You need to find the authentication hook, and rewrite it's actions.

Inside the userdb.c have it void userdbs_init(void), but you change the
shared name, so you need to change inside your plugin too.

But, you're trying to do something with auth, you can use PAM, it's more
easy. (i think)

2010/11/16 Antonio Perez-Aranda 

> Well, all modules start with ifdef like this:
>
> #ifdef USERDB_CUSTOM
>
> And in this case, this isn't defined. I commet out this ifdef/else/if
> block and then I have got more errors, I can continure.
>
> 2010/11/16 Antonio Perez-Aranda :
> > Not, userdb-custom and passdb-custom are copies from
> > userdb-passwd-file and passdb-passwd-file.
> >
> > I try with this function now, thanks.
> >
> > 2010/11/16 Alex Baule :
> >> inside your plugin, have this function ? 
> >>
> >> Every plugin must have a "init" function and it must call
> "plugin-name_init"
> >>
> >>
> >> 2010/11/16 Antonio Perez-Aranda 
> >>
> >>> Is it needed to include custom db on usedb.c and passdb.c ?
> >>>
> >>> I can see at userdb.c:
> >>>
> >>> void userdbs_init(void)
> >>>
> >>> with all userdb registered, and similar at passdb.c
> >>>
> >>>
> >>> At now, I get the follow line loading the module and trying to access
> >>> vía imap login
> >>>
> >>> Nov 16 17:54:28 auth: Error: module
> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
> >>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
> >>> authdb_custom_init
> >>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
> >>> /usr/lib64/dovecot/auth/libauthdb_custom.so
> >>>
> >>>
> >>>
> >>> 2010/11/16 Antonio Perez-Aranda :
> >>> > Well, I didn't execute ./configure on $DOVECOT path
> >>> >
> >>> > 2010/11/16 Antonio Perez-Aranda :
> >>> >>  gcc -fPIC -shared -g -Wall \
> >>> >>  -I$DOVECOT \
> >>> >>  -I$DOVECOT/src/lib \
> >>> >>  -I$DOVECOT/src/lib-auth  \
> >>> >>  -I$DOVECOT/src/lib-sql \
> >>> >>  -I$DOVECOT/src/lib-settings \
> >>> >>  -I$DOVECOT/src/lib-ntlm \
> >>> >>  -I$DOVECOT/src/lib-master \
> >>> >>  -I$DOVECOT/src/auth \
> >>> >>  -DHAVE_CONFIG_H \
> >>> >>  -DAUTH_MODULE_DIR=\"passdb-custom\"\
> >>> >>  passdb-custom.c -o passdb-custom.o
> >>> >>
> >>> >> With this I get:
> >>> >>
> >>> >> error on auth-common.h
> >>> >> ...
> >>> >> config.h Not found.
> >>> >>
> >>> >>
> >>> >> But config.h are in $DOVECOT path
> >>> >>
> >>> >>
> >>> >> 2010/11/15 Timo Sirainen :
> >>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
> >>> >>>
> >>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
> >>>  -I$DOVECOT/src/lib \
> >>>  -I$DOVECOT/src/lib-auth  \
> >>>  -I$DOVECOT/src/lib-sql \
> >>>  -I$DOVECOT/src/lib-settings \
> >>>  -I$DOVECOT/src/lib-ntlm \
> >>>  -I$DOVECOT/src/lib-master \
> >>>  -I$DOVECOT/src/auth \
> >>>  passdb-passwd-file.c -o passdb-passwd-file.o
> >>> 
> >>>  With this, I get errors relate with uoff_t
> >>> >>>
> >>> >>> You need to add -DHAVE_CONFIG_H
> >>> >>>
> >>> >>>
> >>> >>
> >>> >
> >>>
> >>
> >
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
Well, all modules start with ifdef like this:

#ifdef USERDB_CUSTOM

And in this case, this isn't defined. I commet out this ifdef/else/if
block and then I have got more errors, I can continure.

2010/11/16 Antonio Perez-Aranda :
> Not, userdb-custom and passdb-custom are copies from
> userdb-passwd-file and passdb-passwd-file.
>
> I try with this function now, thanks.
>
> 2010/11/16 Alex Baule :
>> inside your plugin, have this function ? 
>>
>> Every plugin must have a "init" function and it must call "plugin-name_init"
>>
>>
>> 2010/11/16 Antonio Perez-Aranda 
>>
>>> Is it needed to include custom db on usedb.c and passdb.c ?
>>>
>>> I can see at userdb.c:
>>>
>>> void userdbs_init(void)
>>>
>>> with all userdb registered, and similar at passdb.c
>>>
>>>
>>> At now, I get the follow line loading the module and trying to access
>>> vía imap login
>>>
>>> Nov 16 17:54:28 auth: Error: module
>>> /usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
>>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
>>> authdb_custom_init
>>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
>>> /usr/lib64/dovecot/auth/libauthdb_custom.so
>>>
>>>
>>>
>>> 2010/11/16 Antonio Perez-Aranda :
>>> > Well, I didn't execute ./configure on $DOVECOT path
>>> >
>>> > 2010/11/16 Antonio Perez-Aranda :
>>> >>  gcc -fPIC -shared -g -Wall \
>>> >>      -I$DOVECOT \
>>> >>      -I$DOVECOT/src/lib \
>>> >>      -I$DOVECOT/src/lib-auth  \
>>> >>      -I$DOVECOT/src/lib-sql \
>>> >>      -I$DOVECOT/src/lib-settings \
>>> >>      -I$DOVECOT/src/lib-ntlm \
>>> >>      -I$DOVECOT/src/lib-master \
>>> >>      -I$DOVECOT/src/auth \
>>> >>      -DHAVE_CONFIG_H \
>>> >>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>>> >>      passdb-custom.c -o passdb-custom.o
>>> >>
>>> >> With this I get:
>>> >>
>>> >> error on auth-common.h
>>> >> ...
>>> >> config.h Not found.
>>> >>
>>> >>
>>> >> But config.h are in $DOVECOT path
>>> >>
>>> >>
>>> >> 2010/11/15 Timo Sirainen :
>>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>>> >>>
>>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
>>>      -I$DOVECOT/src/lib \
>>>      -I$DOVECOT/src/lib-auth  \
>>>      -I$DOVECOT/src/lib-sql \
>>>      -I$DOVECOT/src/lib-settings \
>>>      -I$DOVECOT/src/lib-ntlm \
>>>      -I$DOVECOT/src/lib-master \
>>>      -I$DOVECOT/src/auth \
>>>      passdb-passwd-file.c -o passdb-passwd-file.o
>>> 
>>>  With this, I get errors relate with uoff_t
>>> >>>
>>> >>> You need to add -DHAVE_CONFIG_H
>>> >>>
>>> >>>
>>> >>
>>> >
>>>
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
Not, userdb-custom and passdb-custom are copies from
userdb-passwd-file and passdb-passwd-file.

I try with this function now, thanks.

2010/11/16 Alex Baule :
> inside your plugin, have this function ? 
>
> Every plugin must have a "init" function and it must call "plugin-name_init"
>
>
> 2010/11/16 Antonio Perez-Aranda 
>
>> Is it needed to include custom db on usedb.c and passdb.c ?
>>
>> I can see at userdb.c:
>>
>> void userdbs_init(void)
>>
>> with all userdb registered, and similar at passdb.c
>>
>>
>> At now, I get the follow line loading the module and trying to access
>> vía imap login
>>
>> Nov 16 17:54:28 auth: Error: module
>> /usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
>> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
>> authdb_custom_init
>> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
>> /usr/lib64/dovecot/auth/libauthdb_custom.so
>>
>>
>>
>> 2010/11/16 Antonio Perez-Aranda :
>> > Well, I didn't execute ./configure on $DOVECOT path
>> >
>> > 2010/11/16 Antonio Perez-Aranda :
>> >>  gcc -fPIC -shared -g -Wall \
>> >>      -I$DOVECOT \
>> >>      -I$DOVECOT/src/lib \
>> >>      -I$DOVECOT/src/lib-auth  \
>> >>      -I$DOVECOT/src/lib-sql \
>> >>      -I$DOVECOT/src/lib-settings \
>> >>      -I$DOVECOT/src/lib-ntlm \
>> >>      -I$DOVECOT/src/lib-master \
>> >>      -I$DOVECOT/src/auth \
>> >>      -DHAVE_CONFIG_H \
>> >>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>> >>      passdb-custom.c -o passdb-custom.o
>> >>
>> >> With this I get:
>> >>
>> >> error on auth-common.h
>> >> ...
>> >> config.h Not found.
>> >>
>> >>
>> >> But config.h are in $DOVECOT path
>> >>
>> >>
>> >> 2010/11/15 Timo Sirainen :
>> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>> >>>
>>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
>>      -I$DOVECOT/src/lib \
>>      -I$DOVECOT/src/lib-auth  \
>>      -I$DOVECOT/src/lib-sql \
>>      -I$DOVECOT/src/lib-settings \
>>      -I$DOVECOT/src/lib-ntlm \
>>      -I$DOVECOT/src/lib-master \
>>      -I$DOVECOT/src/auth \
>>      passdb-passwd-file.c -o passdb-passwd-file.o
>> 
>>  With this, I get errors relate with uoff_t
>> >>>
>> >>> You need to add -DHAVE_CONFIG_H
>> >>>
>> >>>
>> >>
>> >
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Alex Baule
inside your plugin, have this function ? 

Every plugin must have a "init" function and it must call "plugin-name_init"


2010/11/16 Antonio Perez-Aranda 

> Is it needed to include custom db on usedb.c and passdb.c ?
>
> I can see at userdb.c:
>
> void userdbs_init(void)
>
> with all userdb registered, and similar at passdb.c
>
>
> At now, I get the follow line loading the module and trying to access
> vía imap login
>
> Nov 16 17:54:28 auth: Error: module
> /usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
> failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
> authdb_custom_init
> Nov 16 17:54:28 auth: Error: Module doesn't have init function:
> /usr/lib64/dovecot/auth/libauthdb_custom.so
>
>
>
> 2010/11/16 Antonio Perez-Aranda :
> > Well, I didn't execute ./configure on $DOVECOT path
> >
> > 2010/11/16 Antonio Perez-Aranda :
> >>  gcc -fPIC -shared -g -Wall \
> >>  -I$DOVECOT \
> >>  -I$DOVECOT/src/lib \
> >>  -I$DOVECOT/src/lib-auth  \
> >>  -I$DOVECOT/src/lib-sql \
> >>  -I$DOVECOT/src/lib-settings \
> >>  -I$DOVECOT/src/lib-ntlm \
> >>  -I$DOVECOT/src/lib-master \
> >>  -I$DOVECOT/src/auth \
> >>  -DHAVE_CONFIG_H \
> >>  -DAUTH_MODULE_DIR=\"passdb-custom\"\
> >>  passdb-custom.c -o passdb-custom.o
> >>
> >> With this I get:
> >>
> >> error on auth-common.h
> >> ...
> >> config.h Not found.
> >>
> >>
> >> But config.h are in $DOVECOT path
> >>
> >>
> >> 2010/11/15 Timo Sirainen :
> >>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
> >>>
>  gcc -fPIC -shared -g -Wall -I$DOVECOT \
>  -I$DOVECOT/src/lib \
>  -I$DOVECOT/src/lib-auth  \
>  -I$DOVECOT/src/lib-sql \
>  -I$DOVECOT/src/lib-settings \
>  -I$DOVECOT/src/lib-ntlm \
>  -I$DOVECOT/src/lib-master \
>  -I$DOVECOT/src/auth \
>  passdb-passwd-file.c -o passdb-passwd-file.o
> 
>  With this, I get errors relate with uoff_t
> >>>
> >>> You need to add -DHAVE_CONFIG_H
> >>>
> >>>
> >>
> >
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
Is it needed to include custom db on usedb.c and passdb.c ?

I can see at userdb.c:

void userdbs_init(void)

with all userdb registered, and similar at passdb.c


At now, I get the follow line loading the module and trying to access
vía imap login

Nov 16 17:54:28 auth: Error: module
/usr/lib64/dovecot/auth/libauthdb_custom.so: dlsym(authdb_custom_init)
failed: /usr/lib64/dovecot/auth/libauthdb_custom.so: undefined symbol:
authdb_custom_init
Nov 16 17:54:28 auth: Error: Module doesn't have init function:
/usr/lib64/dovecot/auth/libauthdb_custom.so



2010/11/16 Antonio Perez-Aranda :
> Well, I didn't execute ./configure on $DOVECOT path
>
> 2010/11/16 Antonio Perez-Aranda :
>>  gcc -fPIC -shared -g -Wall \
>>      -I$DOVECOT \
>>      -I$DOVECOT/src/lib \
>>      -I$DOVECOT/src/lib-auth  \
>>      -I$DOVECOT/src/lib-sql \
>>      -I$DOVECOT/src/lib-settings \
>>      -I$DOVECOT/src/lib-ntlm \
>>      -I$DOVECOT/src/lib-master \
>>      -I$DOVECOT/src/auth \
>>      -DHAVE_CONFIG_H \
>>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>>      passdb-custom.c -o passdb-custom.o
>>
>> With this I get:
>>
>> error on auth-common.h
>> ...
>> config.h Not found.
>>
>>
>> But config.h are in $DOVECOT path
>>
>>
>> 2010/11/15 Timo Sirainen :
>>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>>>
 gcc -fPIC -shared -g -Wall -I$DOVECOT \
     -I$DOVECOT/src/lib \
     -I$DOVECOT/src/lib-auth  \
     -I$DOVECOT/src/lib-sql \
     -I$DOVECOT/src/lib-settings \
     -I$DOVECOT/src/lib-ntlm \
     -I$DOVECOT/src/lib-master \
     -I$DOVECOT/src/auth \
     passdb-passwd-file.c -o passdb-passwd-file.o

 With this, I get errors relate with uoff_t
>>>
>>> You need to add -DHAVE_CONFIG_H
>>>
>>>
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
Well, I didn't execute ./configure on $DOVECOT path

2010/11/16 Antonio Perez-Aranda :
>  gcc -fPIC -shared -g -Wall \
>      -I$DOVECOT \
>      -I$DOVECOT/src/lib \
>      -I$DOVECOT/src/lib-auth  \
>      -I$DOVECOT/src/lib-sql \
>      -I$DOVECOT/src/lib-settings \
>      -I$DOVECOT/src/lib-ntlm \
>      -I$DOVECOT/src/lib-master \
>      -I$DOVECOT/src/auth \
>      -DHAVE_CONFIG_H \
>      -DAUTH_MODULE_DIR=\"passdb-custom\"\
>      passdb-custom.c -o passdb-custom.o
>
> With this I get:
>
> error on auth-common.h
> ...
> config.h Not found.
>
>
> But config.h are in $DOVECOT path
>
>
> 2010/11/15 Timo Sirainen :
>> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>>
>>> gcc -fPIC -shared -g -Wall -I$DOVECOT \
>>>     -I$DOVECOT/src/lib \
>>>     -I$DOVECOT/src/lib-auth  \
>>>     -I$DOVECOT/src/lib-sql \
>>>     -I$DOVECOT/src/lib-settings \
>>>     -I$DOVECOT/src/lib-ntlm \
>>>     -I$DOVECOT/src/lib-master \
>>>     -I$DOVECOT/src/auth \
>>>     passdb-passwd-file.c -o passdb-passwd-file.o
>>>
>>> With this, I get errors relate with uoff_t
>>
>> You need to add -DHAVE_CONFIG_H
>>
>>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-16 Thread Antonio Perez-Aranda
 gcc -fPIC -shared -g -Wall \
  -I$DOVECOT \
  -I$DOVECOT/src/lib \
  -I$DOVECOT/src/lib-auth  \
  -I$DOVECOT/src/lib-sql \
  -I$DOVECOT/src/lib-settings \
  -I$DOVECOT/src/lib-ntlm \
  -I$DOVECOT/src/lib-master \
  -I$DOVECOT/src/auth \
  -DHAVE_CONFIG_H \
  -DAUTH_MODULE_DIR=\"passdb-custom\"\
  passdb-custom.c -o passdb-custom.o

With this I get:

error on auth-common.h
...
config.h Not found.


But config.h are in $DOVECOT path


2010/11/15 Timo Sirainen :
> On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:
>
>> gcc -fPIC -shared -g -Wall -I$DOVECOT \
>>     -I$DOVECOT/src/lib \
>>     -I$DOVECOT/src/lib-auth  \
>>     -I$DOVECOT/src/lib-sql \
>>     -I$DOVECOT/src/lib-settings \
>>     -I$DOVECOT/src/lib-ntlm \
>>     -I$DOVECOT/src/lib-master \
>>     -I$DOVECOT/src/auth \
>>     passdb-passwd-file.c -o passdb-passwd-file.o
>>
>> With this, I get errors relate with uoff_t
>
> You need to add -DHAVE_CONFIG_H
>
>


Re: [Dovecot] Trying to building a customized auth plugin

2010-11-15 Thread Timo Sirainen
On 15.11.2010, at 18.03, Antonio Perez-Aranda wrote:

> gcc -fPIC -shared -g -Wall -I$DOVECOT \
> -I$DOVECOT/src/lib \
> -I$DOVECOT/src/lib-auth  \
> -I$DOVECOT/src/lib-sql \
> -I$DOVECOT/src/lib-settings \
> -I$DOVECOT/src/lib-ntlm \
> -I$DOVECOT/src/lib-master \
> -I$DOVECOT/src/auth \
> passdb-passwd-file.c -o passdb-passwd-file.o
> 
> With this, I get errors relate with uoff_t

You need to add -DHAVE_CONFIG_H



[Dovecot] Trying to building a customized auth plugin

2010-11-15 Thread Antonio Perez-Aranda
I'm on dovecot 2.0.7 and I trying to building a customized auth plugin.

I take passdb-passwd-file.c and userdb-passwd-file.c to try to build
with a simple gcc comand out of dovecot environment as in example:

export DOVECOT=/path/to/untar/dovecot-2.0.7
gcc -fPIC -shared -g -Wall -I$DOVECOT \
 -I$DOVECOT/src/lib \
 -I$DOVECOT/src/lib-auth  \
 -I$DOVECOT/src/lib-sql \
 -I$DOVECOT/src/lib-settings \
 -I$DOVECOT/src/lib-ntlm \
 -I$DOVECOT/src/lib-master \
 -I$DOVECOT/src/auth \
 passdb-passwd-file.c -o passdb-passwd-file.o

With this, I get errors relate with uoff_t

Is possible to build this plugin by this way?

Another way is patching against one plugin on dovecot RPM, but I
prefer this on a separated RPM.