php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56674 GNUPG Operations cause Apache to segfault
Submitted: 2005-11-25 08:37 UTC Modified: 2005-11-25 11:25 UTC
From: karl at karlaustin dot com Assigned:
Status: Closed Package: gnupg (PECL)
PHP Version: Irrelevant OS: CentOS 3 & 4
Private report: No CVE-ID: None
 [2005-11-25 08:37 UTC] karl at karlaustin dot com
Description:
------------
Operations such as trying to import a key to the keyring cause Apache (1.3) to segfault. Operations trying to use an existing key on the keyring fail (Says it can't find the key). I have tried this on CentOS 3.6 with PHP 4.3.11 and CentOS 4.2 with PHP 5.0.5 and it happens with both when used via Apache - However, all opperations work perfectly when ran from a command line PHP.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-25 09:36 UTC] traufeisen@php.net
Thank you for your bugreport.
The segfault occurs, when the keyring/ directory is not writeable. This is now fixed in CVS.
Please note, that the httpd is normaly running under a different user, so it?s homedirectory is another one. You can specify the gnupg-directory with the GNUPGHOME environment variable.
Please take a look at the notes available at http://livedocs.phpdoc.info/index.php?l=en&q=ref.gnupg regarding this.
 [2005-11-25 09:47 UTC] karl at karlaustin dot com
H
 [2005-11-25 09:48 UTC] karl at karlaustin dot com
Ugh, bloomin browser, sorry about the non message there.

Should have said:

Hi,

The keyring directory and files are writable by the user httpd, and are in the .gnupg directory of the httpd users home dir, as this was one of the first things I double checked.

Thanks,

Karl
 [2005-11-25 09:56 UTC] traufeisen@php.net
In this case please generate a backtrace.
Informations on how to do this, are available at http://bugs.php.net/bugs-generating-backtrace.php

Basically:
gdb /usr/sbin/httpd
run -X
- request webpage with browser here -
bt

Please use the updated gnupg.c from CVS (http://cvs.php.net/co.php/pecl/gnupg/gnupg.c?r=1.15&p=1).
 [2005-11-25 10:42 UTC] karl at karlaustin dot com
Hi,

Will have to setup another machine here to test on as I'm unable to install the debug symbols and gdb etc. on this current machine. Will test on my own dev box tonight.

Thanks,
 [2005-11-25 11:25 UTC] karl at karlaustin dot com
Just tried the new gnupg.c and that stops the segfaults, but it still doesn't actually make it work. It looks like the problem was that it was not looking in the default GPGHOME for the httpd user i.e. ~/.gnupg as if I use putenv() to set the GPGHOME it does now work.

Thanks,
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC