AuUnlock.c revision 27702724
127702724Smrg/* $Xorg: AuUnlock.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
227702724Smrg
327702724Smrg/*
427702724Smrg
527702724SmrgCopyright 1988, 1998  The Open Group
627702724Smrg
727702724SmrgPermission to use, copy, modify, distribute, and sell this software and its
827702724Smrgdocumentation for any purpose is hereby granted without fee, provided that
927702724Smrgthe above copyright notice appear in all copies and that both that
1027702724Smrgcopyright notice and this permission notice appear in supporting
1127702724Smrgdocumentation.
1227702724Smrg
1327702724SmrgThe above copyright notice and this permission notice shall be included in
1427702724Smrgall copies or substantial portions of the Software.
1527702724Smrg
1627702724SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1727702724SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1827702724SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1927702724SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2027702724SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2127702724SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2227702724Smrg
2327702724SmrgExcept as contained in this notice, the name of The Open Group shall not be
2427702724Smrgused in advertising or otherwise to promote the sale, use or other dealings
2527702724Smrgin this Software without prior written authorization from The Open Group.
2627702724Smrg
2727702724Smrg*/
2827702724Smrg/* $XFree86: xc/lib/Xau/AuUnlock.c,v 1.4 2001/12/14 19:54:36 dawes Exp $ */
2927702724Smrg
3027702724Smrg#ifdef HAVE_CONFIG_H
3127702724Smrg#include <config.h>
3227702724Smrg#endif
3327702724Smrg#include <X11/Xauth.h>
3427702724Smrg#include <X11/Xos.h>
3527702724Smrg
3627702724Smrgint
3727702724SmrgXauUnlockAuth (
3827702724Smrg_Xconst char *file_name)
3927702724Smrg{
4027702724Smrg#ifndef WIN32
4127702724Smrg    char	creat_name[1025];
4227702724Smrg#endif
4327702724Smrg    char	link_name[1025];
4427702724Smrg
4527702724Smrg    if (strlen (file_name) > 1022)
4627702724Smrg	return 0;
4727702724Smrg#ifndef WIN32
4827702724Smrg    (void) strcpy (creat_name, file_name);
4927702724Smrg    (void) strcat (creat_name, "-c");
5027702724Smrg#endif
5127702724Smrg    (void) strcpy (link_name, file_name);
5227702724Smrg    (void) strcat (link_name, "-l");
5327702724Smrg    /*
5427702724Smrg     * I think this is the correct order
5527702724Smrg     */
5627702724Smrg#ifndef WIN32
5727702724Smrg    (void) unlink (creat_name);
5827702724Smrg#endif
5927702724Smrg    (void) unlink (link_name);
6027702724Smrg
6127702724Smrg    return 1;
6227702724Smrg}
63