open-src/app/xhost/xhost.patch
author X gate hg captive account <xhg@xserver.us.oracle.com>
Wed, 19 Aug 2015 13:48:41 -0700
changeset 1484 bc8922b8e1d2
parent 1370 7a7a374453e5
permissions -rw-r--r--
Added tag s11u3_30 for changeset 221e9d9cc9cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
     1
diff --git a/xhost.c b/xhost.c
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
     2
index a67d136..f43b267 100644
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
     3
--- a/xhost.c
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
     4
+++ b/xhost.c
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
     5
@@ -119,6 +119,11 @@ extern int getdomainname(char *name, size_t len);
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
     6
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
     7
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
     8
 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
     9
+/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    10
+#include <locale.h>	/* setlocale()  */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    11
+#include <libintl.h>	/* gettext(), textdomain(), etc. */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    12
+#include <stdlib.h>	/* getenv() */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    13
+
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    14
 static int change_host(Display *dpy, char *name, Bool add);
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    15
 static const char *get_hostname(XHostAddress *ha);
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    16
 static int local_xerror(Display *dpy, XErrorEvent *rep);
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    17
@@ -171,15 +176,30 @@ main(int argc, char *argv[])
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    18
     Bool enabled = False;
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    19
     Display *dpy;
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    20
  
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    21
+    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    22
+    char *domaindir;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    23
+    setlocale(LC_ALL,"");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    24
+    textdomain("xhost");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    25
+    
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    26
+    /* mainly for debugging */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    27
+    if((domaindir=getenv("TEXTDOMAINDIR")) == NULL) {
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 294
diff changeset
    28
+	domaindir = "/usr/share/locale"; /*XLOCALEDIR;*/
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    29
+    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    30
+    bindtextdomain("xhost",domaindir);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    31
+
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    32
+
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    33
     ProgramName = argv[0];
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    34
 
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    35
     if (argc == 2 && !strcmp(argv[1], "-help")) {
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    36
-	fprintf(stderr, "usage: %s [[+-]hostname ...]\n", argv[0]);
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    37
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    38
+	fprintf(stderr, gettext("usage: %s [[+-]hostname ...]\n"), argv[0]);
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    39
 	exit(1);
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    40
     }
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
    41
 
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    42
     if ((dpy = XOpenDisplay(NULL)) == NULL) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    43
-	fprintf(stderr, "%s:  unable to open display \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    44
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    45
+	fprintf(stderr,
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    46
+		gettext("%s:  unable to open display \"%s\"\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    47
 		ProgramName, XDisplayName (NULL));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    48
 	exit(1);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    49
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    50
@@ -191,9 +211,11 @@ main(int argc, char *argv[])
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    51
 	sethostent(1);		/* don't close the data base each time */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    52
 	list = XListHosts(dpy, &nhosts, &enabled);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    53
 	if (enabled)
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    54
-	    printf ("access control enabled, only authorized clients can connect\n");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    55
+	    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    56
+	    printf (gettext("access control enabled, only authorized clients can connect\n"));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    57
 	else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    58
-	    printf ("access control disabled, clients can connect from any host\n");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    59
+	    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    60
+	    printf (gettext("access control disabled, clients can connect from any host\n"));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    61
 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    62
 	if (nhosts != 0) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    63
 	    for (i = 0; i < nhosts; i++ )  {
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    64
@@ -222,16 +244,18 @@ main(int argc, char *argv[])
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    65
 			printf("SI:");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    66
 			break;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    67
 		    default:
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    68
-			printf("<unknown family type %d>:", list[i].family);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    69
+			printf(gettext("<unknown family type %d>:"), list[i].family);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    70
 			break;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    71
 		    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    72
 		    printf ("%s", hostname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    73
 		} else {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    74
-		    printf ("<unknown address in family %d>",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    75
+		    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    76
+		    printf (gettext("<unknown address in family %d>"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    77
 			    list[i].family);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    78
 		}
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    79
 		if (nameserver_timedout) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    80
-		    printf("\t(no nameserver response within %d seconds)\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    81
+		    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    82
+		    printf(gettext("\t(no nameserver response within %d seconds)\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    83
 			   NAMESERVER_TIMEOUT);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    84
 		    nameserver_timedout = 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    85
 		} else
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
    86
@@ -248,26 +272,30 @@ main(int argc, char *argv[])
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    87
 	if (*arg == '-') {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    88
 	    
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    89
 	    if (!argv[i][1] && ((i+1) == argc)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    90
-		printf ("access control enabled, only authorized clients can connect\n");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    91
+		/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    92
+		printf (gettext("access control enabled, only authorized clients can connect\n"));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    93
 		XEnableAccessControl(dpy);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    94
 	    } else {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    95
 		arg = argv[i][1]? &argv[i][1] : argv[++i];
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    96
 		if (!change_host (dpy, arg, False)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    97
-		    fprintf (stderr, "%s:  bad hostname \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    98
+		    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
    99
+		    fprintf (stderr, gettext("%s:  bad hostname \"%s\"\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   100
 			     ProgramName, arg);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   101
 		    nfailed++;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   102
 		}
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   103
 	    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   104
 	} else {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   105
 	    if (*arg == '+' && !argv[i][1] && ((i+1) == argc)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   106
-		printf ("access control disabled, clients can connect from any host\n");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   107
+		/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   108
+		printf (gettext("access control disabled, clients can connect from any host\n"));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   109
 		XDisableAccessControl(dpy);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   110
 	    } else {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   111
 		if (*arg == '+') {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   112
 		    arg = argv[i][1]? &argv[i][1] : argv[++i];
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   113
 		}
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   114
 		if (!change_host (dpy, arg, True)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   115
-		    fprintf (stderr, "%s:  bad hostname \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   116
+		    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   117
+		    fprintf (stderr, gettext("%s:  bad hostname \"%s\"\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   118
 			     ProgramName, arg);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   119
 		    nfailed++;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   120
 		}
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   121
@@ -308,12 +336,14 @@ change_host(Display *dpy, char *name, Bool add)
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   122
 #endif
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   123
 #endif
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   124
     char *cp;
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
   125
-    static const char *add_msg = "being added to access control list";
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1068
diff changeset
   126
-    static const char *remove_msg = "being removed from access control list";
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   127
+    const char *add_msg = gettext("being added to access control list");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   128
+    const char *remove_msg = gettext("being removed from access control list");
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   129
 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   130
     namelen = strlen(name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   131
     if ((lname = (char *)malloc(namelen+1)) == NULL) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   132
-	fprintf (stderr, "%s: malloc bombed in change_host\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   133
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   134
+	fprintf (stderr, gettext("%s: malloc bombed in change_host\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   135
+		 ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   136
 	exit (1);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   137
     }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   138
     for (i = 0; i < namelen; i++) {
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   139
@@ -325,8 +355,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   140
 	family = FamilyInternet;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   141
 	name += 5;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   142
 #else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   143
-	fprintf (stderr, "%s: not compiled for TCP/IP\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   144
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   145
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   146
+	fprintf (stderr, gettext("%s: not compiled for TCP/IP\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   147
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   148
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   149
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   150
@@ -335,8 +365,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   151
 	family = FamilyInternet6;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   152
 	name += 6;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   153
 #else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   154
-	fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   155
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   156
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   157
+	fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   158
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   159
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   160
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   161
@@ -347,15 +377,15 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   162
 	family = FamilyInternet6;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   163
 	name += 7;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   164
 #else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   165
-	fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   166
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   167
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   168
+	fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   169
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   170
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   171
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   172
 #endif /* ACCEPT_INETV6 */
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   173
     else if (!strncmp("dnet:", lname, 5)) {
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   174
-	fprintf (stderr, "%s: not compiled for DECnet\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   175
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   176
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   177
+	fprintf (stderr, gettext("%s: not compiled for DECnet\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   178
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   179
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   180
     else if (!strncmp("nis:", lname, 4)) {
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   181
@@ -363,8 +393,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   182
 	family = FamilyNetname;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   183
 	name += 4;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   184
 #else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   185
-	fprintf (stderr, "%s: not compiled for Secure RPC\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   186
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   187
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   188
+	fprintf (stderr, gettext("%s: not compiled for Secure RPC\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   189
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   190
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   191
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   192
@@ -373,8 +403,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   193
 	family = FamilyKrb5Principal;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   194
 	name +=4;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   195
 #else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   196
-	fprintf (stderr, "%s: not compiled for Kerberos 5\n", ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   197
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   198
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   199
+	fprintf (stderr, gettext("%s: not compiled for Kerberos 5\n"), ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   200
 	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   201
 #endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   202
     }
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   203
@@ -386,11 +416,21 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   204
 	name += 3;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   205
     }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   206
     if (family == FamilyWild && (cp = strchr(lname, ':'))) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   207
-	*cp = '\0';
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   208
-	fprintf (stderr, "%s: unknown address family \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   209
-		 ProgramName, lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   210
-	free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   211
-	return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   212
+#ifdef IPv6
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   213
+	/*
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   214
+	 * Check to see if inet_pton() can grok it as an IPv6 address
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   215
+	 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   216
+	if (inet_pton(AF_INET6, lname, &addr6.s6_addr) == 1) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   217
+	    family = FamilyInternet6;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   218
+	} else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   219
+#endif
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   220
+	{
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   221
+	    *cp = '\0';
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   222
+	    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   223
+	    fprintf (stderr, gettext("%s: unknown address family \"%s\"\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   224
+		     ProgramName, lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   225
+	    return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   226
+	}
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   227
     }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   228
     free(lname);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   229
 
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   230
@@ -400,8 +440,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   231
 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   232
 	cp = strchr(name, ':');
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   233
 	if (cp == NULL || cp == name) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   234
-	    fprintf(stderr, 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   235
-	   "%s: type must be specified for server interpreted family \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   236
+	    fprintf(stderr, gettext(
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   237
+	  "%s: type must be specified for server interpreted family \"%s\"\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   238
 	      ProgramName, name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   239
 	    return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   240
 	}
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   241
@@ -429,7 +469,8 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   242
 	retval = krb5_parse_name(name, &princ);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   243
 	if (retval) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   244
 	    krb5_init_ets();	/* init krb errs for error_message() */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   245
-	    fprintf(stderr, "%s: cannot parse Kerberos name: %s\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   246
+	    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   247
+	    fprintf(stderr, gettext("%s: cannot parse Kerberos name: %s\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   248
 		    ProgramName, error_message(retval));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   249
 	    return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   250
 	}
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   251
@@ -456,7 +497,7 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   252
 	    XAddHost(dpy, &ha);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   253
 	else
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   254
 	    XRemoveHost(dpy, &ha);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   255
-	printf( "non-network local connections %s\n", add ? add_msg : remove_msg);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   256
+	printf( gettext("non-network local connections %s\n"), add ? add_msg : remove_msg);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   257
 	return 1;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   258
     }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   259
     /*
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   260
@@ -475,12 +516,14 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   261
 	    *cp = '\0';
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   262
 	    pwd = getpwnam(name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   263
 	    if (!pwd) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   264
-		fprintf(stderr, "no such user \"%s\"\n", name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   265
+		/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   266
+		fprintf(stderr, gettext("no such user \"%s\"\n"), name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   267
 		return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   268
 	    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   269
 	    getdomainname(domainname, sizeof(domainname));
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   270
 	    if (!user2netname(username, pwd->pw_uid, domainname)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   271
-		fprintf(stderr, "failed to get netname for \"%s\"\n", name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   272
+		/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   273
+		fprintf(stderr, gettext("failed to get netname for \"%s\"\n"), name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   274
 		return 0;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   275
 	    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   276
 	    netname = username;
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   277
@@ -587,8 +630,11 @@ change_host(Display *dpy, char *name, Bool add)
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   278
 		familyMsg = "inet ";
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   279
 	    }
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   280
 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   281
-	    fprintf(stderr, "%s: unable to get %saddress for \"%s\"\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   282
-		ProgramName, familyMsg, name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   283
+	    /* L10N_Comments - Parts composed to make full error string
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   284
+	       'unable to get' ['inet'|'inetv6'|''] 'address for' <address> */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   285
+	    fprintf (stderr, "%s:  %s %s%s \"%s\"\n", ProgramName, 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   286
+	      gettext("unable to get"), familyMsg, gettext("address for"), 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   287
+	      name);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   288
 	}
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   289
 	freeaddrinfo(addresses);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   290
 	return 1;
1370
7a7a374453e5 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   291
@@ -824,14 +870,16 @@ static int
294
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   292
 local_xerror(Display *dpy, XErrorEvent *rep)
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   293
 {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   294
     if ((rep->error_code == BadAccess) && (rep->request_code == X_ChangeHosts)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   295
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   296
 	fprintf (stderr, 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   297
-		 "%s:  must be on local machine to add or remove hosts.\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   298
+		 gettext("%s:  must be on local machine to add or remove hosts.\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   299
 		 ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   300
 	return 1;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   301
     } else if ((rep->error_code == BadAccess) && 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   302
 	       (rep->request_code == X_SetAccessControl)) {
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   303
+	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   304
 	fprintf (stderr, 
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   305
-	"%s:  must be on local machine to enable or disable access control.\n",
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   306
+		 gettext("%s:  must be on local machine to enable or disable access control.\n"),
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   307
 		 ProgramName);
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   308
 	return 1;
2c88146a951a 6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff changeset
   309
     } else if ((rep->error_code == BadValue) &&