[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xauth: Changes to 'debian-unstable'



 ChangeLog        |   45 ++++++
 Makefile.am      |    6 
 README           |    4 
 configure.ac     |    8 -
 debian/changelog |    6 
 gethost.c        |   59 +-------
 parsedpy.c       |   14 +-
 process.c        |  362 +++++++++++++++++++++++++++----------------------------
 xauth.c          |   28 ++--
 xauth.h          |   18 +-
 10 files changed, 281 insertions(+), 269 deletions(-)

New commits:
commit 2c7db60e03259d555ed5142a9cb74f372fbe9a12
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue May 1 00:28:52 2012 +0200

    Bump changelogs

diff --git a/ChangeLog b/ChangeLog
index 68ce46e..bde3352 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+commit 374c8c7005200c13299fdcb7b7d1b12f9f4258ae
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Mar 22 21:41:35 2012 -0700
+
+    xauth 1.0.7
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit fbc307f3445a549815efb2476e9476bd51250cf6
+Author: Andreas Schwab <schwab@linux-m68k.org>
+Date:   Fri Sep 3 13:45:49 2010 +0200
+
+    Remove alarm handler in get_hostname
+    
+    gethostbyaddr is not (required to be) async-signal-safe.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit ee3e046dfd84cda1588eef155c7e7c36df9bf5f4
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Sep 28 19:57:15 2011 -0700
+
+    Add const attributes to fix gcc -Wwrite-strings warnings
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 7f7f8cd60795c9503156950d518caa04b30a94a2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Sep 28 19:50:40 2011 -0700
+
+    Strip trailing whitespace
+    
+    Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
+    git diff -w & git diff -b show no diffs from this change
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit eb5ed59c623aa360677f62a7fd6e398ee9f3cab5
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Sep 28 19:39:20 2011 -0700
+
+    convert strlen/malloc/strcpy combo to strdup
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
 commit b67f0df2dbfa372417d0687e26704635e2d10034
 Author: Jeremy Huddleston <jeremyhu@apple.com>
 Date:   Mon May 23 19:38:50 2011 -0700
diff --git a/debian/changelog b/debian/changelog
index c5eae8f..fa09c2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xauth (1:1.0.7-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 01 May 2012 00:28:43 +0200
+
 xauth (1:1.0.6-1) unstable; urgency=low
 
   * New upstream release.

commit 374c8c7005200c13299fdcb7b7d1b12f9f4258ae
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Mar 22 21:41:35 2012 -0700

    xauth 1.0.7
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 2586e18..849622e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ([2.60])
 AC_INIT([xauth],
-	[1.0.6],
+	[1.0.7],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 	[xauth])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])

commit fbc307f3445a549815efb2476e9476bd51250cf6
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Fri Sep 3 13:45:49 2010 +0200

    Remove alarm handler in get_hostname
    
    gethostbyaddr is not (required to be) async-signal-safe.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/gethost.c b/gethost.c
index 2df5a8f..375f584 100644
--- a/gethost.c
+++ b/gethost.c
@@ -74,29 +74,6 @@ in this Software without prior written authorization from The Open Group.
 #include <arpa/inet.h>
 #endif
 
