1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-23 20:08:04 +01:00

Some tweaks - copyleft info for mkdtemp.c, and header pruning in photoid.c

and keyserver.c
This commit is contained in:
David Shaw 2001-12-25 18:04:09 +00:00
parent 8c35c19e43
commit 604484a4d2
4 changed files with 52 additions and 44 deletions

View File

@ -1,3 +1,11 @@
2001-12-25 David Shaw <dshaw@jabberwocky.com>
* mkdtemp.c (mkdtemp): Add copyleft info and tweak the 'X' counter
to be a bit simpler.
* keyserver.c, photoid.c: Remove unused headers left over from
when the exec functions lived there.
2001-12-23 Timo Schulz <ts@winpt.org> 2001-12-23 Timo Schulz <ts@winpt.org>
* misc.c (check_permissions): Do not use it for W32 systems. * misc.c (check_permissions): Do not use it for W32 systems.

View File

@ -19,29 +19,24 @@
*/ */
#include <config.h> #include <config.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <errno.h> #include "util.h"
#include <string.h> #include "filter.h"
#include <ctype.h>
#include <sys/types.h>
#ifndef HAVE_DOSISH_SYSTEM
#include <sys/wait.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include "keyserver-internal.h"
#include "types.h"
#include "options.h"
#include "memory.h"
#include "keydb.h" #include "keydb.h"
#include "status.h" #include "status.h"
#include "exec.h" #include "exec.h"
#include "i18n.h"
#include "util.h"
#include "main.h" #include "main.h"
#include "i18n.h"
#include "hkp.h" #include "hkp.h"
#include "iobuf.h"
#include "memory.h"
#include "options.h"
#include "packet.h"
#include "keyserver-internal.h"
#define KEYSERVER_PROTO_VERSION 0 #define KEYSERVER_PROTO_VERSION 0

View File

@ -1,3 +1,23 @@
/* mkdtemp.c - libc replacement function
* Copyright (C) 2001 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GnuPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* This is a replacement function for mkdtemp in case the platform /* This is a replacement function for mkdtemp in case the platform
we're building on (like mine!) doesn't have it. */ we're building on (like mine!) doesn't have it. */
@ -23,29 +43,21 @@ char *mkdtemp(char *template)
idx=strlen(template); idx=strlen(template);
if(idx==0)
{
errno=EINVAL;
return NULL;
}
ch=&template[idx-1];
/* Walk backwards to count all the Xes */ /* Walk backwards to count all the Xes */
while(*ch=='X' && count<idx) while(idx>0 && template[idx-1]=='X')
{ {
count++; count++;
ch--; idx--;
} }
ch++;
if(count==0) if(count==0)
{ {
errno=EINVAL; errno=EINVAL;
return NULL; return NULL;
} }
ch=&template[idx];
/* Try 4 times to make the temp directory */ /* Try 4 times to make the temp directory */
for(attempts=0;attempts<4;attempts++) for(attempts=0;attempts<4;attempts++)
{ {

View File

@ -19,30 +19,23 @@
*/ */
#include <config.h> #include <config.h>
#include <unistd.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#ifndef HAVE_DOSISH_SYSTEM
#include <sys/wait.h>
#endif
#include <errno.h>
#include <limits.h>
#include "keydb.h"
#include "i18n.h"
#include "options.h"
#include "memory.h"
#include "status.h"
#include "util.h"
#include "packet.h" #include "packet.h"
#include "iobuf.h" #include "status.h"
#include "exec.h" #include "exec.h"
#include "keydb.h"
#include "util.h"
#include "i18n.h"
#include "iobuf.h"
#include "memory.h"
#include "options.h"
#include "photoid.h" #include "photoid.h"
#define PHOTO_COMMAND_MAXLEN 1024 #define PHOTO_COMMAND_MAXLEN 1024
#define DEFAULT_PHOTO_COMMAND "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin" #define DEFAULT_PHOTO_COMMAND "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"
#define PHOTO_FILENAME_TEMPLATE "gnupg-photo-id-XXXXXX"
/* Generate a new photo id packet, or return NULL if canceled */ /* Generate a new photo id packet, or return NULL if canceled */
PKT_user_id *generate_photo_id(PKT_public_key *pk) PKT_user_id *generate_photo_id(PKT_public_key *pk)