aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2001-12-25 18:04:09 +0000
committerDavid Shaw <[email protected]>2001-12-25 18:04:09 +0000
commit604484a4d2dac7b3ec9389ba49000af17827723b (patch)
treeae9567a42b57ee4b65c7e7a6113d5968eae65d2a
parentFixed a typo and W32 support for the latest CVS changes. (diff)
downloadgnupg-604484a4d2dac7b3ec9389ba49000af17827723b.tar.gz
gnupg-604484a4d2dac7b3ec9389ba49000af17827723b.zip
Some tweaks - copyleft info for mkdtemp.c, and header pruning in photoid.c
and keyserver.c
-rw-r--r--g10/ChangeLog8
-rw-r--r--g10/keyserver.c27
-rw-r--r--g10/mkdtemp.c36
-rw-r--r--g10/photoid.c23
4 files changed, 51 insertions, 43 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index cc7b2c167..a11428f8f 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,11 @@
+2001-12-25 David Shaw <[email protected]>
+
+ * 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 <[email protected]>
* misc.c (check_permissions): Do not use it for W32 systems.
diff --git a/g10/keyserver.c b/g10/keyserver.c
index b77d2609d..66e62df9a 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -19,29 +19,24 @@
*/
#include <config.h>
+#include <ctype.h>
+#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.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 "util.h"
+#include "filter.h"
#include "keydb.h"
#include "status.h"
#include "exec.h"
-#include "i18n.h"
-#include "util.h"
#include "main.h"
+#include "i18n.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
diff --git a/g10/mkdtemp.c b/g10/mkdtemp.c
index 50a083005..0323486a3 100644
--- a/g10/mkdtemp.c
+++ b/g10/mkdtemp.c
@@ -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
we're building on (like mine!) doesn't have it. */
@@ -23,29 +43,21 @@ char *mkdtemp(char *template)
idx=strlen(template);
- if(idx==0)
- {
- errno=EINVAL;
- return NULL;
- }
-
- ch=&template[idx-1];
-
/* Walk backwards to count all the Xes */
- while(*ch=='X' && count<idx)
+ while(idx>0 && template[idx-1]=='X')
{
count++;
- ch--;
+ idx--;
}
- ch++;
-
if(count==0)
{
errno=EINVAL;
return NULL;
}
+ ch=&template[idx];
+
/* Try 4 times to make the temp directory */
for(attempts=0;attempts<4;attempts++)
{
diff --git a/g10/photoid.c b/g10/photoid.c
index 88d3f8233..8586f0ee5 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -19,30 +19,23 @@
*/
#include <config.h>
-#include <unistd.h>
+#include <errno.h>
#include <stdio.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 "packet.h"
#include "status.h"
+#include "exec.h"
+#include "keydb.h"
#include "util.h"
-#include "packet.h"
+#include "i18n.h"
#include "iobuf.h"
-#include "exec.h"
+#include "memory.h"
+#include "options.h"
#include "photoid.h"
#define PHOTO_COMMAND_MAXLEN 1024
#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 */
PKT_user_id *generate_photo_id(PKT_public_key *pk)