-#ifdef SIGALRM
-static volatile Bool nameserver_timedout = False;
-
-
-/*
- * get_hostname - Given an internet address, return a name (CHARON.MIT.EDU)
- * or a string representing the address (18.58.0.13) if the name cannot
- * be found.  Stolen from xhost.
- */
-
-static jmp_buf env;
-static RETSIGTYPE
-nameserver_lost(int sig)
-{
-  nameserver_timedout = True;
-  longjmp (env, -1);
-  /* NOTREACHED */
-#ifdef SIGNALRETURNSINT
-  return -1;				/* for picky compilers */
-#endif
-}
-#endif
-
 const char *
 get_hostname (Xauth *auth)
 {
@@ -124,23 +101,7 @@ get_hostname (Xauth *auth)
 #endif
 	    af = AF_INET;
 	if (no_name_lookups == False) {
-#ifdef SIGALRM
-	/* gethostbyaddr can take a LONG time if the host does not exist.
-	   Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
-	   that something is wrong and do not make the user wait.
-	   gethostbyaddr will continue after a signal, so we have to
-	   jump out of it.
-	   */
-	nameserver_timedout = False;
-	signal (SIGALRM, nameserver_lost);
-	alarm (4);
-	if (setjmp(env) == 0) {
-#endif
 	    hp = gethostbyaddr (auth->address, auth->address_length, af);
-#ifdef SIGALRM
-	}
-	alarm (0);
-#endif
 	}
 	if (hp)
 	  return (hp->h_name);

commit ee3e046dfd84cda1588eef155c7e7c36df9bf5f4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Wed Sep 28 19:57:15 2011 -0700

    Add const attributes to fix gcc -Wwrite-strings warnings
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/gethost.c b/gethost.c
index 68dce0f..2df5a8f 100644
--- a/gethost.c
+++ b/gethost.c
@@ -97,7 +97,7 @@ nameserver_lost(int sig)
 }
 #endif
 
