AuUnlock.c revision 27702724
1/* $Xorg: AuUnlock.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ 2 3/* 4 5Copyright 1988, 1998 The Open Group 6 7Permission to use, copy, modify, distribute, and sell this software and its 8documentation for any purpose is hereby granted without fee, provided that 9the above copyright notice appear in all copies and that both that 10copyright notice and this permission notice appear in supporting 11documentation. 12 13The above copyright notice and this permission notice shall be included in 14all copies or substantial portions of the Software. 15 16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the name of The Open Group shall not be 24used in advertising or otherwise to promote the sale, use or other dealings 25in this Software without prior written authorization from The Open Group. 26 27*/ 28/* $XFree86: xc/lib/Xau/AuUnlock.c,v 1.4 2001/12/14 19:54:36 dawes Exp $ */ 29 30#ifdef HAVE_CONFIG_H 31#include <config.h> 32#endif 33#include <X11/Xauth.h> 34#include <X11/Xos.h> 35 36int 37XauUnlockAuth ( 38_Xconst char *file_name) 39{ 40#ifndef WIN32 41 char creat_name[1025]; 42#endif 43 char link_name[1025]; 44 45 if (strlen (file_name) > 1022) 46 return 0; 47#ifndef WIN32 48 (void) strcpy (creat_name, file_name); 49 (void) strcat (creat_name, "-c"); 50#endif 51 (void) strcpy (link_name, file_name); 52 (void) strcat (link_name, "-l"); 53 /* 54 * I think this is the correct order 55 */ 56#ifndef WIN32 57 (void) unlink (creat_name); 58#endif 59 (void) unlink (link_name); 60 61 return 1; 62} 63