diff options
author | William Jon McCann <jmccann@redhat.com> | 2008-07-31 00:31:05 +0000 |
---|---|---|
committer | William Jon McCann <mccann@src.gnome.org> | 2008-07-31 00:31:05 +0000 |
commit | 32b914376ff6b6243677ce382af0a3f36e030e6f (patch) | |
tree | 026124c2d1abc6b1615030f7e57da8f2d3f21355 /common/mkdtemp.h | |
parent | 3d0975ff2308766d809db5ac788cbc212be53edb (diff) | |
download | gdm-32b914376ff6b6243677ce382af0a3f36e030e6f.tar.gz |
Wow, that was really broken. Use mkdtemp when available to create a
2008-07-30 William Jon McCann <jmccann@redhat.com>
* common/Makefile.am:
* common/gdm-common.c (gdm_make_temp_dir):
* common/gdm-common.h:
* common/mkdtemp.c:
* common/mkdtemp.h:
* configure.ac:
* daemon/gdm-display-access-file.c (_create_xauth_file_for_user),
(gdm_display_access_file_close):
Wow, that was really broken. Use mkdtemp when available
to create a temporary directory.
svn path=/trunk/; revision=6338
Diffstat (limited to 'common/mkdtemp.h')
-rw-r--r-- | common/mkdtemp.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/common/mkdtemp.h b/common/mkdtemp.h new file mode 100644 index 00000000..dbc47ac3 --- /dev/null +++ b/common/mkdtemp.h @@ -0,0 +1,40 @@ +/* Creating a private temporary directory. + Copyright (C) 2001 Free Software Foundation, Inc. + + This program 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, or (at your option) + any later version. + + This program 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. */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +#if HAVE_MKDTEMP + +/* Get mkdtemp() declaration. */ +#include <stdlib.h> + +#else + +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +extern char * mkdtemp PARAMS ((char *template)); + +#endif |