-char *
+const char *
 get_hostname (Xauth *auth)
 {
     static struct hostent *hp;
@@ -238,13 +238,13 @@ static Bool get_dnet_address (name, resultp)
 
 struct addrlist *get_address_info (
     int family,
-    char *fulldpyname,
+    const char *fulldpyname,
     int prefix,
     char *host)
 {
     struct addrlist *retval = NULL;
     int len = 0;
-    void *src = NULL;
+    const void *src = NULL;
 #ifdef TCPCONN
 #if defined(IPv6) && defined(AF_INET6)
     struct addrlist *lastrv = NULL;
diff --git a/parsedpy.c b/parsedpy.c
index bf3a871..c591b77 100644
--- a/parsedpy.c
+++ b/parsedpy.c
@@ -55,7 +55,7 @@ in this Software without prior written authorization from The Open Group.
  */
 
 char *
-copystring (char *src, int len)
+copystring (const char *src, int len)
 {
     char *cp;
 
@@ -92,7 +92,7 @@ copyhostname (void)
  * parse_displayname - display a display string up into its component parts
  */
 Bool
-parse_displayname (char *displayname,
+parse_displayname (const char *displayname,
 		   int *familyp,	/* return */
 		   char **hostp,	/* return */
 		   int *dpynump,	/* return */
diff --git a/process.c b/process.c
index 21d256f..283b4a1 100644
--- a/process.c
+++ b/process.c
@@ -65,25 +65,25 @@ typedef struct _AuthList {		/* linked list of entries */
     Xauth *auth;
 } AuthList;
 
-typedef int (*ProcessFunc)(char *, int, int, char**);
+typedef int (*ProcessFunc)(const char *, int, int, const char**);
 
 #define add_to_list(h,t,e) {if (t) (t)->next = (e); else (h) = (e); (t) = (e);}
 
 typedef struct _CommandTable {		/* commands that are understood */
-    char *name;				/* full name */
+    const char *name;			/* full name */
     int minlen;				/* unique prefix */
     int maxlen;				/* strlen(name) */
     ProcessFunc processfunc;		/* handler */
-    char *helptext;			/* what to print for help */
+    const char *helptext;		/* what to print for help */
 } CommandTable;
 
 struct _extract_data {			/* for iterating */
     FILE *fp;				/* input source */
-    char *filename;			/* name of input */
+    const char *filename;		/* name of input */
     Bool used_stdout;			/* whether or not need to close */
     Bool numeric;			/* format in which to write */
     int nwritten;			/* number of entries written */
-    char *cmd;				/* for error messages */
+    const char *cmd;			/* for error messages */
 };
 
 struct _list_data {			/* for iterating */
@@ -95,23 +95,23 @@ struct _list_data {			/* for iterating */
 /*
  * private data
  */
-static char *stdin_filename = "(stdin)";  /* for messages */
-static char *stdout_filename = "(stdout)";  /* for messages */
-static char *Yes = "yes";		/* for messages */
-static char *No = "no";			/* for messages */
-
-static int do_help ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_questionmark ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_list ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_merge ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_extract ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_add ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_remove ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_info ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_exit ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_quit ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_source ( char *inputfilename, int lineno, int argc, char **argv );
-static int do_generate ( char *inputfilename, int lineno, int argc, char **argv );
+static const char *stdin_filename = "(stdin)";		/* for messages */
+static const char *stdout_filename = "(stdout)";	/* for messages */
+static const char *Yes = "yes";		/* for messages */
+static const char *No = "no";		/* for messages */
+
+static int do_help ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_questionmark ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_list ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_merge ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_extract ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_add ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_remove ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_info ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_exit ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_quit ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_source ( const char *inputfilename, int lineno, int argc, const char **argv );
+static int do_generate ( const char *inputfilename, int lineno, int argc, const char **argv );
 
 static CommandTable command_table[] = {	/* table of known commands */
     { "add",      2, 3, do_add,
@@ -159,7 +159,7 @@ static CommandTable command_table[] = {	/* table of known commands */
 
 static Bool okay_to_use_stdin = True;	/* set to false after using */
 
-static char *hex_table[] = {		/* for printing hex digits */
+static const char *hex_table[] = {	/* for printing hex digits */
     "00", "01", "02", "03", "04", "05", "06", "07",
     "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
     "10", "11", "12", "13", "14", "15", "16", "17",
@@ -204,20 +204,20 @@ static int original_umask = 0;		/* for restoring */
  */
 
 static void
-prefix(char *fn, int n)
+prefix(const char *fn, int n)
 {
     fprintf (stderr, "%s: %s:%d:  ", ProgramName, fn, n);
 }
 
 static void
-baddisplayname(char *dpy, char *cmd)
+baddisplayname(const char *dpy, const char *cmd)
 {
     fprintf (stderr, "bad display name \"%s\" in \"%s\" command\n",
 	     dpy, cmd);
 }
 
 static void
-badcommandline(char *cmd)
+badcommandline(const char *cmd)
 {
     fprintf (stderr, "bad \"%s\" command line\n", cmd);
 }
@@ -286,12 +286,12 @@ split_into_words(char *src, int *argcp)  /* argvify string */
 
 
 static FILE *
-open_file(char **filenamep,
-	  char *mode,
+open_file(const char **filenamep,
+	  const char *mode,
 	  Bool *usedstdp,
-	  char *srcfn,
+	  const char *srcfn,
 	  int srcln,
-	  char *cmd)
+	  const char *cmd)
 {
     FILE *fp;
 
@@ -463,7 +463,7 @@ read_auth_entries(FILE *fp, Bool numeric, AuthList **headp, AuthList **tailp)
 }
 
 static Bool
-get_displayname_auth(char *displayname, AuthList **authl)
+get_displayname_auth(const char *displayname, AuthList **authl)
 {
     int family;
     char *host = NULL, *rest = NULL;
@@ -541,11 +541,12 @@ get_displayname_auth(char *displayname, AuthList **authl)
 }
 
 static int
-cvthexkey(char *hexstr, char **ptrp)	/* turn hex key string into octets */
+cvthexkey(const char *hexstr, char **ptrp) /* turn hex key string into octets */
 {
     int i;
     int len = 0;
-    char *retval, *s;
+    char *retval;
+    const char *s;
     unsigned char *us;
     char c;
     char savec = '\0';
@@ -592,15 +593,15 @@ cvthexkey(char *hexstr, char **ptrp)	/* turn hex key string into octets */
 }
 
 static int
-dispatch_command(char *inputfilename,
+dispatch_command(const char *inputfilename,
 		 int lineno,
 		 int argc,
-		 char **argv,
+		 const char **argv,
 		 CommandTable *tab,
 		 int *statusp)
 {
     CommandTable *ct;
-    char *cmd;
+    const char *cmd;
     int n;
 					/* scan table for command */
     cmd = argv[0];
@@ -624,7 +625,7 @@ static Bool xauth_existed = False;	/* if was present at initialize */
 static Bool xauth_modified = False;	/* if added, removed, or merged */
 static Bool xauth_allowed = True;	/* if allowed to write auth file */
 static Bool xauth_locked = False;     /* if has been locked */
-static char *xauth_filename = NULL;
+static const char *xauth_filename = NULL;
 static volatile Bool dieing = False;
 
 
@@ -685,7 +686,7 @@ register_signals(void)
  */
 
 int
-auth_initialize(char *authfilename)
+auth_initialize(const char *authfilename)
 {
     int n;
     AuthList *head, *tail;
@@ -726,7 +727,7 @@ auth_initialize(char *authfilename)
 			 XAUTH_DEFAULT_TIMEOUT,
 			 (break_locks ? 0L : XAUTH_DEFAULT_DEADTIME));
 	if (n != LOCK_SUCCESS) {
-	    char *reason = "unknown error";
+	    const char *reason = "unknown error";
 	    switch (n) {
 	      case LOCK_ERROR:
 		reason = "error";
@@ -908,7 +909,7 @@ auth_finalize(void)
 }
 
 int
-process_command(char *inputfilename, int lineno, int argc, char **argv)
+process_command(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int status;
 
@@ -929,7 +930,7 @@ process_command(char *inputfilename, int lineno, int argc, char **argv)
  */
 
 static char *
-bintohex(unsigned int len, char *bindata)
+bintohex(unsigned int len, const char *bindata)
 {
     char *hexdata, *starthex;
 
@@ -939,7 +940,7 @@ bintohex(unsigned int len, char *bindata)
 	return NULL;
 
     for (; len > 0; len--, bindata++) {
-	register char *s = hex_table[(unsigned char)*bindata];
+	register const char *s = hex_table[(unsigned char)*bindata];
 	*hexdata++ = s[0];
 	*hexdata++ = s[1];
     }
@@ -975,7 +976,7 @@ dump_numeric(register FILE *fp, register Xauth *auth)
 
 /* ARGSUSED */
 static int
-dump_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
+dump_entry(const char *inputfilename, int lineno, Xauth *auth, char *data)
 {
     struct _list_data *ld = (struct _list_data *) data;
     FILE *fp = ld->fp;
@@ -983,7 +984,7 @@ dump_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
     if (ld->numeric) {
 	dump_numeric (fp, auth);
     } else {
-	char *dpyname = NULL;
+	const char *dpyname = NULL;
 
 	switch (auth->family) {
 	  case FamilyLocal:
@@ -1024,7 +1025,7 @@ dump_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
 }
 
 static int
-extract_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
+extract_entry(const char *inputfilename, int lineno, Xauth *auth, char *data)
 {
     struct _extract_data *ed = (struct _extract_data *) data;
 
@@ -1203,11 +1204,11 @@ copyAuth(Xauth *auth)
     return a;
 }
 
-typedef int (*YesNoFunc)(char *, int, Xauth *, char *);
+typedef int (*YesNoFunc)(const char *, int, Xauth *, char *);
 
 static int
-iterdpy (char *inputfilename, int lineno, int start,
-	 int argc, char *argv[],
+iterdpy (const char *inputfilename, int lineno, int start,
+	 int argc, const char *argv[],
 	 YesNoFunc yfunc, YesNoFunc nfunc, char *data)
 {
     int i;
@@ -1221,7 +1222,7 @@ iterdpy (char *inputfilename, int lineno, int start,
      * iterate
      */
     for (i = start; i < argc; i++) {
-	char *displayname = argv[i];
+	const char *displayname = argv[i];
 	if (!get_displayname_auth (displayname, &proto_head)) {
 	    prefix (inputfilename, lineno);
 	    baddisplayname (displayname, argv[0]);
@@ -1272,7 +1273,7 @@ iterdpy (char *inputfilename, int lineno, int start,
 
 /* ARGSUSED */
 static int
-remove_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
+remove_entry(const char *inputfilename, int lineno, Xauth *auth, char *data)
 {
     int *nremovedp = (int *) data;
     AuthList **listp = &xauth_head;
@@ -1299,7 +1300,7 @@ remove_entry(char *inputfilename, int lineno, Xauth *auth, char *data)
  * help
  */
 int
-print_help(FILE *fp, char *cmd, char *prefix)
+print_help(FILE *fp, const char *cmd, const char *prefix)
 {
     CommandTable *ct;
     int n = 0;
@@ -1325,9 +1326,9 @@ print_help(FILE *fp, char *cmd, char *prefix)
 }
 
 static int
-do_help(char *inputfilename, int lineno, int argc, char **argv)
+do_help(const char *inputfilename, int lineno, int argc, const char **argv)
 {
-    char *cmd = (argc > 1 ? argv[1] : NULL);
+    const char *cmd = (argc > 1 ? argv[1] : NULL);
     int n;
 
     n = print_help (stdout, cmd, "    ");  /* a nice amount */
@@ -1356,7 +1357,7 @@ do_help(char *inputfilename, int lineno, int argc, char **argv)
  */
 /* ARGSUSED */
 static int
-do_questionmark(char *inputfilename, int lineno, int argc, char **argv)
+do_questionmark(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     CommandTable *ct;
     int i;
@@ -1391,7 +1392,7 @@ do_questionmark(char *inputfilename, int lineno, int argc, char **argv)
  * list [displayname ...]
  */
 static int
-do_list (char *inputfilename, int lineno, int argc, char **argv)
+do_list (const char *inputfilename, int lineno, int argc, const char **argv)
 {
     struct _list_data ld;
 
@@ -1417,7 +1418,7 @@ do_list (char *inputfilename, int lineno, int argc, char **argv)
  * merge filename [filename ...]
  */
 static int
-do_merge(char *inputfilename, int lineno, int argc, char **argv)
+do_merge(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int i;
     int errors = 0;
@@ -1435,7 +1436,7 @@ do_merge(char *inputfilename, int lineno, int argc, char **argv)
     listhead = listtail = NULL;
 
     for (i = 1; i < argc; i++) {
-	char *filename = argv[i];
+	const char *filename = argv[i];
 	FILE *fp;
 	Bool used_stdin = False;
 
@@ -1480,7 +1481,7 @@ do_merge(char *inputfilename, int lineno, int argc, char **argv)
  * extract filename displayname [displayname ...]
  */
 static int
-do_extract(char *inputfilename, int lineno, int argc, char **argv)
+do_extract(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int errors;
     struct _extract_data ed;
@@ -1522,14 +1523,15 @@ do_extract(char *inputfilename, int lineno, int argc, char **argv)
 /*
  * add displayname protocolname hexkey
  */
+
 static int
-do_add(char *inputfilename, int lineno, int argc, char **argv)
+do_add(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int n, nnew, nrepl;
     int len;
-    char *dpyname;
-    char *protoname;
-    char *hexkey;
+    const char *dpyname;
+    const char *protoname;
+    const char *hexkey;
     char *key;
     AuthList *list, *list_cur, *list_next;
 
@@ -1627,7 +1629,7 @@ do_add(char *inputfilename, int lineno, int argc, char **argv)
  * remove displayname
  */
 static int
-do_remove(char *inputfilename, int lineno, int argc, char **argv)
+do_remove(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int nremoved = 0;
     int errors;
@@ -1648,7 +1650,7 @@ do_remove(char *inputfilename, int lineno, int argc, char **argv)
  * info
  */
 static int
-do_info(char *inputfilename, int lineno, int argc, char **argv)
+do_info(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     int n;
     AuthList *l;
@@ -1680,7 +1682,7 @@ static Bool alldone = False;
 
 /* ARGSUSED */
 static int
-do_exit(char *inputfilename, int lineno, int argc, char **argv)
+do_exit(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     /* allow bogus stuff */
     alldone = True;
@@ -1692,7 +1694,7 @@ do_exit(char *inputfilename, int lineno, int argc, char **argv)
  */
 /* ARGSUSED */
 static int
-do_quit(char *inputfilename, int lineno, int argc, char **argv)
+do_quit(const char *inputfilename, int lineno, int argc, const char **argv)
 {
     /* allow bogus stuff */
     die (0);
@@ -1705,16 +1707,16 @@ do_quit(char *inputfilename, int lineno, int argc, char **argv)
  * source filename
  */
 static int
-do_source(char *inputfilename, int lineno, int argc, char **argv)
+do_source(const char *inputfilename, int lineno, int argc, const char **argv)
 {
-    char *script;
+    const char *script;
     char buf[BUFSIZ];
     FILE *fp;
     Bool used_stdin = False;
     int len;
     int errors = 0, status;
     int sublineno = 0;
-    char **subargv;
+    const char **subargv;
     int subargc;
     Bool prompt = False;		/* only true if reading from tty */
 
@@ -1750,10 +1752,10 @@ do_source(char *inputfilename, int lineno, int argc, char **argv)
 	    break;
 	}
 	buf[--len] = '\0';		/* remove new line */
-	subargv = split_into_words (buf, &subargc);
+	subargv = (const char **) split_into_words (buf, &subargc);
 	if (subargv) {
 	    status = process_command (script, sublineno, subargc, subargv);
-	    free ((char *) subargv);
+	    free (subargv);
 	    errors += status;
 	} else {
 	    prefix (script, sublineno);
@@ -1783,9 +1785,9 @@ catch_x_protocol_error(Display *dpy, XErrorEvent *errevent)
  * generate
  */
 static int
-do_generate(char *inputfilename, int lineno, int argc, char **argv)
+do_generate(const char *inputfilename, int lineno, int argc, const char **argv)
 {
-    char *displayname;
+    const char *displayname;
     int major_version, minor_version;
     XSecurityAuthorization id_return;
     Xauth *auth_in, *auth_return;
@@ -1793,11 +1795,11 @@ do_generate(char *inputfilename, int lineno, int argc, char **argv)
     unsigned long attrmask = 0;
     Display *dpy;
     int status;
-    char *args[4];
-    char *protoname = ".";
+    const char *args[4];
+    const char *protoname = ".";
     int i;
     int authdatalen = 0;
-    char *hexdata;
+    const char *hexdata;
     char *authdata = NULL;
 
     if (argc < 2 || !argv[1]) {
@@ -1925,7 +1927,7 @@ do_generate(char *inputfilename, int lineno, int argc, char **argv)
     if (authdata) free(authdata);
     XSecurityFreeXauth(auth_in);
     XSecurityFreeXauth(auth_return);
-    free(args[3]); /* hex data */
+    free((char *) args[3]); /* hex data */
     XCloseDisplay(dpy);
     return status;
 }
diff --git a/xauth.c b/xauth.c
index 7a6a522..13f6ace 100644
--- a/xauth.c
+++ b/xauth.c
@@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
 /*
  * global data
  */
-char *ProgramName;			/* argv[0], set at top of main() */
+const char *ProgramName;		/* argv[0], set at top of main() */
 int verbose = -1;			/* print certain messages */
 Bool ignore_locks = False;		/* for error recovery */
 Bool break_locks = False;		/* for error recovery */
@@ -48,10 +48,10 @@ Bool no_name_lookups = False;		/* show addresses instead of names */
  * local data
  */
 
-static char *authfilename = NULL;	/* filename of cookie file */
-static char *defcmds[] = { "source", "-", NULL };  /* default command */
+static const char *authfilename = NULL;	/* filename of cookie file */
+static const char *defcmds[] = { "source", "-", NULL };  /* default command */
 static int ndefcmds = 2;
-static char *defsource = "(stdin)";
+static const char *defsource = "(stdin)";
 
 /*
  * utility routines
@@ -59,7 +59,7 @@ static char *defsource = "(stdin)";
 static void
 usage(void)
 {
-    static char *prefixmsg[] = {
+    static const char *prefixmsg[] = {
 "",
 "where options include:",
 "    -f authfilename                name of authority file to use",
@@ -71,12 +71,12 @@ usage(void)
 "and commands have the following syntax:",
 "",
 NULL };
-    static char *suffixmsg[] = {
+    static const char *suffixmsg[] = {
 "A dash may be used with the \"merge\" and \"source\" to read from the",
 "standard input.  Commands beginning with \"n\" use numeric format.",
 "",
 NULL };
-    char **msg;
+    const char **msg;
 
     fprintf (stderr, "usage:  %s [-options ...] [command arg ...]\n",
 	     ProgramName);
@@ -96,21 +96,21 @@ NULL };
  * The main routine - parses command line and calls action procedures
  */
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     int i;
-    char *sourcename = defsource;
-    char **arglist = defcmds;
+    const char *sourcename = defsource;
+    const char **arglist = defcmds;
     int nargs = ndefcmds;
     int status;
 
     ProgramName = argv[0];
 
     for (i = 1; i < argc; i++) {
-	char *arg = argv[i];
+	const char *arg = argv[i];
 
 	if (arg[0] == '-') {
-	    char *flag;
+	    const char *flag;
 
 	    for (flag = (arg + 1); *flag; flag++) {
 		switch (*flag) {
diff --git a/xauth.h b/xauth.h
index cd10bce..481531a 100644
--- a/xauth.h
+++ b/xauth.h
@@ -36,7 +36,7 @@ typedef int Bool;
 #define True 1
 #endif
 
-extern char *ProgramName;
+extern const char *ProgramName;
 
 #include <stdlib.h>
 
@@ -47,15 +47,15 @@ struct addrlist {
     int		    family;
 };
 
-extern char *get_hostname ( Xauth *auth );
-extern struct addrlist *get_address_info ( int family, char *fulldpyname, int prefix, char *host);
-extern char *copystring ( char *src, int len );
+extern const char *get_hostname ( Xauth *auth );
+extern struct addrlist *get_address_info ( int family, const char *fulldpyname, int prefix, char *host);
+extern char *copystring ( const char *src, int len );
 extern char *get_local_hostname ( char *buf, int maxlen );
-extern Bool parse_displayname ( char *displayname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp );
-extern int auth_initialize ( char *authfilename );
+extern Bool parse_displayname ( const char *displayname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp );
+extern int auth_initialize ( const char *authfilename );
 extern int auth_finalize ( void );
-extern int process_command ( char *inputfilename, int lineno, int argc, char **argv );
-extern int print_help ( FILE *fp, char *cmd, char *prefix );
+extern int process_command ( const char *inputfilename, int lineno, int argc, const char **argv );
+extern int print_help ( FILE *fp, const char *cmd, const char *prefix );
 extern int verbose;
 extern Bool ignore_locks;
 extern Bool break_locks;

commit 7f7f8cd60795c9503156950d518caa04b30a94a2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Wed Sep 28 19:50:40 2011 -0700

    Strip trailing whitespace
    
    Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
    git diff -w & git diff -b show no diffs from this change
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/Makefile.am b/Makefile.am
index 972c841..c0d165a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
-# 
+#
 #  Copyright 2005  Red Hat, Inc.
-# 
+#
 #  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
@@ -10,7 +10,7 @@
 #  specific, written prior permission.  Red Hat makes no
 #  representations about the suitability of this software for any purpose.  It
 #  is provided "as is" without express or implied warranty.
-# 
+#
 #  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 #  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 #  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
diff --git a/README b/README
index 8718d1a..2d9ec59 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-The xauth program is used to edit and display the authorization 
-information used in connecting to the X server. 
+The xauth program is used to edit and display the authorization
+information used in connecting to the X server.
 
 All questions regarding this software should be directed at the
 Xorg mailing list:
diff --git a/configure.ac b/configure.ac
index 1262e00..2586e18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl  Copyright 2005 Red Hat, Inc.
-dnl 
+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
@@ -9,7 +9,7 @@ dnl  advertising or publicity pertaining to distribution of the software without
 dnl  specific, written prior permission.  Red Hat 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
 dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -46,7 +46,7 @@ AC_CHECK_FUNCS([strlcpy])
 PKG_CHECK_MODULES(XAUTH, x11 xau xext xmuu)
 
 # Transport selection macro from xtrans.m4
-# Needed to set *CONN defines for gethost.c & parsedpy.c 
+# Needed to set *CONN defines for gethost.c & parsedpy.c
 XTRANS_CONNECTION_FLAGS
 
 XORG_WITH_LINT
diff --git a/gethost.c b/gethost.c
index acac864..68dce0f 100644
--- a/gethost.c
+++ b/gethost.c
@@ -1,5 +1,5 @@
 /*
- * 
+ *
 Copyright 1989, 1998  The Open Group
 
 Permission to use, copy, modify, distribute, and sell this software and its
@@ -114,7 +114,7 @@ get_hostname (Xauth *auth)
     if (auth->family == FamilyInternet
 #if defined(IPv6) && defined(AF_INET6)
       || auth->family == FamilyInternet6
-#endif 
+#endif
 	)
     {
 #if defined(IPv6) && defined(AF_INET6)
@@ -129,7 +129,7 @@ get_hostname (Xauth *auth)
 	   Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
 	   that something is wrong and do not make the user wait.
 	   gethostbyaddr will continue after a signal, so we have to
-	   jump out of it. 
+	   jump out of it.
 	   */
 	nameserver_timedout = False;
 	signal (SIGALRM, nameserver_lost);
@@ -184,7 +184,7 @@ get_hostname (Xauth *auth)
 /*
  * cribbed from lib/X/XConnDis.c
  */
-static Bool 
+static Bool
 get_inet_address(char *name, unsigned int *resultp)
 {
     unsigned int hostinetaddr = inet_addr (name);
@@ -207,8 +207,8 @@ get_inet_address(char *name, unsigned int *resultp)
 	    errno = EPROTOTYPE;
 	    return False;
 	}
- 
-	memmove( (char *)&hostinetaddr, (char *)host_ptr->h_addr, 
+
+	memmove( (char *)&hostinetaddr, (char *)host_ptr->h_addr,
 	      sizeof(inaddr.sin_addr));
     }
     *resultp = hostinetaddr;
@@ -287,7 +287,7 @@ struct addrlist *get_address_info (
 #endif
 
         c = strchr(buf, ':');
-        
+
         /* In the legacy case with no bundle id, use the full path */
         if(c == buf) {
             src = fulldpyname;
@@ -309,7 +309,7 @@ struct addrlist *get_address_info (
 	memset(&hints, 0, sizeof(hints));
 	hints.ai_family = PF_UNSPEC; /* IPv4 or IPv6 */
 	hints.ai_socktype = SOCK_STREAM; /* only interested in TCP */
-	hints.ai_protocol = 0;	
+	hints.ai_protocol = 0;
         if (getaddrinfo(host,NULL,&hints,&firstai) !=0) return NULL;
 	for (ai = firstai; ai != NULL; ai = ai->ai_next) {
 	    struct addrlist *duplicate;
diff --git a/parsedpy.c b/parsedpy.c
index 66225d7..bf3a871 100644
--- a/parsedpy.c
+++ b/parsedpy.c
@@ -2,7 +2,7 @@
  *
  * parse_displayname - utility routine for splitting up display name strings
  *
- * 
+ *
 Copyright 1989, 1998  The Open Group
 
 Permission to use, copy, modify, distribute, and sell this software and its
@@ -83,7 +83,7 @@ copyhostname (void)
 {
     char buf[256];
 
-    return (get_local_hostname (buf, sizeof buf) ? 
+    return (get_local_hostname (buf, sizeof buf) ?
 	    copystring (buf, strlen (buf)) : NULL);
 }
 #endif
@@ -91,8 +91,8 @@ copyhostname (void)
 /*
  * parse_displayname - display a display string up into its component parts
  */
-Bool 
-parse_displayname (char *displayname, 
+Bool
+parse_displayname (char *displayname,
 		   int *familyp,	/* return */
 		   char **hostp,	/* return */
 		   int *dpynump,	/* return */


Reply to: