yeah,i copy the file to openvpn source code plugin.
when i build it
# pwd
/usr/ports/distfiles/openvpn-2.0.9/plugin/auth-passwd
# gmake
gcc -O2 -Wall -DUSE_SHADOW=1 -fPIC -c -I../.. auth-passwd.c
auth-passwd.c:39:20: shadow.h: No such file or directory
auth-passwd.c: In function `passwd_auth':
auth-passwd.c:497: warning: implicit declaration of function `getspnam'
auth-passwd.c:497: warning: assignment makes pointer from integer without a cast
auth-passwd.c:504: error: dereferencing pointer to incomplete type
auth-passwd.c:504: error: dereferencing pointer to incomplete type
gmake: *** [auth-passwd.o] Error 1

I read GNU and 
found:http://www.gnu.org/software/gnulib/manual/html_node/shadow_002eh.html
Portability problems not fixed by Gnulib:
This header file is missing on some platforms: MacOS X 10.3, FreeBSD
6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, OSF/1 5.1, Cygwin, mingw,
Interix 3.5, BeOS.
The functions getspent_r, getspnam_r, sgetspent_r, fgetspent,
fgetspent_r, putspent are missing on some platforms: HP-UX 11.
The functions sgetspent, sgetspent_r are missing on some platforms:
IRIX 6.5, Solaris 10.

Now it looking for shadow.h and try copy it into openvpn file.

