author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Mon, 23 Apr 2012 15:08:10 -0700 | |
changeset 1276 | 52f85727ce94 |
parent 1068 | 0dc26c96a5af |
child 1370 | 7a7a374453e5 |
permissions | -rw-r--r-- |
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 |
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
2 |
index 08f7c79..4a58a7a 100644 |
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 |
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
5 |
@@ -142,6 +142,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); |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
17 |
@@ -211,15 +216,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
|
18 |
char *cp; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
19 |
#endif |
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 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
50 |
@@ -234,9 +254,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++ ) { |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
64 |
@@ -265,16 +287,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 |
1068
0dc26c96a5af
7010624 X11R7.6 Update: Application, Utility, & Data modules [PSARC/2011/033]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
86 |
@@ -291,26 +315,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 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
121 |
@@ -355,12 +383,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
|
122 |
struct nodeent *np; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
123 |
static struct dn_naddr dnaddr; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
124 |
#endif /* DNETCONN */ |
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++) { |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
139 |
@@ -372,8 +402,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 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
150 |
@@ -383,8 +413,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 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
161 |
@@ -396,8 +426,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
|
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 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
172 |
@@ -407,8 +437,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
|
173 |
family = FamilyDECnet; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
174 |
name += 5; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
175 |
#else |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
176 |
- 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
|
177 |
- free(lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
178 |
+ /* 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
|
179 |
+ 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
|
180 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
181 |
#endif |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
182 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
183 |
@@ -417,8 +447,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
|
184 |
family = FamilyNetname; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
185 |
name += 4; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
186 |
#else |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
187 |
- 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
|
188 |
- free(lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
189 |
+ /* 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
|
190 |
+ 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
|
191 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
192 |
#endif |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
193 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
194 |
@@ -427,8 +457,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
|
195 |
family = FamilyKrb5Principal; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
196 |
name +=4; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
197 |
#else |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
198 |
- 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
|
199 |
- free(lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
200 |
+ /* 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
|
201 |
+ 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
|
202 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
203 |
#endif |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
204 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
205 |
@@ -440,11 +470,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
|
206 |
name += 3; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
207 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
208 |
if (family == FamilyWild && (cp = strchr(lname, ':'))) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
209 |
- *cp = '\0'; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
210 |
- 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
|
211 |
- ProgramName, lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
212 |
- free(lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
213 |
- return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
214 |
+#ifdef IPv6 |
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 |
+ * 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
|
217 |
+ */ |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
218 |
+ 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
|
219 |
+ family = FamilyInternet6; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
220 |
+ } else |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
221 |
+#endif |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
222 |
+ { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
223 |
+ *cp = '\0'; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
224 |
+ /* 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
|
225 |
+ 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
|
226 |
+ ProgramName, lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
227 |
+ return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
228 |
+ } |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
229 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
230 |
free(lname); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
231 |
|
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
232 |
@@ -454,8 +494,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
|
233 |
|
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
234 |
cp = strchr(name, ':'); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
235 |
if (cp == NULL || cp == name) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
236 |
- fprintf(stderr, |
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 |
+ fprintf(stderr, gettext( |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
239 |
+ "%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
|
240 |
ProgramName, name); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
241 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
242 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
243 |
@@ -485,7 +525,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
|
244 |
dnaddr = *dnaddrp; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
245 |
} else { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
246 |
if ((np = getnodebyname (name)) == NULL) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
247 |
- fprintf (stderr, "%s: unable to get node name for \"%s::\"\n", |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
248 |
+ /* 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
|
249 |
+ fprintf (stderr, gettext("%s: unable to get node name for \"%s::\"\n"), |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
250 |
ProgramName, name); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
251 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
252 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
253 |
@@ -511,7 +552,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
|
254 |
retval = krb5_parse_name(name, &princ); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
255 |
if (retval) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
256 |
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
|
257 |
- 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
|
258 |
+ /* 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
|
259 |
+ 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
|
260 |
ProgramName, error_message(retval)); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
261 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
262 |
} |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
263 |
@@ -537,7 +579,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
|
264 |
XAddHost(dpy, &ha); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
265 |
else |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
266 |
XRemoveHost(dpy, &ha); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
267 |
- 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
|
268 |
+ 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
|
269 |
return 1; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
270 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
271 |
/* |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
272 |
@@ -556,12 +598,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
|
273 |
*cp = '\0'; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
274 |
pwd = getpwnam(name); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
275 |
if (!pwd) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
276 |
- 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
|
277 |
+ /* 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
|
278 |
+ 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
|
279 |
return 0; |
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 |
getdomainname(domainname, sizeof(domainname)); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
282 |
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
|
283 |
- 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
|
284 |
+ /* 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
|
285 |
+ 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
|
286 |
return 0; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
287 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
288 |
netname = username; |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
289 |
@@ -668,8 +712,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
|
290 |
familyMsg = "inet "; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
291 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
292 |
|
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
293 |
- 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
|
294 |
- ProgramName, familyMsg, name); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
295 |
+ /* 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
|
296 |
+ '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
|
297 |
+ 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
|
298 |
+ 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
|
299 |
+ name); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
300 |
} |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
301 |
freeaddrinfo(addresses); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
302 |
return 1; |
1276
52f85727ce94
7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1068
diff
changeset
|
303 |
@@ -947,14 +994,16 @@ static int |
294
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
304 |
local_xerror(Display *dpy, XErrorEvent *rep) |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
305 |
{ |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
306 |
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
|
307 |
+ /* 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
|
308 |
fprintf (stderr, |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
309 |
- "%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
|
310 |
+ 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
|
311 |
ProgramName); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
312 |
return 1; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
313 |
} else if ((rep->error_code == BadAccess) && |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
314 |
(rep->request_code == X_SetAccessControl)) { |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
315 |
+ /* 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
|
316 |
fprintf (stderr, |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
317 |
- "%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
|
318 |
+ 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
|
319 |
ProgramName); |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
320 |
return 1; |
2c88146a951a
6654375 Import the open source version of xhost
Jay Cotton <Jay.Cotton@Sun.COM>
parents:
diff
changeset
|
321 |
} else if ((rep->error_code == BadValue) && |