Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 177682 - net-mail/freepops-0.2.2 compiled with gnutils flag crashed when using excite.lua plugin in function crypto.hmac
Summary: net-mail/freepops-0.2.2 compiled with gnutils flag crashed when using excite....
Status: VERIFIED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-08 18:03 UTC by Przemyslaw Wroblewski
Modified: 2007-05-11 11:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Przemyslaw Wroblewski 2007-05-08 18:03:56 UTC
As I say in summary freepops lua function crypto.hmac does not work with gnutils flag enabled.

You can find that function in /freepops/modules/src/crypto_lua/crypto_lua.c
but this flag selects which implementation would be used and it seems that GCRYPT
provides broken solution.

if you need more details pls feel free to contact me anytime: lowang(a#t !don't spam!)implix.com

Reproducible: Always

Steps to Reproduce:
1. compile freepops 0.2.2 with gnutils flag
2. download excite.lua from http://www.freepops.org/download.php?contrib=excite.lua
3. fix /etc/freepops/config.lua to work with that plugin
eg.: http://freepops.diludovico.it/freepops-english/5867-excite-plug-appears-not-working.html
please check bzorro or lowang(my) response how to do this
4. start freepopsd -w
5. from another shell eg.: telnet localhost 2000 (default freepops port & address)
6. USER validemail@excite.com
7. PASS passforthataccnt

then freepopsd will die and telnet session will be disconected


Actual Results:  
freepops will dump a lot of debug messages however only last one is meaningfull:

< HTTP/1.1 200 OK
< Date: Sun, 06 May 2007 18:12:39 GMT
< Server: Apache/1.3.29 (Unix) mod_ssl/2.8.16 OpenSSL/0.9.7c
< Pragma: no-cache
< Cache-control: max-age=0, no-cache
< Expires: Sat 02 Apr 1977 17:15:00 GMT
< P3P: policyref="http://c4.excite.com/w3c/p3p.xml", CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
< Content-type: application/x-javascript
< Set-cookie: uu=ONqIffvBOhcW; expires=Wed, 03 May 2017 18:12:39 GMT; DOMAIN=.excite.com; PATH=/
< Last-Modified: Mon, 08 Jul 2002 04:00:00 GMT
< Connection: close
< Transfer-Encoding: chunked
* Closing connection #0
operation is not possible without initialized secure memory

and telnet session will die with following:

# telnet localhost 2000
Trying 192.168.1.23...
Connected to localhost.
Escape character is '^]'.
+OK FreePOPs/0.2.2 pop3 server ready
USER validemail@excite.com
+OK PLEASE ENTER PASSWORD
PASS passforthataccnt
Connection closed by foreign host.


Expected Results:  
# telnet localhost 2000
Trying 192.168.1.23...
Connected to localhost.
Escape character is '^]'.
+OK FreePOPs/0.2.2 pop3 server ready
USER validemail@excite.com
+OK PLEASE ENTER PASSWORD
PASS passforthataccnt
+OK ACCESS ALLOWED
Comment 1 Daniel Black (RETIRED) gentoo-dev 2007-05-08 21:56:17 UTC
Not sure what I'm doing wrong:

Any chance of getting a backtrace of you?
http://www.gentoo.org/proj/en/qa/backtraces.xml

$ grep -v ^-- config.lua  | head
freepops.MODULES_MAP["excite.com"] = {name="excite.lua"}

$ strace -fe trace=file  /usr/bin/freepopsd -vv -n

[pid 23566] open("/usr/share/freepops/lua_unofficial/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 6
[pid 23566] open("/usr/share/freepops/lua_unofficial//excite.lua", O_RDONLY) = 7
Wed May  9 07:50:37 2007 freepopsd: ERROR(log_lua.c,  70): (@/usr/share/freepops/lua/freepops.lua, 530) : Unable to find a module that handles 'excite.com
' domain, requested by 'fred@excite.com
' mail account

Wed May  9 07:50:37 2007 freepopsd: ERROR(engine.c, 203): Error calling freepops.init('fred@excite.com
')LUAY: lua stack image:
LUAY: stack( 0) : --bottom--

Wed May  9 07:50:37 2007 freepopsd: ERROR(engine.c, 245): Error bootstrapping
Wed May  9 07:50:37 2007 freepopsd: ALTSOCKLIB: altsocklib.c : senddata : 409 : (32)Broken pipe
Wed May  9 07:50:37 2007 freepopsd: DBG(popserver.c, 182): [23564] !! Error calling "sendstring" (code -1 - Broken pipe)
Wed May  9 07:50:37 2007 freepopsd: POPSERVER: UNKNOWN ERROR, PLEASE FIX
Wed May  9 07:50:37 2007 freepopsd: DBG(threads.c,  81): thread 0 will die
Wed May  9 07:50:37 2007 freepopsd: DBG(popserver.c, 810): a network error occurred, this thread will die
Process 23566 detached

$ netcat localhost 2000
+OK FreePOPs/0.2.2 pop3 server ready
USER fred@excite.com

No OK for USER is returned. Ended up doing ^C
Comment 2 Daniel Black (RETIRED) gentoo-dev 2007-05-08 21:56:52 UTC
btw which gnutls version are you running?
Comment 3 Przemyslaw Wroblewski 2007-05-09 07:40:34 UTC
(In reply to comment #1)
> Not sure what I'm doing wrong:
freepops does not locate excite.lua file on your system:

>Wed May  9 07:50:37 2007 freepopsd: ERROR(log_lua.c,  70):
> (@/usr/share/freepops/lua/freepops.lua, 530) : Unable to find a module that
> handles 'excite.com
> ' domain, requested by 'fred@excite.com
> ' mail account

where did you saved that file ?

> Any chance of getting a backtrace of you?
> http://www.gentoo.org/proj/en/qa/backtraces.xml
I'll try to do that today, but since i'll be doing this for the first time
please allow 2days for that
Comment 4 Przemyslaw Wroblewski 2007-05-09 07:43:01 UTC
(In reply to comment #2)
> btw which gnutls version are you running?
> 

eix gnutls
[I] net-libs/gnutls
     Available versions:  1.4.4-r1 ~1.4.5 ~1.6.0 ~1.6.1
     Installed versions:  1.4.4-r1(17:04:21 04/29/07)(-doc nls zlib)

I'll try to install ~x86 versions and see what happends.
Comment 5 Daniel Black (RETIRED) gentoo-dev 2007-05-09 07:58:53 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Not sure what I'm doing wrong:
> freepops does not locate excite.lua file on your system:
> 
> >Wed May  9 07:50:37 2007 freepopsd: ERROR(log_lua.c,  70):
> > (@/usr/share/freepops/lua/freepops.lua, 530) : Unable to find a module that
> > handles 'excite.com
> > ' domain, requested by 'fred@excite.com
> > ' mail account
> 
> where did you saved that file ?
> 
pid 23566] open("/usr/share/freepops/lua_unofficial//excite.lua", O_RDONLY) =
7
This indicated that it opened the file ok. Other traces indicated that it read it correctly.
The config.lua contains the unofficial path /usr/share/freepops/lua_unofficial/ as per instructions.

> > Any chance of getting a backtrace of you?
> > http://www.gentoo.org/proj/en/qa/backtraces.xml
> I'll try to do that today, but since i'll be doing this for the first time
> please allow 2days for that

np - I've got plenty of other stuff to do.
Comment 6 Przemyslaw Wroblewski 2007-05-10 15:30:56 UTC
I've enabled back trace related flags, but I'm unsure if that was sufficient,
so I've created an account for you on my test server. Please check email from przemyslaw.wroblewski@implix.com from about Thu May 10 15:29:58 UTC 2007
Comment 7 Daniel Black (RETIRED) gentoo-dev 2007-05-10 21:41:30 UTC
added 0.2.2-r1 that does some gcrypt initialisation. The attached patch disables secure memory but fixes the error "operation is not possible without initialized secure memory".

Please test and if it works I'll report the bug the the freepops devs.

Much appreciate the bug report and test environment.
Comment 8 Przemyslaw Wroblewski 2007-05-11 09:26:24 UTC
It works! Thanks for resolution Daniel :)
I'm changing task status to WORKSFORME, 
however if you thing that this solution is permanent pls close it
Comment 9 Daniel Black (RETIRED) gentoo-dev 2007-05-11 11:24:41 UTC
(In reply to comment #8)
> It works! Thanks for resolution Daniel :)

np.
> I'm changing task status to WORKSFORME, 
> however if you thing that this solution is permanent pls close it

Closed and reported upstream.