On Wed, Nov 12, 2008 at 1:53 AM, Giancarlo Razzolini
<[EMAIL PROTECTED]> wrote:
> Linyin escreveu:
>>
>> Thanks Giancarlo Razzolini very much!!! It is very helpful for me.
>>
>> I try to build it after read your README:
>> BUILD
>>
>> To build openvpn-auth-passwd on systems that use shadow, you will
>> need to have the shadow suite and it's devel headers installed.
>>
>> On GNU systems build with the "make" command. In other systems you
>> should install the GNU make, if you don't have it, and type "gmake".
>> The module will be named openvpn-auth-passwd.so
>>
>> But it looks have some problem:
>> # pwd
>> /home/linyin/auth-passwd
>> # gmake
>> gcc -O2 -Wall -DUSE_SHADOW=1 -fPIC -c -I../.. auth-passwd.c
>> auth-passwd.c:39:20: shadow.h: No such file or directory
>> auth-passwd.c:42:28: openvpn-plugin.h: No such file or directory
>> auth-passwd.c:254: error: syntax error before "openvpn_plugin_handle_t"
>> auth-passwd.c:256: warning: return type defaults to `int'
>> auth-passwd.c: In function `openvpn_plugin_open_v1':
>> auth-passwd.c:284: warning: implicit declaration of function
>> `OPENVPN_PLUGIN_MASK'
>> auth-passwd.c:284: error: `OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY'
>> undeclared (first use in this function)
>> auth-passwd.c:284: error: (Each undeclared identifier is reported only
>> once
>> auth-passwd.c:284: error: for each function it appears in.)
>> auth-passwd.c:333: error: `openvpn_plugin_handle_t' undeclared (first
>> use in this function)
>> auth-passwd.c:333: error: syntax error before "context"
>> auth-passwd.c: At top level:
>> auth-passwd.c:366: error: syntax error before "int"
>> auth-passwd.c:367: error: syntax error before "handle"
>> auth-passwd.c: In function `openvpn_plugin_func_v1':
>> auth-passwd.c:369: error: `handle' undeclared (first use in this function)
>> auth-passwd.c:371: error: `type' undeclared (first use in this function)
>> auth-passwd.c:371: error: `OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY'
>> undeclared (first use in this function)
>> auth-passwd.c:374: error: `envp' undeclared (first use in this function)
>> auth-passwd.c:389: error: `OPENVPN_PLUGIN_FUNC_SUCCESS' undeclared
>> (first use in this function)
>> auth-passwd.c:396: error: `OPENVPN_PLUGIN_FUNC_ERROR' undeclared
>> (first use in this function)
>> auth-passwd.c: At top level:
>> auth-passwd.c:399: error: syntax error before "void"
>> auth-passwd.c:400: error: syntax error before "handle"
>> auth-passwd.c: In function `openvpn_plugin_close_v1':
>> auth-passwd.c:402: error: `handle' undeclared (first use in this function)
>> auth-passwd.c: At top level:
>> auth-passwd.c:424: error: syntax error before "void"
>> auth-passwd.c:425: error: syntax error before "handle"
>> auth-passwd.c: In function `openvpn_plugin_abort_v1':
>> auth-passwd.c:427: error: `handle' undeclared (first use in this function)
>> auth-passwd.c: In function `passwd_auth':
>> auth-passwd.c:497: warning: implicit declaration of function `getspnam'
>> auth-passwd.c:497: warning: assignment makes pointer from integer without
>> a cast
>> auth-passwd.c:504: error: dereferencing pointer to incomplete type
>> auth-passwd.c:504: error: dereferencing pointer to incomplete type
>> gmake: *** [auth-passwd.o] Error 1
>>
>>
>> On Wed, Nov 12, 2008 at 1:04 AM, Giancarlo Razzolini
>> <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Linyin escreveu:
>>>
>>>>
>>>> Hey,my OpenBSD:
>>>> # uname -a
>>>> OpenBSD openbsd.openbsd.com 4.3 GENERIC.MP#0 i386
>>>>
>>>> I installed openvpn via pkg_add,and worked fine. But now I wanna auth
>>>> username/password on it.
>>>> I searched by Google and found two software:
>>>> openvpn-auth-ldap : http://code.google.com/p/openvpn-auth-ldap/
>>>> openvpn_bsdauth : In ports /usr/ports/net/openvpn_bsdauth/
>>>>
>>>> When I try to installed via source code, but it is some error:
>>>> # ./configure --prefix=/usr/local --with-openldap=/usr/local
>>>> --with-openvpn=/usr/ports/distfiles/openvpn-2.0.9
>>>> checking build system type... i386-unknown-openbsd4.3
>>>> checking host system type... i386-unknown-openbsd4.3
>>>> checking target system type... i386-unknown-openbsd4.3
>>>> checking for gcc... gcc
>>>> checking for C compiler default output file name... a.out
>>>> checking whether the C compiler works... yes
>>>> checking whether we are cross compiling... no
>>>> checking for suffix of executables...
>>>> checking for suffix of object files... o
>>>> checking whether we are using the GNU C compiler... yes
>>>> checking whether gcc accepts -g... yes
>>>> checking for gcc option to accept ISO C89... none needed
>>>> checking for gcc... gcc
>>>> checking whether we are using the GNU Objective C compiler... yes
>>>> checking whether gcc accepts -x objective-c... yes
>>>> checking for a BSD-compatible install... /usr/bin/install -c
>>>> checking whether ln -s works... yes
>>>> checking whether make sets $(MAKE)... yes
>>>> checking for re2c... /usr/local/bin/re2c
>>>> checking for doxygen... no
>>>> checking for dot... no
>>>> checking how to run the C preprocessor... gcc -E
>>>> checking for grep that handles long lines and -e... /usr/bin/grep
>>>> checking for egrep... /usr/bin/grep -E
>>>> checking for ANSI C header files... yes
>>>> checking for the pthreads library -lpthreads... no
>>>> checking whether pthreads work without any flags... no
>>>> checking whether pthreads work with -Kthread... no
>>>> checking whether pthreads work with -kthread... no
>>>> checking for the pthreads library -llthread... no
>>>> checking whether pthreads work with -pthread... yes
>>>> checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
>>>> checking if more special flags are required for pthreads... no
>>>> checking for BSD pf(4) support... yes
>>>> checking for strlcpy... yes
>>>> checking for openldap... yes
>>>> checking for check unit test library... no
>>>> configure: WARNING: Check library not found. Unit tests will not be
>>>> built or run.
>>>> checking for openvpn-plugin.h... yes
>>>> checking for sys/types.h... yes
>>>> checking for sys/stat.h... yes
>>>> checking for stdlib.h... yes
>>>> checking for string.h... yes
>>>> checking for memory.h... yes
>>>> checking for strings.h... yes
>>>> checking for inttypes.h... yes
>>>> checking for stdint.h... yes
>>>> checking for unistd.h... yes
>>>> checking how to run the Objective C preprocessor... gcc -E
>>>> checking objc/objc.h usability... yes
>>>> checking objc/objc.h presence... yes
>>>> checking for objc/objc.h... yes
>>>> checking if linking libobjc requires pthreads... yes
>>>> checking for Apple Objective-C runtime... no
>>>> checking for GNU Objective C runtime... yes
>>>> configure: Using GNU Objective-C runtime
>>>> configure: creating ./config.status
>>>> config.status: creating Makefile
>>>> config.status: creating tools/Makefile
>>>> config.status: creating src/Makefile
>>>> config.status: creating tests/Makefile
>>>> config.status: creating Mk/autoconf.mk
>>>> config.status: WARNING:  Mk/autoconf.mk.in seems to ignore the
>>>> --datarootdir setting
>>>> config.status: creating Mk/compile.mk
>>>> config.status: creating Mk/subdir.mk
>>>> config.status: creating doxyfile
>>>> config.status: creating config.h
>>>> config.status: config.h is unchanged
>>>>
>>>> # make
>>>> ===> making all in tools
>>>> ===> making all in src
>>>> gcc -o testplugin testplugin.o -export-dynamic -L. -lauth-ldap-testing
>>>> -lldap -llber -L/usr/local/lib -lobjc
>>>> testplugin.o(.text+0xba): In function `main':
>>>> /home/linyin/auth-ldap-2.0.3/src/testplugin.c:75: warning: strcpy() is
>>>> almost always misused, please use strlcpy()
>>>> /usr/local/lib/libldap.so.9.1: warning: sprintf() is often misused,
>>>> please use snprintf()
>>>>
>>>> testplugin.o(.text+0xc7):/home/linyin/auth-ldap-2.0.3/src/testplugin.c:76:
>>>> warning: strcat() is almost always misused, please use strlcat()
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_cond_signal'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_attr_destroy'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_create'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_getspecific'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_attr_init'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_exit'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_key_delete'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_cond_broadcast'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_key_create'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_cond_init'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_mutex_unlock'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_self'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_mutex_destroy'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_mutex_lock'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_cond_wait'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_mutex_trylock'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_cond_destroy'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_mutex_init'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to
>>>> `pthread_attr_setdetachstate'
>>>> /usr/lib/libobjc.so.4.0: undefined reference to `pthread_setspecific'
>>>> collect2: ld returned 1 exit status
>>>> *** Error code 1
>>>>
>>>> Stop in /home/linyin/auth-ldap-2.0.3/src (line 61 of Makefile).
>>>> *** Error code 1
>>>>
>>>> Stop in /home/linyin/auth-ldap-2.0.3 (line 12 of Mk/subdir.mk).
>>>>
>>>>
>>>> I Google openvpn_bsdauth also can not found any useful information about
>>>> it.
>>>> Who can give me some advise or others softwares can use on OpenBSD,
>>>> Thank
>>>> you.
>>>>
>>>>
>>>
>>> I've developed a plugin for openvpn that do just what you want.
>>>
>>> http://auth-passwd.sourceforge.net
>>>
>>> My regards,
>>>
>>> --
>>> Giancarlo Razzolini
>>> http://lock.razzolini.adm.br
>>> Linux User 172199
>>> Red Hat Certified Engineer no:804006389722501
>>> Verify:https://www.redhat.com/certification/rhce/current/
>>> Moleque Sem Conteudo Numero #002
>>> OpenBSD Stable
>>> Ubuntu 8.04 Hardy Heron
>>> 4386 2A6F FFD4 4D5F 5842  6EA0 7ABE BBAB 9C0E 6B85
>>>
>>>
>>>
>>
>>
>>
>>
>
> One of your problems is, that the program need the openvpn-plugin.h. I
> didn't included it in the package because i was looking forward to have it
> included with the mainstream openvpn package. It is in the include dir of
> the openvpn source. The second problem is that you need to alter the
> makefile and change the following variable to 0:
>
> USE_SHADOW=1
>
> to
>
> USE_SHADOW=0
>
> I had to do this on the makefile, because there isn't a portable way to
> check if the shadow suite is being used or not. And i didn't used autoconf
> with this project because, again, i was looking forward for it to being
> included with openvpn. You will also need gnu make. I didn't managed for it
> to work with openbsd make. A simple pkg_add gmake should suffice.
>
> You can also use the openvpn_bsdauth as stated. It's all up to you.
>
> My regards,
>
> --
> Giancarlo Razzolini
> http://lock.razzolini.adm.br
> Linux User 172199
> Red Hat Certified Engineer no:804006389722501
> Verify:https://www.redhat.com/certification/rhce/current/
> Moleque Sem Conteudo Numero #002
> OpenBSD Stable
> Ubuntu 8.04 Hardy Heron
> 4386 2A6F FFD4 4D5F 5842  6EA0 7ABE BBAB 9C0E 6B85
>
>



-- 
Regards

Linyin SooChow China
http://linyin.8800.org

Reply via email to