--- /dev/null
+Keith Packard, X Consortium
+
+Some bug fixes, but not clear from where.
--- /dev/null
+/* $Xorg: AuDispose.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuDispose.c,v 1.4 2001/07/25 15:04:48 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <stdlib.h>
+
+void
+XauDisposeAuth (Xauth *auth)
+{
+ if (auth) {
+ if (auth->address) (void) free (auth->address);
+ if (auth->number) (void) free (auth->number);
+ if (auth->name) (void) free (auth->name);
+ if (auth->data) {
+ (void) bzero (auth->data, auth->data_length);
+ (void) free (auth->data);
+ }
+ free ((char *) auth);
+ }
+ return;
+}
--- /dev/null
+/* $Xorg: AuFileName.c,v 1.5 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuFileName.c,v 3.6 2001/07/25 15:04:48 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+
+char *
+XauFileName (void)
+{
+ const char *slashDotXauthority = "/.Xauthority";
+ char *name;
+ static char *buf;
+ static int bsize;
+#ifdef WIN32
+ char dir[128];
+#endif
+ int size;
+
+ if ((name = getenv ("XAUTHORITY")))
+ return name;
+ name = getenv ("HOME");
+ if (!name) {
+#ifdef WIN32
+ (void) strcpy (dir, "/users/");
+ if ((name = getenv("USERNAME"))) {
+ (void) strcat (dir, name);
+ name = dir;
+ }
+ if (!name)
+#endif
+ return NULL;
+ }
+ size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
+ if (size > bsize) {
+ if (buf)
+ free (buf);
+ buf = malloc ((unsigned) size);
+ if (!buf)
+ return NULL;
+ bsize = size;
+ }
+ strcpy (buf, name);
+ strcat (buf, slashDotXauthority + (name[1] == '\0' ? 1 : 0));
+ return buf;
+}
--- /dev/null
+/* $Xorg: AuGetAddr.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuGetAddr.c,v 1.5 2001/12/14 19:54:36 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <X11/Xos.h>
+
+static int
+binaryEqual (_Xconst char *a, _Xconst char *b, int len)
+{
+ while (len--)
+ if (*a++ != *b++)
+ return 0;
+ return 1;
+}
+
+Xauth *
+XauGetAuthByAddr (
+#if NeedWidePrototypes
+unsigned int family,
+unsigned int address_length,
+#else
+unsigned short family,
+unsigned short address_length,
+#endif
+_Xconst char* address,
+#if NeedWidePrototypes
+unsigned int number_length,
+#else
+unsigned short number_length,
+#endif
+_Xconst char* number,
+#if NeedWidePrototypes
+unsigned int name_length,
+#else
+unsigned short name_length,
+#endif
+_Xconst char* name)
+{
+ FILE *auth_file;
+ char *auth_name;
+ Xauth *entry;
+
+ auth_name = XauFileName ();
+ if (!auth_name)
+ return NULL;
+ if (access (auth_name, R_OK) != 0) /* checks REAL id */
+ return NULL;
+ auth_file = fopen (auth_name, "rb");
+ if (!auth_file)
+ return NULL;
+ for (;;) {
+ entry = XauReadAuth (auth_file);
+ if (!entry)
+ break;
+ /*
+ * Match when:
+ * either family or entry->family are FamilyWild or
+ * family and entry->family are the same and
+ * address and entry->address are the same
+ * and
+ * either number or entry->number are empty or
+ * number and entry->number are the same
+ * and
+ * either name or entry->name are empty or
+ * name and entry->name are the same
+ */
+
+ if ((family == FamilyWild || entry->family == FamilyWild ||
+ (entry->family == family &&
+ address_length == entry->address_length &&
+ binaryEqual (entry->address, address, (int)address_length))) &&
+ (number_length == 0 || entry->number_length == 0 ||
+ (number_length == entry->number_length &&
+ binaryEqual (entry->number, number, (int)number_length))) &&
+ (name_length == 0 || entry->name_length == 0 ||
+ (entry->name_length == name_length &&
+ binaryEqual (entry->name, name, (int)name_length))))
+ break;
+ XauDisposeAuth (entry);
+ }
+ (void) fclose (auth_file);
+ return entry;
+}
--- /dev/null
+/* $Xorg: AuGetBest.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuGetBest.c,v 1.7 2001/12/14 19:54:36 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <X11/Xos.h>
+#ifdef XTHREADS
+#include <X11/Xthreads.h>
+#endif
+#ifdef hpux
+#define X_INCLUDE_NETDB_H
+#define XOS_USE_NO_LOCKING
+#include <X11/Xos_r.h>
+#endif
+
+static int
+binaryEqual (_Xconst char *a, _Xconst char *b, int len)
+{
+ while (len--)
+ if (*a++ != *b++)
+ return 0;
+ return 1;
+}
+
+Xauth *
+XauGetBestAuthByAddr (
+#if NeedWidePrototypes
+ unsigned int family,
+ unsigned int address_length,
+#else
+ unsigned short family,
+ unsigned short address_length,
+#endif
+ _Xconst char* address,
+#if NeedWidePrototypes
+ unsigned int number_length,
+#else
+ unsigned short number_length,
+#endif
+ _Xconst char* number,
+ int types_length,
+ char** types,
+ _Xconst int* type_lengths)
+{
+ FILE *auth_file;
+ char *auth_name;
+ Xauth *entry;
+ Xauth *best;
+ int best_type;
+ int type;
+#ifdef hpux
+ char *fully_qual_address;
+ unsigned short fully_qual_address_length;
+#endif
+
+ auth_name = XauFileName ();
+ if (!auth_name)
+ return NULL;
+ if (access (auth_name, R_OK) != 0) /* checks REAL id */
+ return NULL;
+ auth_file = fopen (auth_name, "rb");
+ if (!auth_file)
+ return NULL;
+
+#ifdef hpux
+ if (family == FamilyLocal) {
+#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
+ _Xgethostbynameparams hparams;
+#endif
+ struct hostent *hostp;
+
+ /* make sure we try fully-qualified hostname */
+ if ((hostp = _XGethostbyname(address,hparams)) != NULL) {
+ fully_qual_address = hostp->h_name;
+ fully_qual_address_length = strlen(fully_qual_address);
+ }
+ else
+ {
+ fully_qual_address = NULL;
+ fully_qual_address_length = 0;
+ }
+ }
+#endif /* hpux */
+
+ best = NULL;
+ best_type = types_length;
+ for (;;) {
+ entry = XauReadAuth (auth_file);
+ if (!entry)
+ break;
+ /*
+ * Match when:
+ * either family or entry->family are FamilyWild or
+ * family and entry->family are the same and
+ * address and entry->address are the same
+ * and
+ * either number or entry->number are empty or
+ * number and entry->number are the same
+ * and
+ * either name or entry->name are empty or
+ * name and entry->name are the same
+ */
+
+ if ((family == FamilyWild || entry->family == FamilyWild ||
+ (entry->family == family &&
+ ((address_length == entry->address_length &&
+ binaryEqual (entry->address, address, (int)address_length))
+#ifdef hpux
+ || (family == FamilyLocal &&
+ fully_qual_address_length == entry->address_length &&
+ binaryEqual (entry->address, fully_qual_address,
+ (int) fully_qual_address_length))
+#endif
+ ))) &&
+ (number_length == 0 || entry->number_length == 0 ||
+ (number_length == entry->number_length &&
+ binaryEqual (entry->number, number, (int)number_length))))
+ {
+ if (best_type == 0)
+ {
+ best = entry;
+ break;
+ }
+ for (type = 0; type < best_type; type++)
+ if (type_lengths[type] == entry->name_length &&
+ !(strncmp (types[type], entry->name, entry->name_length)))
+ {
+ break;
+ }
+ if (type < best_type)
+ {
+ if (best)
+ XauDisposeAuth (best);
+ best = entry;
+ best_type = type;
+ if (type == 0)
+ break;
+ continue;
+ }
+ }
+ XauDisposeAuth (entry);
+ }
+ (void) fclose (auth_file);
+ return best;
+}
--- /dev/null
+/* $Xorg: AuLock.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuLock.c,v 3.6 2002/05/31 18:45:43 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <X11/Xos.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <time.h>
+#define Time_t time_t
+#ifndef X_NOT_POSIX
+#include <unistd.h>
+#else
+#ifndef WIN32
+extern unsigned sleep ();
+#else
+#include <X11/Xwindows.h>
+#define link rename
+#endif
+#endif
+#ifdef __UNIXOS2__
+#define link rename
+#endif
+
+int
+XauLockAuth (
+_Xconst char *file_name,
+int retries,
+int timeout,
+long dead)
+{
+ char creat_name[1025], link_name[1025];
+ struct stat statb;
+ Time_t now;
+ int creat_fd = -1;
+
+ if (strlen (file_name) > 1022)
+ return LOCK_ERROR;
+ (void) strcpy (creat_name, file_name);
+ (void) strcat (creat_name, "-c");
+ (void) strcpy (link_name, file_name);
+ (void) strcat (link_name, "-l");
+ if (stat (creat_name, &statb) != -1) {
+ now = time ((Time_t *) 0);
+ /*
+ * NFS may cause ctime to be before now, special
+ * case a 0 deadtime to force lock removal
+ */
+ if (dead == 0 || now - statb.st_ctime > dead) {
+ (void) unlink (creat_name);
+ (void) unlink (link_name);
+ }
+ }
+
+ while (retries > 0) {
+ if (creat_fd == -1) {
+ creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ if (creat_fd == -1) {
+ if (errno != EACCES)
+ return LOCK_ERROR;
+ } else
+ (void) close (creat_fd);
+ }
+ if (creat_fd != -1) {
+#ifndef X_NOT_POSIX
+ /* The file system may not support hard links, and pathconf should tell us that. */
+ if (1 == pathconf(creat_name, _PC_LINK_MAX)) {
+ if (-1 == rename(creat_name, link_name)) {
+ /* Is this good enough? Perhaps we should retry. TEST */
+ return LOCK_ERROR;
+ } else {
+ return LOCK_SUCCESS;
+ }
+ } else {
+#endif
+ if (link (creat_name, link_name) != -1)
+ return LOCK_SUCCESS;
+ if (errno == ENOENT) {
+ creat_fd = -1; /* force re-creat next time around */
+ continue;
+ }
+ if (errno != EEXIST)
+ return LOCK_ERROR;
+#ifndef X_NOT_POSIX
+ }
+#endif
+ }
+ (void) sleep ((unsigned) timeout);
+ --retries;
+ }
+ return LOCK_TIMEOUT;
+}
--- /dev/null
+/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <stdlib.h>
+
+static int
+read_short (unsigned short *shortp, FILE *file)
+{
+ unsigned char file_short[2];
+
+ if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
+ return 0;
+ *shortp = file_short[0] * 256 + file_short[1];
+ return 1;
+}
+
+static int
+read_counted_string (unsigned short *countp, char **stringp, FILE *file)
+{
+ unsigned short len;
+ char *data;
+
+ if (read_short (&len, file) == 0)
+ return 0;
+ if (len == 0) {
+ data = NULL;
+ } else {
+ data = malloc ((unsigned) len);
+ if (!data)
+ return 0;
+ if (fread (data, (int) sizeof (char), (int) len, file) != len) {
+ bzero (data, len);
+ free (data);
+ return 0;
+ }
+ }
+ *stringp = data;
+ *countp = len;
+ return 1;
+}
+
+Xauth *
+XauReadAuth (FILE *auth_file)
+{
+ Xauth local;
+ Xauth *ret;
+
+ if (read_short (&local.family, auth_file) == 0)
+ return NULL;
+ if (read_counted_string (&local.address_length, &local.address, auth_file) == 0)
+ return NULL;
+ if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) {
+ if (local.address) free (local.address);
+ return NULL;
+ }
+ if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) {
+ if (local.address) free (local.address);
+ if (local.number) free (local.number);
+ return NULL;
+ }
+ if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) {
+ if (local.address) free (local.address);
+ if (local.number) free (local.number);
+ if (local.name) free (local.name);
+ return NULL;
+ }
+ ret = (Xauth *) malloc (sizeof (Xauth));
+ if (!ret) {
+ if (local.address) free (local.address);
+ if (local.number) free (local.number);
+ if (local.name) free (local.name);
+ if (local.data) {
+ bzero (local.data, local.data_length);
+ free (local.data);
+ }
+ return NULL;
+ }
+ *ret = local;
+ return ret;
+}
--- /dev/null
+/* $Xorg: AuUnlock.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuUnlock.c,v 1.4 2001/12/14 19:54:36 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <X11/Xos.h>
+
+int
+XauUnlockAuth (
+_Xconst char *file_name)
+{
+#ifndef WIN32
+ char creat_name[1025];
+#endif
+ char link_name[1025];
+
+ if (strlen (file_name) > 1022)
+ return 0;
+#ifndef WIN32
+ (void) strcpy (creat_name, file_name);
+ (void) strcat (creat_name, "-c");
+#endif
+ (void) strcpy (link_name, file_name);
+ (void) strcat (link_name, "-l");
+ /*
+ * I think this is the correct order
+ */
+#ifndef WIN32
+ (void) unlink (creat_name);
+#endif
+ (void) unlink (link_name);
+
+ return 1;
+}
--- /dev/null
+/* $Xorg: AuWrite.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/Xau/AuWrite.c,v 1.3 2001/01/17 19:42:24 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+
+static int
+write_short (unsigned short s, FILE *file)
+{
+ unsigned char file_short[2];
+
+ file_short[0] = (s & (unsigned)0xff00) >> 8;
+ file_short[1] = s & 0xff;
+ if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
+ return 0;
+ return 1;
+}
+
+static int
+write_counted_string (unsigned short count, char *string, FILE *file)
+{
+ if (write_short (count, file) == 0)
+ return 0;
+ if (fwrite (string, (int) sizeof (char), (int) count, file) != count)
+ return 0;
+ return 1;
+}
+
+int
+XauWriteAuth (FILE *auth_file, Xauth *auth)
+{
+ if (write_short (auth->family, auth_file) == 0)
+ return 0;
+ if (write_counted_string (auth->address_length, auth->address, auth_file) == 0)
+ return 0;
+ if (write_counted_string (auth->number_length, auth->number, auth_file) == 0)
+ return 0;
+ if (write_counted_string (auth->name_length, auth->name, auth_file) == 0)
+ return 0;
+ if (write_counted_string (auth->data_length, auth->data, auth_file) == 0)
+ return 0;
+ return 1;
+}
--- /dev/null
+/* $Xorg: Autest.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Xauth.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char **argv)
+{
+ Xauth test_data;
+ char *name = "XAU-TEST-1";
+ char *data = "Do not begin the test until instructed to do so.";
+ char *file = NULL;
+ int state = 0;
+ FILE *output;
+
+ while (*++argv) {
+ if (!strcmp (*argv, "-file"))
+ file = *++argv;
+ else if (state == 0) {
+ name = *argv;
+ ++state;
+ } else if (state == 1) {
+ data = *argv;
+ ++state;
+ }
+ }
+ test_data.family = 0;
+ test_data.address_length = 0;
+ test_data.address = "";
+ test_data.number_length = 0;
+ test_data.number = "";
+ test_data.name_length = strlen (name);
+ test_data.name = name;
+ test_data.data_length = strlen (data);
+ test_data.data = data;
+ if (!file) {
+ output = tmpfile();
+ } else {
+ output = fopen (file, "w");
+ }
+ if (output) {
+ state = XauWriteAuth (output, &test_data);
+ fclose (output);
+ }
+ return (state = 1) ? 0 : 1;
+}
--- /dev/null
+Copyright 1988, 1993, 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
--- /dev/null
+commit a01b74fad039e68cf296bd5e83c6f538181e529a
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Jul 19 17:17:54 2010 +0100
+
+ Bump to 1.0.6
+
+commit ad12e7a68f69fdc960170c0248f07df68f0fc476
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Jul 19 17:18:34 2010 +0100
+
+ Require xorg-macros 1.4 for XORG_INSTALL
+
+commit f8f0ec4955e51a2a420724f9bc2287d5a725cb39
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Jul 19 17:16:13 2010 +0100
+
+ Kill cvs keyword
+
+commit 7d42fad5cec59cb0696087bed9745ffd5a999f68
+Author: Brice Goglin <Brice.Goglin@ens-lyon.org>
+Date: Sat May 29 21:11:14 2010 +0200
+
+ Xau.man: Add missing const attributes
+
+ Reported by Tom Fogal in
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583599
+
+commit f93ffa718135d9d85f04935325016b8766f05ea3
+Author: Brice Goglin <Brice.Goglin@ens-lyon.org>
+Date: Sat May 29 21:04:24 2010 +0200
+
+ Xau.man: Fix XauGetAuthByAddr() prototype
+
+ Add missing name_length and name parameters.
+
+ Reported by Tom Fogal in
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583599
+
+commit c0bc3fb7ac4f719b96257e29eaa60c2d5ed11705
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed May 26 21:59:15 2010 -0700
+
+ Use AC_PROG_SED to find sed to use for man pages
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ff907e90a2fe95bb234049a7a11e8e3b10d54533
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed May 26 21:57:12 2010 -0700
+
+ Use $(AM_V_GEN) to silence man page generation
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 58aef8ebf89cc8d6d4d67dc7572752db0c44b6c3
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Mar 30 09:05:41 2010 -0400
+
+ config: update AC_PREREQ statement to 2.60
+
+ Unrelated to the previous patches, the new value simply reflects
+ the reality that the minimum level for autoconf to configure
+ all x.org modules is 2.60 dated June 2006.
+
+ ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 8db2a151b92fe3a408d847c868d7823a0217b73d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Mar 30 09:05:05 2010 -0400
+
+ config: remove the pkgconfig pc.in file from EXTRA_DIST
+
+ Automake always includes it in the tarball.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 4039c624286061122e3350f9194dba27118ab904
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Feb 16 10:37:21 2010 -0500
+
+ config: move CWARNFLAGS from configure.ac to Makefile.am
+
+ Compiler warning flags should be explicitly set in the makefile
+ rather than being merged with other packages compiler flags.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 243b553ace945da0263bb32464dfdc45e0c70c88
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Nov 27 20:56:03 2009 -0500
+
+ Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+
+ Now that the INSTALL file is generated.
+ Allows running make maintainer-clean.
+
+commit eed5cf87f68c665503d0dae90baf8549bb61358e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Oct 28 14:09:10 2009 -0400
+
+ INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+
+ Add missing INSTALL file. Use standard GNU file on building tarball
+ README may have been updated
+ Remove AUTHORS file as it is empty and no content available yet.
+ Remove NEWS file as it is empty and no content available yet.
+
+commit 31fe929d3ea43cd8fbe2853157682677704883ad
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Oct 27 15:07:25 2009 -0400
+
+ Deploy the new XORG_DEFAULT_OPTIONS #24242
+
+ This macro aggregate a number of existing macros that sets commmon
+ X.Org components configuration options. It shields the configuration file from
+ future changes.
+
+commit f6ae36d4bf43cd601c3c1339100684169bbaeeb3
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Oct 26 22:08:42 2009 -0400
+
+ Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+
+ ChangeLog filename is known to Automake and requires no further
+ coding in the makefile.
+
+commit 6e702152714be9538e1ae1b3533843f972ceb1e9
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Oct 22 12:34:19 2009 -0400
+
+ .gitignore: use common defaults with custom section # 24239
+
+ Using common defaults will reduce errors and maintenance.
+ Only the very small or inexistent custom section need periodic maintenance
+ when the structure of the component changes. Do not edit defaults.
+
+commit 550725b423ec0364f0a32ed6935140617e366cf8
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date: Wed Oct 21 12:47:23 2009 -0700
+
+ This is not a GNU project, so declare it foreign.
+
+ On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+ > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+ > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+ > > was quite annoying to work around since 'autoreconf -fvi' replaces
+ > > it and git wants to commit it. Should these files even be in git?
+ > > Can I nuke them for the betterment of humanity and since they get
+ > > created by autoreconf anyways?
+ >
+ > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+
+ As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+ AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+ of the INSTALL file. It is also part of the 24206 solution.
+
+ Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit 825435514bd91d0d903247c46249a87d6fe8ae09
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Aug 28 14:34:32 2009 +1000
+
+ libXau 1.0.5
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fc54a4f03b926dfdb590b112c7128516ffc25539
+Author: Jeremy Huddleston <jeremy@yuffie.local>
+Date: Sun Feb 22 11:14:04 2009 -0800
+
+ Make file locking more robust for network shares like AFP
+
+commit 742ff03dcad4d16ca8901ed47be91b303523a385
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Fri Feb 6 11:35:40 2009 -0800
+
+ Restore FamilyKrb5Principal definition
+
+ Even if Kerberos5 support is currently unimplemented in the X server &
+ libXau, the Family id for the X11 protocol is still defined and reserved
+ for Kerberos5, and should be recorded here for interoperability with
+ other implementations and to avoid reuse if someone adds a new
+ authentication family in the future.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit c147fb417582e7384b5464bb53cfd492f9d7c69d
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Mon Feb 2 16:54:20 2009 -0200
+
+ Remove old api kerberos.
+
+ LibXau uses a 1993 kerberos api, but the X Server side support has
+ been already removed for quite some time.
+ This corrects bug report
+ https://bugs.freedesktop.org/show_bug.cgi?id=14684
+
+commit 11fbe620625520668f5e88e4f5a8fe149a7cfa3f
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Thu Jan 29 15:08:23 2009 -0200
+
+ Janitor: Correct make distcheck and remove extra .gitignore file.
+
+commit 7f6275300243fd15ce974d1b5e478b47f7758485
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Tue Aug 26 14:19:19 2008 -0700
+
+ Version bump: 1.0.4
+
+commit 753bf38ceca4a0c8d6c6c1845b4387e4b3c9e4f0
+Author: Damien Th?bault <damien.thebault@gmail.com>
+Date: Tue Aug 26 14:16:44 2008 -0700
+
+ Bug 17314: libXau's Makefile.am should have proper man creation rules
+
+ X.Org Bugzilla #17314 <http://bugs.freedesktop.org/show_bug.cgi?id=17314>
+ Patch #18528 <http://bugs.freedesktop.org/attachment.cgi?id=18528>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit a0b2aac596ea2cbe4d0ec1ef8c406ad98f0c499d
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Tue Jul 8 15:08:35 2008 -0700
+
+ SVR4 (including Solaris) puts gethostbyname_r in libnsl instead of libc
+
+commit 1bc9f04963a8a236cc190e75e32282774b556932
+Author: Daniel Drake <ddrake@brontes3d.com>
+Date: Tue May 29 14:06:00 2007 -0800
+
+ Bug #11097: libXau COPYING fix (add missing copyright dates)
+
+ X.Org Bugzilla #11097 <https://bugs.freedesktop.org/show_bug.cgi?id=11097>
+
+commit 45d137fdbb9b21513aff68e945e19cdfdcbc28b1
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sat Dec 16 01:18:20 2006 +0200
+
+ bump to 1.0.3
+
+commit fefdba6ed5ef56abf0da9caaca64af5a5e7895b0
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Wed Dec 6 18:53:29 2006 +0200
+
+ Makefile.am: make ChangeLog hook safer
+ Make ChangeLog hook as safe as possible.
+
+commit 90e34a4aa471b6e446345ba8095990e360a41570
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Fri Jul 28 13:47:44 2006 -0700
+
+ Version bump -> 1.0.2
+
+commit fab8b091936874b4a8077f490ec80abf7b092049
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Mon Jul 24 13:14:04 2006 -0700
+
+ Require xorg-macros 1.1.0 or later for XORG_WITH_LINT & XORG_LINT_LIBRARY macros
+
+commit 3399e7bed20680520b39ade782d7a33966d477ae
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Mon Jul 24 13:12:57 2006 -0700
+
+ Add lint library to CLEANFILES
+
+commit aa4f35661022f3f1c1b94284b34a531381d3a7f1
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Sun Jul 16 10:57:36 2006 +0200
+
+ set GIT_DIR=${srcdir}/.git for git-log
+
+commit 881115413a7c157c9aab8fba39c8929692baaacc
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jul 13 17:01:49 2006 -0700
+
+ Generate lint library for checking programs that call functions in libXau
+
+ (Disabled by default, enable with --enable-lint-library)
+
+commit f25155b03b9fa866d522714ad64e92bf7f2b95fa
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jul 13 15:16:11 2006 -0700
+
+ renamed: include/.cvsignore -> include/.gitignore
+
+commit 9062a6da402d416f21d4365d3c3a29ceea707e77
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Wed Jul 12 23:53:14 2006 -0700
+
+ Replace static ChangeLog with dist-hook to generate from git-log
+
+commit 9b5a14e6de65658fdb712e737b292568a69dc3ee
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Wed Jul 12 19:27:52 2006 -0700
+
+ Rename XORG_ENABLE_LINT to XORG_WITH_LINT
+
+commit d3f7a679fce893782774e97c0718393295d0773e
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Wed Jul 12 19:26:53 2006 -0700
+
+ Move --with-lint handling to XORG_ENABLE_LINT() in xorg-macros.m4
+
+commit 1abf440a6a54fb0624915f9ac975f3074252c422
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Wed Jul 12 19:25:38 2006 -0700
+
+ Add *~ to .gitignore to ignore emacs droppings
+
+commit 43b8275be56151bf0e29ce22795afbef24de0f9c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Wed Jul 12 17:00:16 2006 -0700
+
+ renamed: .cvsignore -> .gitignore
+
+commit 385d7fa4f151425539d613c9665b5e862f3ef614
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Wed Jun 28 22:53:36 2006 +0000
+
+ Add "--with-lint" configure flag and "make lint" Makefile target to check
+ source code with lint, sparse or similar tools.
+
+commit 21ea069c9078edd386e96e038e1a71e041e32cf5
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Wed Jun 28 22:49:36 2006 +0000
+
+ Changelog for last commit:
+ Remove prototype for XauGetAuthByName to clear lint warning: name declared
+ but never used or defined
+ Fix sparse warnings:
+ -warning: Using plain integer as NULL pointer
+ -warning: non-ANSI definition of function
+
+commit 8274b8e4b121c3dc3bfd5d0fa4f85bc23f5c09a0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Wed Jun 28 22:26:50 2006 +0000
+
+ Remove prototype for XauGetAuthByName to clear lint warning: name declared
+ but never used or defined
+ Fix sparse warnings:
+ -warning: Using plain integer as NULL pointer
+ -warning: non-ANSI definition of function
+
+commit 7f6f90cfce51806340f25b80a87b147d8a743b27
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Sat Jun 10 01:27:06 2006 +0000
+
+ Clean up existing Autest test program and use to provide simple (and very
+ incomplete) "make check" test case.
+
+commit e214cc19e1d599f16a69e86b1d8b247ad40a9ed7
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Fri May 12 16:05:48 2006 +0000
+
+ Bump to 1.0.1
+
+commit b92b597d7d597dd223371fe0ff60d1b2dad38fda
+Author: Kevin E Martin <kem@kem.org>
+Date: Mon May 8 19:47:10 2006 +0000
+
+ Bug #5628 <https://bugs.freedesktop.org/show_bug.cgi?id=5628> Shadow pages
+ not created correctly when MANDIR & MANSUFFIX don't match.
+
+commit 253a3e1c94642ccee9a3ed694eecb5382aa22b1e
+Author: Kevin E Martin <kem@kem.org>
+Date: Thu Dec 15 00:24:28 2005 +0000
+
+ Update package version number for final X11R7 release candidate.
+
+commit c7648c97a5da8824d2871f528da89dedc98e2598
+Author: Kevin E Martin <kem@kem.org>
+Date: Tue Dec 6 22:48:42 2005 +0000
+
+ Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit c0fbe656693cab8fdf8776fb4d0fa85d0efc4e20
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 05:49:42 2005 +0000
+
+ Update package version number for X11R7 RC3 release.
+
+commit d6d0baef6dd91cc1c3d3d701ad83ec095f02630c
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Nov 28 22:03:05 2005 +0000
+
+ Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
+ update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
+
+commit 1272a96ff8c6ee8c1ff5fc23c421b79ea4c15f92
+Author: Eric Anholt <anholt@freebsd.org>
+Date: Sun Nov 20 23:17:40 2005 +0000
+
+ Add/improve libs .cvsignores.
+
+commit 08bef4712fc1e9194db9c8910f461873b7065063
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Nov 19 07:15:40 2005 +0000
+
+ Update pkgconfig files to separate library build-time dependencies from
+ application build-time dependencies, and update package deps to work
+ with separate build roots.
+
+commit 307ff4cf91c1331c29470a9654d9d18293b45389
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Oct 19 02:48:09 2005 +0000
+
+ Update package version number for RC1 release.
+
+commit 913ed232278b0673a763eb46e97aea0f78348b5a
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Tue Oct 18 00:00:08 2005 +0000
+
+ Use @LIB_MAN_SUFFIX@ instead of $(LIB_MAN_SUFFIX) in macro substitutions to
+ work better with BSD make
+
+commit ce3af1f6d302e3b7adaba7e166f6f594aa13c310
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Oct 17 21:13:15 2005 +0000
+
+ Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a
+ suffix rule (reported by Matthieu Herrb)
+
+commit 86f92c112c22604824d2044b566b8cbee81cb397
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Wed Oct 12 00:39:36 2005 +0000
+
+ Use sed to put version number in man page Add shadow man pages for man
+ pages that document multiple functions.
+
+commit bd48f668b3c8d5de53e42b73ef4e4136d384672d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Thu Sep 22 01:40:07 2005 +0000
+
+ Set needed flags for MT-safe API's called from libXau
+
+commit 82affd3fdeafe063406d80e439c16b5d7ee66020
+Author: Kevin E Martin <kem@kem.org>
+Date: Fri Jul 29 21:22:50 2005 +0000
+
+ Various changes preparing packages for RC0:
+ - Verify and update package version numbers as needed
+ - Implement versioning scheme
+ - Change bug address to point to bugzilla bug entry form
+ - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+ reenable it)
+ - Fix makedepend to use pkgconfig and pass distcheck
+ - Update build script to build macros first
+ - Update modular Xorg version
+
+commit 2edd5e132ac2d1ca1a5631fb1e54970012b33f85
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Jul 9 06:06:57 2005 +0000
+
+ Add .cvsignore files
+
+commit 2527a93c7ba785499c52de48da9b60d02eb4722d
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Thu May 19 00:22:32 2005 +0000
+
+ revert last change, didn't do right thing at all, sorry for the noise
+
+commit fe846da148f3dd15e13e34216853d700cd2c51fd
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Thu May 19 00:10:07 2005 +0000
+
+ Require automake 1.7 in AM_INIT_AUTOMAKE
+
+commit 9607573553c23bcdfb1c3eaec3571aa52fdeb5ee
+Author: Josh Triplett <josh@speakeasy.net>
+Date: Sat May 14 07:46:48 2005 +0000
+
+ Move includes in Xau and Xdmcp into include/X11 subdirectories so that the
+ source can reference them with <X11/...>.
+
+commit 56a655e717c5de6d91c890fdc6f9b0469ad1dd1a
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Wed May 11 22:44:53 2005 +0000
+
+ lib/Xau:
+ - Update AUTHORS, COPYING from Keith's tree
+ - Don't use gcc specific "-include config.h"
+ - Add autogen.sh
+ lib/xtrans:
+ - Add AUTHORS, COPYING, ChangeLog, Makefile.am, NEWS, README, autogen.sh,
+ configure.ac, xtrans.pc.in
+ xc/lib/Xau:
+ - Add conditionalized #include <config.h>
+ util/modular/symlink.sh
+ - Add functions symlink_lib_xau() and symlink_lib_xtrans()
+ util/modular/addconfig.h
+ - New script that adds #include <config.h> to files
+
+commit 60177d823918d9ef7575da27870796c1285a2032
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon May 9 22:04:21 2005 +0000
+
+ Add Xau library to lib/ and symlink.sh
+
+commit 62b6efa4e0012fc499d2c70bff7b99b468a0458f
+Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
+Date: Mon Nov 15 15:06:55 2004 +0000
+
+ Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added
+ mingw (Win32) port
+
+commit 05ed20614e85180684d5b8e663dcc2fe57851447
+Author: Egbert Eich <eich@suse.de>
+Date: Fri Apr 23 18:43:36 2004 +0000
+
+ Merging XORG-CURRENT into trunk
+
+commit 0b934581a8612148d70ecf84df72f6a69ca6c5c2
+Author: Egbert Eich <eich@suse.de>
+Date: Sun Mar 14 08:32:01 2004 +0000
+
+ Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 1a9fc5ef22e3bdd719fc0f991512b6a1d88faaad
+Author: Egbert Eich <eich@suse.de>
+Date: Wed Mar 3 12:11:20 2004 +0000
+
+ Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 494e0315dcd701302bb81f2b68f759917ad401dd
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 13:35:30 2004 +0000
+
+ readding XFree86's cvs IDs
+
+commit 690d8700431f1afcb585897e7cc49b4fd7c9cf46
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 09:22:39 2004 +0000
+
+ Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit bca26a7b7c4c4f58d65462ffd3f1b0eaef2d5d4c
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Tue Nov 25 19:28:09 2003 +0000
+
+ XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 1be3101aeab9b6136c32a91c23799724a7fe7797
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 16:48:47 2003 +0000
+
+ XFree86 4.3.0.1
+
+commit dcc3fc52f917603df94ef4207f1dec9238dce23b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 15:54:38 2003 +0000
+
+ R6.6 is the Xorg base-line
--- /dev/null
+lib_LTLIBRARIES = libXau.la
+
+AM_CFLAGS = $(XAU_CFLAGS) $(CWARNFLAGS)
+
+INCLUDES = -I${top_srcdir}/include
+
+libXau_la_LDFLAGS = -version-number 6:0:0 -no-undefined
+
+libXau_la_LIBADD = $(XAU_LIBS)
+
+libXau_la_SOURCES = \
+ AuDispose.c \
+ AuFileName.c \
+ AuGetAddr.c \
+ AuGetBest.c \
+ AuLock.c \
+ AuRead.c \
+ AuUnlock.c \
+ AuWrite.c
+
+xauincludedir=$(includedir)/X11
+
+xauinclude_HEADERS = include/X11/Xauth.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xau.pc
+
+check_PROGRAMS=Autest
+TESTS=Autest
+
+Autest_SOURCES=Autest.c
+Autest_LDADD=libXau.la
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libXau_la_SOURCES)
+endif LINT
+
+if MAKE_LINT_LIB
+lintlibdir = $(libdir)
+
+lintlib_DATA = $(LINTLIB)
+
+$(LINTLIB): $(libXau_la_SOURCES)
+ $(LINT) -y -oXau -x $(ALL_LINT_FLAGS) $(libXau_la_SOURCES)
+endif MAKE_LINT_LIB
+
+LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%)
+
+libmandir = $(LIB_MAN_DIR)
+libman_PRE = Xau.man
+BUILT_SOURCES = $(Xau_shadows:=.@LIB_MAN_SUFFIX@)
+CLEANFILES = $(libman_DATA) $(BUILT_SOURCES) $(lintlib_DATA)
+libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@) \
+ $(Xau_shadows:=.@LIB_MAN_SUFFIX@)
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+EXTRA_DIST = $(libman_PRE)
+
+Xau_shadows = \
+ XauFileName \
+ XauReadAuth \
+ XauLockAuth \
+ XauUnlockAuth \
+ XauWriteAuth \
+ XauDisposeAuth \
+ XauGetAuthByAddr \
+ XauGetBestAuthByAddr
+
+Xau_shadows_man = $(Xau_shadows:=.@LIB_MAN_SUFFIX@)
+$(Xau_shadows_man):
+ $(AM_V_GEN)echo .so man$(LIB_MAN_DIR_SUFFIX)/Xau.$(LIB_MAN_SUFFIX) > $@
+
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
+
+Xau.$(LIB_MAN_SUFFIX): $(srcdir)/Xau.man
+ $(AM_V_GEN)$(SED) \
+ -e 's/__xorgversion__/"$(XORGRELSTRING)" "$(XORGMANNAME)"/' \
+ < $(srcdir)/Xau.man > Xau.$(LIB_MAN_SUFFIX)
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
--- /dev/null
+
+
+ A Sample Authorization Protocol for X
+
+
+Overview
+
+The following note describes a very simple mechanism for providing individual
+access to an X Window System display. It uses existing core protocol and
+library hooks for specifying authorization data in the connection setup block
+to restrict use of the display to only those clients that show that they
+know a server-specific key called a "magic cookie". This mechanism is *not*
+being proposed as an addition to the Xlib standard; among other reasons, a
+protocol extension is needed to support more flexible mechanisms. We have
+implemented this mechanism already; if you have comments, please send them
+to us.
+
+This scheme involves changes to the following parts of the sample release:
+
+ o xdm
+ - generate random magic cookie and store in protected file
+ - pass name of magic cookie file to server
+ - when user logs in, add magic cookie to user's auth file
+ - when user logs out, generate a new cookie for server
+
+ o server
+ - a new command line option to specify cookie file
+ - check client authorization data against magic cookie
+ - read in cookie whenever the server resets
+ - do not add local machine to host list if magic cookie given
+
+ o Xlib
+ - read in authorization data from file
+ - find data for appropriate server
+ - send authorization data if found
+
+ o xauth [new program to manage user auth file]
+ - add entries to user's auth file
+ - remove entries from user's auth file
+
+This mechanism assumes that the superuser and the transport layer between
+the client and the server is secure.
+
+
+Description
+
+The sample implementation will use the xdm Display Manager to set up and
+control the server's authorization file. Sites that do not run xdm will
+need to build their own mechanisms.
+
+Xdm uses a random key (seeded by the system time and check sum of /dev/kmem)
+to generate a unique sequence of characters at 16 bytes long. This sequence
+will be written to a file which is made readable only by the server. The
+server will then be started with a command line option instructing it to use
+the contents of the file as the magic cookie for connections that include
+authorization data. This will also disable the server from adding the local
+machine's address to the initial host list. Note that the actual cookie must
+not be stored on the command line or in an environment variable, to prevent
+it from being publicly obtainable by the "ps" command.
+
+If a client presents an authorization name of "MIT-MAGIC-COOKIE-1" and
+authorization data that matches the magic cookie, that client is allowed
+access. If the name or data does not match and the host list is empty,
+that client will be denied access. Otherwise, the existing host-based access
+control will be used. Since any client that is making a connection from a
+machine on the host list will be granted access even if their authorization
+data is incorrect, sites are strongly urged not to set up any default hosts
+using the /etc/X*.hosts files. Granting access to other machines should be
+done by the user's session manager instead.
+
+Assuming the server is configured with an empty host list, the existence of the
+cookie is sufficient to ensure there will be no unauthorized access to the
+display. However, xdm will (continue to) work to minimize the chances of
+spoofing on servers that do not support this authorization mechanism. This
+will be done by grabbing the server and the keyboard after opening the display.
+This action will be surrounded by a timer which will kill the server if the
+grabs cannot be done within several seconds. [This level of security is now
+implemented in patches already sent out.]
+
+After the user logs in, xdm will add authorization entries for each of the
+server machine's network addresses to the user's authorization file (the format
+of which is described below). This file will usually be named .Xauthority in
+the users's home directory; will be owned by the user (as specified by the
+pw_uid and pw_gid fields in the user's password entry), and will be accessible
+only to the user (no group access). This file will contain authorization data
+for all of the displays opened by the user.
+
+When the session terminates, xdm will generate and store a new magic cookie
+for the server. Then, xdm will shutdown its own connection and send a
+SIGHUP to the server process, which should cause the server to reset. The
+server will then read in the new magic cookie.
+
+To support accesses (both read and write) from multiple machines (for use in
+environments that use distributed file systems), file locking is done using
+hard links. This is done by creat'ing (sic) a lock file and then linking it
+to another name in the same directory. If the link-target already exists,
+the link will fail, indicating failure to obtain the lock. Linking is used
+instead of just creating the file read-only since link will fail even for
+the superuser.
+
+Problems and Solutions
+
+There are a few problems with .Xauthority as described. If no home directory
+exists, or if xdm cannot create a file there (disk full), xdm stores the
+cookie in a file in a resource-specified back-up directory, and sets an
+environment variable in the user's session (called XAUTHORITY) naming this
+file. There is also the problem that the locking attempts will need to be
+timed out, due to a leftover lock. Xdm, again, creates a file and set an
+environment variable. Finally, the back-up directory might be full. Xdm,
+as a last resort, provides a function key binding that allows a user to log
+in without having the authorization data stored, and with host-based access
+control disabled.
+
+Xlib
+
+XOpenDisplay in Xlib was enhanced to allow specification of authorization
+information. As implied above, Xlib looks for the data in the
+.Xauthority file of the home directory, or in the file pointed at by the
+XAUTHORITY environment variable instead if that is defined. This required
+no programmatic interface change to Xlib. In addition, a new Xlib routine
+is provided to explicitly specify authorization.
+
+ XSetAuthorization(name, namelen, data, datalen)
+ int namelen, datalen;
+ char *name, *data;
+
+There are three types of input:
+
+ name NULL, data don't care - use default authorization mechanism.
+ name non-NULL, data NULL - use the named authorization; get
+ data from that mechanism's default.
+ name non-NULL, data non-NULL - use the given authorization and data.
+
+This interface is used by xdm and might also be used by any other
+applications that wish to explicitly set the authorization information.
+
+Authorization File
+
+The .Xauthority file is a binary file consisting of a sequence of entries
+in the following format:
+
+ 2 bytes Family value (second byte is as in protocol HOST)
+ 2 bytes address length (always MSB first)
+ A bytes host address (as in protocol HOST)
+ 2 bytes display "number" length (always MSB first)
+ S bytes display "number" string
+ 2 bytes name length (always MSB first)
+ N bytes authorization name string
+ 2 bytes data length (always MSB first)
+ D bytes authorization data string
+
+The format is binary for easy processing, since authorization information
+usually consists of arbitrary data. Host addresses are used instead of
+names to eliminate potentially time-consuming name resolutions in
+XOpenDisplay. Programs, such as xdm, that initialize the user's
+authorization file will have to do the same work as the server in finding
+addresses for all network interfaces. If more than one entry matches the
+desired address, the entry that is chosen is implementation-dependent. In
+our implementation, it is always the first in the file.
+
+The Family is specified in two bytes to allow out-of-band values
+(i.e. values not in the Protocol) to be used. In particular,
+two new values "FamilyLocal" and "FamilyWild" are defined. FamilyLocal
+refers to any connections using a non-network method of connetion from the
+local machine (Unix domain sockets, shared memory, loopback serial line).
+In this case the host address is specified by the data returned from
+gethostname() and better be unique in a collection of machines
+which share NFS directories. FamilyWild is currently used only
+by xdm to communicate authorization data to the server. It matches
+any family/host address pair.
+
+For FamilyInternet, the host address is the 4 byte internet address, for
+FamilyDecnet, the host address is the byte decnet address, for FamilyChaos
+the address is also two bytes.
+
+The Display Number is the ascii representation of the display number
+portion of the display name. It is in ascii to allow future expansion
+to PseudoRoots or anything else that might happen.
+
+A utility called "xauth" will be provided for editing and viewing the
+contents of authorization files. Note that the user's authorization file is
+not the same as the server's magic cookie file.
--- /dev/null
+.\" $Xorg: Xau.man,v 1.3 2000/08/17 19:41:54 cpqbld Exp $
+.\" $XdotOrg$
+.\"
+.\" Copyright (c) 1994 X Consortium
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a
+.\" copy of this software and associated documentation files (the "Software"),
+.\" to deal in the Software without restriction, including without limitation
+.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
+.\" and/or sell copies of the Software, and to permit persons to whom the
+.\" Software furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice shall be included in
+.\" all copies or substantial portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+.\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.\"
+.\" Except as contained in this notice, the name of the X Consortium shall not
+.\" be used in advertising or otherwise to promote the sale, use or other
+.\" dealing in this Software without prior written authorization from the
+.\" X Consortium.
+.\"
+.\" $XFree86: xc/doc/man/Xau/Xau.man,v 1.2 2001/01/27 18:20:19 dawes Exp $
+.\"
+.TH Xau 3 __xorgversion__
+.SH NAME
+Xau library: XauFileName, XauReadAuth, XauLockAuth, XauUnlockAuth,
+XauWriteAuth, XauDisposeAuth,
+XauGetAuthByAddr, XauGetBestAuthByAddr \- X authority database routines
+.SH SYNOPSIS
+.B "#include <X11/Xauth.h>"
+.PP
+.nf
+.ta .5i 2i
+typedef struct xauth {
+ unsigned short family;
+ unsigned short address_length;
+ char *address;
+ unsigned short number_length;
+ char *number;
+ unsigned short name_length;
+ char *name;
+ unsigned short data_length;
+ char *data;
+} Xauth;
+
+.HP
+char *XauFileName (void);
+.HP
+Xauth *XauReadAuth (FILE *\fIauth_file\fP\^);
+.HP
+int XauWriteAuth (FILE *\fIauth_file\fP, Xauth *\fIauth\fP\^);
+.HP
+Xauth *XauGetAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
+\fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short
+\fInumber_length\fP\^, const char *\fInumber\fP\^, unsigned short
+\fIname_length\fP\^, const char *\fIname\fP\^);
+.HP
+Xauth *XauGetBestAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
+\fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short
+\fInumber_length\fP\^, const char *\fInumber\fP\^, int \fItypes_length\fP\^,
+char **\fItypes\fR\^, const int *\fItype_lengths\fR\^);
+.HP
+int XauLockAuth (const char *\fIfile_name\fP\^, int \fIretries\fP\^, int
+\fItimeout\fP\^, long \fIdead\fP\^);
+.HP
+int XauUnlockAuth (const char *\fIfile_name\fP\^);
+.HP
+int XauDisposeAuth (Xauth *\fIauth\fP\^);
+.ft R
+.SH DESCRIPTION
+.PP
+\fBXauFileName\fP generates the default authorization file name by first
+checking the XAUTHORITY environment variable if set, else it returns
+$HOME/.Xauthority. This name is statically allocated and should
+not be freed.
+.PP
+\fBXauReadAuth\fP reads the next entry from \fIauth_file\fP. The entry is
+\fBnot\fP statically allocated and should be freed by calling
+\fIXauDisposeAuth\fP.
+.PP
+\fBXauWriteAuth\fP writes an authorization entry to \fIauth_file\fP. It
+returns 1 on success, 0 on failure.
+.PP
+\fBXauGetAuthByAddr\fP searches for an entry which matches the given network
+address/display number pair. The entry is \fBnot\fP statically allocated
+and should be freed by calling \fIXauDisposeAuth\fP.
+.PP
+\fBXauGetBestAuthByAddr\fP is similar to \fBXauGetAuthByAddr\fP, except
+that a list of acceptable authentication methods is specified. Xau will
+choose the file entry which matches the earliest entry in this list (e.g., the
+most secure authentication method). The \fItypes\fP argument is an array of
+strings, one string for each authentication method. \fItypes_length\fP
+specifies how many elements are in the \fItypes\fP array.
+\fItypes_lengths\fP is an array of integers representing the length
+of each string.
+.PP
+\fBXauLockAuth\fP does the work necessary to synchronously update an
+authorization file. First it makes two file names, one with ``-c'' appended
+to \fIfile_name\fP, the other with ``-l'' appended. If the ``-c'' file
+already exists and is more than \fIdead\fP seconds old, \fIXauLockAuth\fP
+removes it and the associated ``-l'' file. To prevent possible
+synchronization troubles with NFS, a \fIdead\fP value of zero forces the
+files to be removed. \fIXauLockAuth\fP makes \fIretries\fP attempts to
+create and link the file names, pausing \fItimeout\fP seconds between each
+attempt. \fIXauLockAuth\fP returns a collection of values depending on the
+results:
+.nf
+.ta .5i 2i
+
+ LOCK_ERROR A system error occurred, either a file_name
+ which is too long, or an unexpected failure from
+ a system call. errno may prove useful.
+
+ LOCK_TIMEOUT \fIretries\fP attempts failed
+
+ LOCK_SUCCESS The lock succeeded.
+
+.fi
+.PP
+\fBXauUnlockAuth\fP undoes the work of \fIXauLockAuth\fP by unlinking both
+the ``-c'' and ``-l'' file names.
+.PP
+\fBXauDisposeAuth\fP frees storage allocated to hold an authorization entry.
+.SH "SEE ALSO"
+xauth(1), xdm(1)
+.SH AUTHOR
+Keith Packard, MIT X Consortium
--- /dev/null
+dnl
+dnl Copyright © 2003 Keith Packard, Noah Levitt
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation, and that the name of Keith Packard not be used in
+dnl advertising or publicity pertaining to distribution of the software without
+dnl specific, written prior permission. Keith Packard makes no
+dnl representations about the suitability of this software for any purpose. It
+dnl is provided "as is" without express or implied warranty.
+dnl
+dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+dnl PERFORMANCE OF THIS SOFTWARE.
+dnl
+dnl Process this file with autoconf to create configure.
+
+AC_PREREQ([2.60])
+AC_INIT(libXau, 1.0.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],libXau)
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.4)
+XORG_DEFAULT_OPTIONS
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_LIBTOOL_WIN32_DLL
+AM_PROG_LIBTOOL
+AC_PROG_MAKE_SET
+AC_PROG_SED
+
+PKG_CHECK_MODULES(XAU, xproto)
+
+AC_ARG_ENABLE(xthreads,
+ AC_HELP_STRING([--disable-xthreads],
+ [Disable libXau support for Multithreading]),
+ [xthreads=$enableval],[xthreads=yes])
+
+if test "x$xthreads" = "xyes" ; then
+ AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support])
+ AC_CHECK_LIB(c, gethostbyname_r, [mtsafe=yes])
+ if test "x$mtsafe" = "x" ; then
+ AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes])
+ fi
+ if test "x$mtsafe" = "xyes" ; then
+ AC_DEFINE(XUSE_MTSAFE_API, 1,
+ [Whether libXau needs to use MT safe API's])
+ fi
+
+dnl XXX incomplete, please fill this in
+ case $host_os in
+ solaris*)
+ XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
+ esac
+ XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
+fi
+
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+XORG_LINT_LIBRARY([Xau])
+LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
+
+
+AC_OUTPUT([Makefile
+ xau.pc])
--- /dev/null
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit"
+ (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+ may be git'cherry-picked into the Debian repository. In this
+ case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+ with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+ git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
--- /dev/null
+libxau (1:1.0.6-2slp2) unstable; urgency=low
+
+ * [X11R7.6] upgrade package
+ * Git: 165.213.180.234:slp/pkgs/xorg/lib/libxau
+ * Tag: libxau_1.0.6-2slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Mon, 03 Jan 2011 22:46:22 +0900
+
+libxau (1:1.0.6-1) unstable; urgency=low
+
+ * New upstream release
+ - manpage fixes (closes: #583599). Thanks, Tom Fogal!
+ * Drop Pre-Depends on x11-common, only necessary for upgrades from sarge.
+ * Bump build-dependency on xutils-dev for util-macros 1.4.
+ * Bump Standards-Version to 3.9.0.
+
+ -- Julien Cristau <jcristau@debian.org> Sat, 24 Jul 2010 11:43:07 +0200
+
+libxau (1:1.0.5-2) unstable; urgency=low
+
+ [ Julien Cristau ]
+ * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
+ good reason. Thanks, Colin Watson!
+ * Remove myself from Uploaders
+
+ [ Cyril Brulebois ]
+ * Add udeb needed for the graphical installer: libxau6-udeb.
+ * Add myself to Uploaders.
+ * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed).
+ * Add ${misc:Depends} to non-udeb binaries, and wrap Depends.
+
+ -- Cyril Brulebois <kibi@debian.org> Tue, 09 Mar 2010 02:21:32 +0100
+
+libxau (1:1.0.5-8slp2) unstable; urgency=low
+
+ * /git/slp/pkgs/xorg/lib/libxau
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libxau
+ * Tag: libxau_1.0.5-8slp2
+
+ -- YoungHoon Jung <yhoon.jung@samsung.com> Thu, 02 Dec 2010 14:25:34 +0900
+
+libxau (1:1.0.5-7slp2) unstable; urgency=low
+
+ * /git/slp/pkgs/xorg/lib/libxauu
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libxau
+ * Tag: libxau_1.0.5-7slp2
+
+ -- YoungHoon Jung <yhoon.jung@samsung.com> Thu, 02 Dec 2010 13:41:11 +0900
+
+libxau (1:1.0.5-6slp2) unstable; urgency=low
+
+ * Update maintainer
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+ * Tag: libxau_1.0.5-6slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Wed, 21 Apr 2010 12:59:47 +0900
+
+libxau (1:1.0.5-5slp2) unstable; urgency=low
+
+ * modify the package name
+
+ -- SooChan Lim <sc1.lim@samsung.com> Thu, 25 Mar 2010 17:40:51 +0900
+
+libxau (1:1.0.5-4) unstable; urgency=low
+
+ * Install .la files
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Mon, 07 Dec 2009 10:30:08 +0900
+
+libxau (1:1.0.5-3) unstable; urgency=low
+
+ * Update version not to make version problem
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Thu, 03 Dec 2009 14:47:29 +0900
+
+libxau (1:1.0.5-2) unstable; urgency=low
+
+ * Import Debian Package
+ * Modify install file to add .la
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Wed, 02 Dec 2009 14:50:17 +0900
+
+libxau (1:1.0.5-1) unstable; urgency=low
+
+ * New upstream release
+ * Update xsfbs to 5693792171d885769e58dcccc053c08b11acd12a
+ + README.source lets us bump standards version to 3.8.3.0
+ * Change -dbg package to "debug" section
+ * Delete autogen.sh, which gets installed at build time
+
+ -- David Nusinow <dnusinow@debian.org> Mon, 14 Sep 2009 21:37:57 -0400
+
+libxau (1:1.0.4-2) unstable; urgency=low
+
+ * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org> Mon, 16 Feb 2009 19:02:29 +0100
+
+libxau (1:1.0.4-1) experimental; urgency=low
+
+ [ Brice Goglin ]
+ * Add upstream URL to debian/copyright.
+ * Add a link to www.X.org and a reference to the upstream module
+ in the long description.
+
+ [ Timo Aaltonen ]
+ * New upstream release.
+
+ [ Julien Cristau ]
+ * Run autoreconf on build, add build-deps on automake, autoconf, libtool and
+ xutils-dev.
+ * Handle parallel builds.
+
+ -- Julien Cristau <jcristau@debian.org> Fri, 19 Dec 2008 13:11:10 +0100
+
+libxau (1:1.0.3-3) unstable; urgency=low
+
+ * Remove Branden from Uploaders with his permission.
+ * Add myself to Uploaders.
+ * Bump Standards-Version to 3.7.3.
+ * Drop the XS- prefix from Vcs-* control fields.
+ * libxau6{,-dbg} don't need to depend on x11-common.
+ * Use ${binary:Version} instead of the deprecated ${Source-Version}.
+
+ -- Julien Cristau <jcristau@debian.org> Fri, 16 May 2008 15:15:13 +0200
+
+libxau (1:1.0.3-2) unstable; urgency=low
+
+ * Remove Fabio from Uploaders, with his permission.
+ * Add XS-Vcs-Browser.
+ * Put binary packages in the correct sections.
+ * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 11 Apr 2007 17:31:27 +0200
+
+libxau (1:1.0.3-1) experimental; urgency=low
+
+ [ Julien Cristau ]
+ * New upstream release.
+ * Drop outdated CVS info from the descriptions and add XS-Vcs-Git.
+ * Install the upstream changelog.
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 8 Feb 2007 21:21:05 -0500
+
+libxau (1:1.0.1-2) unstable; urgency=low
+
+ [ David Nusinow ]
+ * Run dh_install with --list-missing
+
+ [ Andres Salomon ]
+ * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+ idempotency fix.
+
+ [ Drew Parsons ]
+ * dbg package has priority extra.
+
+ -- David Nusinow <dnusinow@debian.org> Tue, 29 Aug 2006 19:52:49 +0000
+
+libxau (1:1.0.1-1) experimental; urgency=low
+
+ * New upstream version
+ * Set up package to be able to use patches even if we're not currently
+ shipping any. Add quilt to build-dep to deal.
+ * Autoreconf to fix manpage sections (closes: #376026, #356545)
+ * Remove duplicate x11-common depends from libxau-dev
+ * Version x11-common pre-dep in libxau-dev to 1:7.0.0 to match the rest of
+ Debian and shut lintian up
+ * Bump standards version to 3.7.2.0
+ * Bump debhelper compat to 5
+
+ -- David Nusinow <dnusinow@debian.org> Sun, 2 Jul 2006 21:23:08 -0400
+
+libxau (1:1.0.0-4) unstable; urgency=low
+
+ * Build with LIB_MAN_SUFFIX=3 so that manual pages have a .3 extension
+ insteod of .3x. Closes: #356545, #368165
+ * Bump Standards-Version: 3.7.2, no changes needed.
+ * Clean out Depends fields in debian/control, drop all ${misc:Depends}
+ substitutions, and libxau-dev does not need ${shlibs:Depends} and
+ x11-common (the latter because it Pre-Depends on it).
+ * Lintian wants libxau-dev Pre-Depends: x11-common (>= 1:7.0.0)
+ so bump x11-common version to this value.
+
+ -- Denis Barbier <barbier@debian.org> Mon, 14 Aug 2006 20:10:31 +0200
+
+libxau (1:1.0.0-3) unstable; urgency=low
+
+ * Reorder makeshlib command in rules file so that ldconfig is run
+ properly. Thanks Drew Parsons and Steve Langasek.
+
+ -- David Nusinow <dnusinow@debian.org> Tue, 18 Apr 2006 21:49:56 -0400
+
+libxau (1:1.0.0-2) unstable; urgency=low
+
+ * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 23 Mar 2006 22:44:28 -0500
+
+libxau (1:1.0.0-1) experimental; urgency=low
+
+ * First upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 29 Dec 2005 20:51:23 -0500
+
+libxau (1:0.1.2-2) breezy; urgency=low
+
+ * Add build dependencies: pkg-config, x11proto-core-dev
+ * Change Build-Depends-Indep to Build-Depends.
+
+ -- Matthias Klose <doko@ubuntu.com> Mon, 23 May 2005 20:17:11 +0000
+
+libxau (1:0.1.2-1) breezy; urgency=low
+
+ * First libxau release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Mon, 16 May 2005 22:10:17 +1000
--- /dev/null
+Source: libxau
+Section: x11
+Priority: optional
+Maintainer: YoungHoon Jung <yhoon.jung@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, David Nusinow <dnusinow@debian.org>, Cyril Brulebois <kibi@debian.org>
+Build-Depends: debhelper (>= 5.0.0), pkg-config, x11proto-core-dev, quilt, autoconf, automake, libtool, xutils-dev (>= 1:7.5-1slp2+1),
+Standards-Version: 3.9.0
+Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libxau
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libxau.git
+
+Package: libxau6
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: X11 authorisation library
+ This package provides the main interface to the X11 authorisation handling,
+ which controls authorisation for X connections, both client-side and
+ server-side.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXau
+
+#Package: libxau6-udeb
+#XC-Package-Type: udeb
+#Section: debian-installer
+#Architecture: any
+#Depends: ${shlibs:Depends},
+#Description: X11 authorisation library
+# This is a udeb, or a microdeb, for the debian-installer.
+
+Package: libxau6-dbg
+Section: debug
+Architecture: any
+Priority: extra
+Depends: ${shlibs:Depends}, libxau6 (= ${binary:Version})
+Description: X11 authorisation library (debug package)
+ This package provides the main interface to the X11 authorisation handling,
+ which controls authorisation for X connections, both client-side and
+ server-side.
+ .
+ This package contains the debug versions of the library found in libxau6.
+ Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXau
+
+Package: libxau-dev
+Section: libdevel
+Architecture: any
+Depends: ${shlibs:Depends}, libxau6 (= ${binary:Version}), x11proto-core-dev
+Pre-Depends: x11-common (>= 1:7.0.0)
+Description: X11 authorisation library (development headers)
+ This package provides the main interface to the X11 authorisation handling,
+ which controls authorisation for X connections, both client-side and
+ server-side.
+ .
+ This package contains the development headers for the library found in libxau6.
+ Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXau
--- /dev/null
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/lib/
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
--- /dev/null
+usr/include/X11/*
+usr/share/man/man3/*
+usr/lib/libXau.a
+usr/lib/libXau.so
+usr/lib/libXau.la
+usr/lib/pkgconfig/xau.pc
--- /dev/null
+usr/lib/libXau.so.6*
--- /dev/null
+usr/lib/libXau.so.6*
--- /dev/null
+#!/usr/bin/make -f
+# debian/rules for the Debian libxau package.
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright © 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# set this to the name of the main shlib's binary package
+PACKAGE = libxau6
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+ confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+# confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+configure: $(STAMP_DIR)/patch
+ autoreconf -vfi
+
+obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
+ mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
+ cd obj-$(DEB_BUILD_GNU_TYPE) && \
+ ../configure \
+ --prefix=/usr \
+ --mandir=\$${prefix}/share/man \
+ --infodir=\$${prefix}/share/info \
+ $(confflags) \
+ CFLAGS="$(CFLAGS)"
+
+build: build-stamp
+build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
+ dh_testdir
+
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+
+ touch build-stamp
+
+clean: xsfclean
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ rm -f config.cache config.log config.status
+ rm -f */config.cache */config.log */config.status
+ rm -f conftest* */conftest*
+ rm -rf autom4te.cache */autom4te.cache
+ rm -rf obj-*
+ rm -f $$(find -name Makefile.in)
+ rm -f compile config.guess config.sub configure depcomp install-sh
+ rm -f ltmain.sh missing INSTALL aclocal.m4 mkinstalldirs config.h.in
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+
+# dh_installdocs
+ dh_install --sourcedir=debian/tmp --list-missing
+# dh_installchangelogs ChangeLog
+ dh_link
+ dh_strip --dbg-package=$(PACKAGE)-dbg
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs
+# dh_makeshlibs --add-udeb=$(PACKAGE)-udeb
+ dh_shlibdeps
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture-independent files here.
+binary-indep: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- /dev/null
+version=3
+http://xorg.freedesktop.org/releases/individual/lib/ libXau-(.*)\.tar\.gz
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+ exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+ exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+ exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
--- /dev/null
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number. Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+ ARCH:=$(ARCH)
+ else
+ ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+# 1) A target name that is invoked by a package-building tool or the user.
+# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+# 2) A line delcaring 1) as a phony target (".PHONY:").
+# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+# depend on other targets.
+# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+# "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir". Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again. Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+ mkdir $(STAMP_DIR)
+ >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+ >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+ mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+ if ! [ `which quilt` ]; then \
+ echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+ exit 1; \
+ fi; \
+ if $(QUILT) next >/dev/null 2>&1; then \
+ echo -n "Applying patches..."; \
+ if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "No patches to apply"; \
+ fi; \
+ >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+ rm -f $(STAMP_DIR)/patch
+ @echo -n "Unapplying patches..."; \
+ if $(QUILT) applied >/dev/null 2>/dev/null; then \
+ if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "nothing to do."; \
+ fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+ rm -f $(STAMP_DIR)/genscripts
+ rm -f debian/*.config \
+ debian/*.postinst \
+ debian/*.postrm \
+ debian/*.preinst \
+ debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+ dh_testdir
+ rm -rf .pc
+ rm -rf $(STAMP_DIR) $(SOURCE_DIR)
+ rm -rf imports
+ dh_clean debian/shlibs.local \
+ debian/po/pothead
+
+# Generate the debconf templates POT file header.
+debian/po/pothead: debian/po/pothead.in
+ sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \
+ -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@
+
+# Update POT and PO files.
+.PHONY: updatepo
+updatepo: debian/po/pothead
+ debian/scripts/debconf-updatepo --pot-header=pothead --verbose
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems. It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+ # Ensure we're in the correct directory.
+ dh_testdir
+ grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+ @echo -n "Auditing patches..."; \
+ >$(STAMP_DIR)/log/patch; \
+ FUZZY=; \
+ while [ -n "$$($(QUILT) next)" ]; do \
+ RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+ case "$$RESULT" in \
+ succeeded) \
+ echo "fuzzy patch: $$($(QUILT) top)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+ FUZZY=yes; \
+ ;; \
+ FAILED) \
+ echo "broken patch: $$($(QUILT) next)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+ exit 1; \
+ ;; \
+ esac; \
+ done; \
+ if [ -n "$$FUZZY" ]; then \
+ echo "there were fuzzy patches; please fix."; \
+ exit 1; \
+ else \
+ echo "done."; \
+ fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+ for FILE in debian/*.config.in \
+ debian/*.postinst.in \
+ debian/*.postrm.in \
+ debian/*.preinst.in \
+ debian/*.prerm.in; do \
+ if [ -e "$$FILE" ]; then \
+ MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+ sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+ cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+ sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+ sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+ -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+ -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \
+ <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+ rm $$MAINTSCRIPT.tmp; \
+ fi; \
+ done
+ # Validate syntax of generated shell scripts.
+ #sh debian/scripts/validate-posix-sh debian/*.config \
+ # debian/*.postinst \
+ # debian/*.postrm \
+ # debian/*.preinst \
+ # debian/*.prerm
+ >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+ @echo error: xserver-xorg-dev needs to be installed
+ @exit 1
+else
+ echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+ echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+ echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
--- /dev/null
+# $Id$
+
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts. It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions. By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+ DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+ DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+ RECONFIGURE="true"
+else
+ RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+ FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+ UPGRADE="yes"
+fi
+
+trap "message;\
+ message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+ message;\
+ exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+ # syntax: reject_nondigits [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters other than decimal digits and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain anything but digits?
+ if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ # can't use die(), because it wraps message() which wraps this function
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+ "possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+reject_unlikely_path_chars () {
+ # syntax: reject_unlikely_path_chars [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters unlikely to be seen in a path and which the shell might
+ # interpret and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain any funny characters?
+ if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+ # can't use die(), because I want to avoid forward references
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+ "encountered possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user. This is used only as a fallback in the
+# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ DEFCOLUMNS=80
+fi
+
+message () {
+ # pretty-print messages of arbitrary length
+ reject_nondigits "$COLUMNS"
+ echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+ # syntax: observe message ...
+ #
+ # issue observational message suitable for logging someday when support for
+ # it exists in dpkg
+ if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+ message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+ fi
+}
+
+warn () {
+ # syntax: warn message ...
+ #
+ # issue warning message suitable for logging someday when support for
+ # it exists in dpkg; also send to standard error
+ message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+ # syntax: die message ...
+ #
+ # exit script with error message
+ message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+ exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+ # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+ message "internal error: $*"
+ if [ -n "$OFFICIAL_BUILD" ]; then
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ fi
+ exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+ message "usage error: $*"
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+ # run $UPDATECMDS in $FONTDIRS
+
+ local dir cmd shortcmd x_font_dir_prefix
+
+ x_font_dir_prefix="/usr/share/fonts/X11"
+
+ if [ -z "$UPDATECMDS" ]; then
+ usage_error "font_update() called but \$UPDATECMDS not set"
+ fi
+ if [ -z "$FONTDIRS" ]; then
+ usage_error "font_update() called but \$FONTDIRS not set"
+ fi
+
+ reject_unlikely_path_chars "$UPDATECMDS"
+ reject_unlikely_path_chars "$FONTDIRS"
+
+ for dir in $FONTDIRS; do
+ if [ -d "$x_font_dir_prefix/$dir" ]; then
+ for cmd in $UPDATECMDS; do
+ if which "$cmd" > /dev/null 2>&1; then
+ shortcmd=${cmd##*/}
+ observe "running $shortcmd in $dir font directory"
+ cmd_opts=
+ if [ "$shortcmd" = "update-fonts-alias" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-dir" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-scale" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+ "failed; font directory data may not" \
+ "be up to date"
+ else
+ warn "$cmd not found; not updating corresponding $dir font" \
+ "directory data"
+ fi
+ done
+ else
+ warn "$dir is not a directory; not updating font directory data"
+ fi
+ done
+}
+
+remove_conffile_prepare () {
+ # syntax: remove_conffile_prepare filename official_md5sum ...
+ #
+ # Check a conffile "filename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 2 ]; then
+ usage_error "remove_conffile_prepare() called with wrong number of" \
+ "arguments; expected at least 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+ shift
+
+ # does the conffile even exist?
+ if [ -e "$conffile" ]; then
+ # calculate its checksum
+ current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+ # compare it to each supplied checksum
+ while [ -n "$1" ]; do
+ if [ "$current_checksum" = "$1" ]; then
+ # we found a match; move the confffile and stop looking
+ observe "preparing obsolete conffile $conffile for removal"
+ mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+ break
+ fi
+ shift
+ done
+ fi
+}
+
+remove_conffile_lookup () {
+ # syntax: remove_conffile_lookup package filename
+ #
+ # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+ # if it matches the actual file's md5sum.
+ #
+ # Call this function when you would call remove_conffile_prepare but only
+ # want to check against dpkg's status database instead of known checksums.
+
+ local package conffile old_md5sum
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "remove_conffile_lookup() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ package="$1"
+ conffile="$2"
+
+ if ! [ -e "$conffile" ]; then
+ return
+ fi
+ old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+ awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+ if [ -n "$old_md5sum" ]; then
+ remove_conffile_prepare "$conffile" "$old_md5sum"
+ fi
+}
+
+remove_conffile_commit () {
+ # syntax: remove_conffile_commit filename
+ #
+ # Complete the removal of a conffile "filename" that has become obsolete.
+ #
+ # Call this function from a postinst script after having used
+ # remove_conffile_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_commit() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, remove it
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "committing removal of obsolete conffile $conffile"
+ rm "$conffile.$THIS_PACKAGE-tmp"
+ fi
+}
+
+remove_conffile_rollback () {
+ # syntax: remove_conffile_rollback filename
+ #
+ # Roll back the removal of a conffile "filename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" is after having used remove_conffile_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_rollback() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, move it
+ # back
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "rolling back removal of obsolete conffile $conffile"
+ mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+ fi
+}
+
+replace_conffile_with_symlink_prepare () {
+ # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+ # official_md5sum ...
+ #
+ # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails. Otherwise copy it
+ # to newfilename and let dpkg handle it through conffiles mechanism.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 3 ]; then
+ usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+ " number of arguments; expected at least 3, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ shift
+ newconffile="$1"
+ shift
+
+ remove_conffile_prepare "$_oldconffile" "$@"
+ # If $oldconffile still exists, then md5sums didn't match.
+ # Copy it to new one.
+ if [ -f "$oldconffile" ]; then
+ cp "$oldconffile" "$newconffile"
+ fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+ # syntax: replace_conffile_with_symlink_commit oldfilename
+ #
+ # Complete the removal of a conffile "oldfilename" that has been
+ # replaced by a symlink.
+ #
+ # Call this function from a postinst script after having used
+ # replace_conffile_with_symlink_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+ "number of arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+ # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+ #
+ # Roll back the replacing of a conffile "oldfilename" with symlink to
+ # "newfilename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" and verify $2 to ensure the package failed to upgrade
+ # from a version (or install over a version removed-but-not-purged) prior
+ # to the one in which the conffile was obsoleted.
+ # You should have used replace_conffile_with_symlink_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+ "number of arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ newconffile="$2"
+
+ remove_conffile_rollback "$_oldconffile"
+ if [ -f "$newconffile" ]; then
+ rm "$newconffile"
+ fi
+}
+
+run () {
+ # syntax: run command [ argument ... ]
+ #
+ # Run specified command with optional arguments and report its exit status.
+ # Useful for commands whose exit status may be nonzero, but still acceptable,
+ # or commands whose failure is not fatal to us.
+ #
+ # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+ # those cases the return value of the debconf command *must* be checked
+ # before the string returned by debconf is used for anything.
+
+ local retval
+
+ # validate arguments
+ if [ $# -lt 1 ]; then
+ usage_error "run() called with wrong number of arguments; expected at" \
+ "least 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ "$@" || retval=$?
+
+ if [ ${retval:-0} -ne 0 ]; then
+ observe "command \"$*\" exited with status $retval"
+ fi
+}
+
+make_symlink_sane () {
+ # syntax: make_symlink_sane symlink target
+ #
+ # Ensure that the symbolic link symlink exists, and points to target.
+ #
+ # If symlink does not exist, create it and point it at target.
+ #
+ # If symlink exists but is not a symbolic link, back it up.
+ #
+ # If symlink exists, is a symbolic link, but points to the wrong location, fix
+ # it.
+ #
+ # If symlink exists, is a symbolic link, and already points to target, do
+ # nothing.
+ #
+ # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "make_symlink_sane() called with wrong number of arguments;" \
+ "expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local symlink target
+
+ symlink="$1"
+ target="$2"
+
+ if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+ observe "link from $symlink to $target already exists"
+ else
+ observe "creating symbolic link from $symlink to $target"
+ mkdir -p "${target%/*}" "${symlink%/*}"
+ ln -s -b -S ".dpkg-old" "$target" "$symlink"
+ fi
+}
+
+migrate_dir_to_symlink () {
+ # syntax: migrate_dir_to_symlink old_location new_location
+ #
+ # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+ # symbolic link to a directory or vice versa; instead, the existing state
+ # (symlink or not) will be left alone and dpkg will follow the symlink if
+ # there is one."
+ #
+ # We have to do it ourselves.
+ #
+ # This function moves the contents of old_location, a directory, into
+ # new_location, a directory, then makes old_location a symbolic link to
+ # new_location.
+ #
+ # old_location need not exist, but if it does, it must be a directory (or a
+ # symlink to a directory). If it is not, it is backed up. If new_location
+ # exists already and is not a directory, it is backed up.
+ #
+ # This function should be called from a package's preinst so that other
+ # packages unpacked after this one --- but before this package's postinst runs
+ # --- are unpacked into new_location even if their payloads contain
+ # old_location filespecs.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "migrate_dir_to_symlink() called with wrong number of"
+ "arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local new old
+
+ old="$1"
+ new="$2"
+
+ # Is old location a symlink?
+ if [ -L "$old" ]; then
+ # Does it already point to new location?
+ if [ "$(readlink "$old")" = "$new" ]; then
+ # Nothing to do; migration has already been done.
+ observe "migration of $old to $new already done"
+ return 0
+ else
+ # Back it up.
+ warn "backing up symbolic link $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+ fi
+
+ # Does old location exist, but is not a directory?
+ if [ -e "$old" ] && ! [ -d "$old" ]; then
+ # Back it up.
+ warn "backing up non-directory $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+
+ observe "migrating $old to $new"
+
+ # Is new location a symlink?
+ if [ -L "$new" ]; then
+ # Does it point the wrong way, i.e., back to where we're migrating from?
+ if [ "$(readlink "$new")" = "$old" ]; then
+ # Get rid of it.
+ observe "removing symbolic link $new which points to $old"
+ rm "$new"
+ else
+ # Back it up.
+ warn "backing up symbolic link $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+ fi
+
+ # Does new location exist, but is not a directory?
+ if [ -e "$new" ] && ! [ -d "$new" ]; then
+ warn "backing up non-directory $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+
+ # Create new directory if it does not yet exist.
+ if ! [ -e "$new" ]; then
+ observe "creating $new"
+ mkdir -p "$new"
+ fi
+
+ # Copy files in old location to new location. Back up any filenames that
+ # already exist in the new location with the extension ".dpkg-old".
+ observe "copying files from $old to $new"
+ if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+ die "error(s) encountered while copying files from $old to $new"
+ fi
+
+ # Remove files at old location.
+ observe "removing $old"
+ rm -r "$old"
+
+ # Create symlink from old location to new location.
+ make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
--- /dev/null
+/* $Xorg: Xauth.h,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
+
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/* $XFree86: xc/lib/Xau/Xauth.h,v 1.5 2001/12/14 19:54:36 dawes Exp $ */
+
+#ifndef _Xauth_h
+#define _Xauth_h
+
+typedef struct xauth {
+ unsigned short family;
+ unsigned short address_length;
+ char *address;
+ unsigned short number_length;
+ char *number;
+ unsigned short name_length;
+ char *name;
+ unsigned short data_length;
+ char *data;
+} Xauth;
+
+#ifndef _XAUTH_STRUCT_ONLY
+
+# include <X11/Xfuncproto.h>
+# include <X11/Xfuncs.h>
+
+# include <stdio.h>
+
+# define FamilyLocal (256) /* not part of X standard (i.e. X.h) */
+# define FamilyWild (65535)
+# define FamilyNetname (254) /* not part of X standard */
+# define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
+# define FamilyLocalHost (252) /* for local non-net authentication */
+
+
+_XFUNCPROTOBEGIN
+
+char *XauFileName(void);
+
+Xauth *XauReadAuth(
+FILE* /* auth_file */
+);
+
+int XauLockAuth(
+_Xconst char* /* file_name */,
+int /* retries */,
+int /* timeout */,
+long /* dead */
+);
+
+int XauUnlockAuth(
+_Xconst char* /* file_name */
+);
+
+int XauWriteAuth(
+FILE* /* auth_file */,
+Xauth* /* auth */
+);
+
+Xauth *XauGetAuthByAddr(
+#if NeedWidePrototypes
+unsigned int /* family */,
+unsigned int /* address_length */,
+#else
+unsigned short /* family */,
+unsigned short /* address_length */,
+#endif
+_Xconst char* /* address */,
+#if NeedWidePrototypes
+unsigned int /* number_length */,
+#else
+unsigned short /* number_length */,
+#endif
+_Xconst char* /* number */,
+#if NeedWidePrototypes
+unsigned int /* name_length */,
+#else
+unsigned short /* name_length */,
+#endif
+_Xconst char* /* name */
+);
+
+Xauth *XauGetBestAuthByAddr(
+#if NeedWidePrototypes
+unsigned int /* family */,
+unsigned int /* address_length */,
+#else
+unsigned short /* family */,
+unsigned short /* address_length */,
+#endif
+_Xconst char* /* address */,
+#if NeedWidePrototypes
+unsigned int /* number_length */,
+#else
+unsigned short /* number_length */,
+#endif
+_Xconst char* /* number */,
+int /* types_length */,
+char** /* type_names */,
+_Xconst int* /* type_lengths */
+);
+
+void XauDisposeAuth(
+Xauth* /* auth */
+);
+
+_XFUNCPROTOEND
+
+/* Return values from XauLockAuth */
+
+# define LOCK_SUCCESS 0 /* lock succeeded */
+# define LOCK_ERROR 1 /* lock unexpectely failed, check errno */
+# define LOCK_TIMEOUT 2 /* lock failed, timeouts expired */
+
+#endif /* _XAUTH_STRUCT_ONLY */
+
+#endif /* _Xauth_h */
--- /dev/null
+
+Name: libXau
+Summary: X.Org X11 libXau runtime library
+Version: 1.0.6
+Release: 1
+Group: System/Libraries
+License: MIT
+URL: http://www.x.org/
+Source0: http://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(xproto)
+BuildRequires: pkgconfig(xorg-macros)
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+Description: %{summary}
+
+
+%package devel
+Summary: Development components for the libXau library
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Description: %{summary}
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+
+%reconfigure
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+%clean
+rm -rf %{buildroot}
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS COPYING README ChangeLog
+%{_libdir}/libXau.so.6
+%{_libdir}/libXau.so.6.0.0
+
+
+%files devel
+%defattr(-,root,root,-)
+%dir %{_includedir}/X11
+%{_includedir}/X11/Xauth.h
+%{_libdir}/libXau.so
+%{_libdir}/pkgconfig/xau.pc
+#%dir %{_mandir}/man3x
+%doc %{_mandir}/man3/*.3*
+
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Xau
+Description: X authorization file management libary
+Version: @PACKAGE_VERSION@
+Requires: xproto
+Cflags: -I${includedir}
+Libs: -L${libdir} -lXau