Blame AuUnlock.c

Packit Service f89583
/*
Packit Service f89583
Packit Service f89583
Copyright 1988, 1998  The Open Group
Packit Service f89583
Packit Service f89583
Permission to use, copy, modify, distribute, and sell this software and its
Packit Service f89583
documentation for any purpose is hereby granted without fee, provided that
Packit Service f89583
the above copyright notice appear in all copies and that both that
Packit Service f89583
copyright notice and this permission notice appear in supporting
Packit Service f89583
documentation.
Packit Service f89583
Packit Service f89583
The above copyright notice and this permission notice shall be included in
Packit Service f89583
all copies or substantial portions of the Software.
Packit Service f89583
Packit Service f89583
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service f89583
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service f89583
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
Packit Service f89583
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
Packit Service f89583
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit Service f89583
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit Service f89583
Packit Service f89583
Except as contained in this notice, the name of The Open Group shall not be
Packit Service f89583
used in advertising or otherwise to promote the sale, use or other dealings
Packit Service f89583
in this Software without prior written authorization from The Open Group.
Packit Service f89583
Packit Service f89583
*/
Packit Service f89583
Packit Service f89583
#ifdef HAVE_CONFIG_H
Packit Service f89583
#include <config.h>
Packit Service f89583
#endif
Packit Service f89583
#include <X11/Xauth.h>
Packit Service f89583
#include <X11/Xos.h>
Packit Service f89583
Packit Service f89583
int
Packit Service f89583
XauUnlockAuth (
Packit Service f89583
_Xconst char *file_name)
Packit Service f89583
{
Packit Service f89583
#ifndef WIN32
Packit Service f89583
    char	creat_name[1025];
Packit Service f89583
#endif
Packit Service f89583
    char	link_name[1025];
Packit Service f89583
Packit Service f89583
    if (strlen (file_name) > 1022)
Packit Service f89583
	return 0;
Packit Service f89583
#ifndef WIN32
Packit Service f89583
    snprintf (creat_name, sizeof(creat_name), "%s-c", file_name);
Packit Service f89583
#endif
Packit Service f89583
    snprintf (link_name, sizeof(link_name), "%s-l", file_name);
Packit Service f89583
    /*
Packit Service f89583
     * I think this is the correct order
Packit Service f89583
     */
Packit Service f89583
#ifndef WIN32
Packit Service f89583
    (void) remove (creat_name);
Packit Service f89583
#endif
Packit Service f89583
    (void) remove (link_name);
Packit Service f89583
Packit Service f89583
    return 1;
Packit Service f89583
}