mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-26 22:29:58 +01:00
* exec.c (make_tempdir) [_WIN32]: Modified to properly handle
arbitrarily long temporary directory paths.
This commit is contained in:
parent
05a2a2f39a
commit
b9c2f44336
@ -1,3 +1,8 @@
|
|||||||
|
2006-05-25 Israel G. Lugo <ilugo@bridonsecurity.com> (dshaw)
|
||||||
|
|
||||||
|
* exec.c (make_tempdir) [_WIN32]: Modified to properly handle
|
||||||
|
arbitrarily long temporary directory paths.
|
||||||
|
|
||||||
2006-05-25 David Shaw <dshaw@jabberwocky.com>
|
2006-05-25 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keygen.c (gen_dsa): Allow generating DSA2 keys
|
* keygen.c (gen_dsa): Allow generating DSA2 keys
|
||||||
|
19
g10/exec.c
19
g10/exec.c
@ -129,16 +129,21 @@ static int make_tempdir(struct exec_info *info)
|
|||||||
if(tmp==NULL)
|
if(tmp==NULL)
|
||||||
{
|
{
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
int err;
|
int tmp_siz;
|
||||||
|
int len=0;
|
||||||
|
|
||||||
tmp=xmalloc(MAX_PATH+1);
|
/* Poll temp path length */
|
||||||
err=GetTempPath(MAX_PATH+1,tmp);
|
tmp_siz=GetTempPath(0,NULL);
|
||||||
if(err==0 || err>MAX_PATH+1)
|
if(tmp_siz)
|
||||||
strcpy(tmp,"c:\\windows\\temp");
|
{
|
||||||
|
tmp=xmalloc(tmp_siz);
|
||||||
|
len=GetTempPath(tmp_siz,tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(len==0)
|
||||||
|
tmp=xstrdup("c:\\windows\\temp");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int len=strlen(tmp);
|
|
||||||
|
|
||||||
/* GetTempPath may return with \ on the end */
|
/* GetTempPath may return with \ on the end */
|
||||||
while(len>0 && tmp[len-1]=='\\')
|
while(len>0 && tmp[len-1]=='\\')
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user