Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / app / xauth
Commits:
-
4a3a9fc5
by Alan Coopersmith at 2018-05-05T14:58:15-07:00
-
fa5c2797
by Alan Coopersmith at 2018-11-16T21:03:57-08:00
-
673d42c5
by Alan Coopersmith at 2018-11-21T16:58:33-08:00
-
06a21f7c
by Michal Srb at 2019-06-09T12:52:48-07:00
-
42239054
by Michal Srb at 2019-06-09T12:55:04-07:00
-
0932418d
by Adam Jackson at 2019-06-20T10:10:36-04:00
-
e9799267
by Adam Jackson at 2019-07-11T13:49:26-04:00
4 changed files:
Changes:
... | ... | @@ -51,3 +51,5 @@ ChangeLog: |
51 | 51 |
$(CHANGELOG_CMD)
|
52 | 52 |
|
53 | 53 |
dist-hook: ChangeLog INSTALL
|
54 |
+ |
|
55 |
+EXTRA_DIST = README.md
|
1 |
- |
|
2 |
- I. OVERVIEW
|
|
1 |
+I. OVERVIEW
|
|
2 |
+-----------
|
|
3 | 3 |
|
4 | 4 |
The xauth program is used to edit and display the authorization
|
5 | 5 |
information used in connecting to the X server.
|
6 | 6 |
The underlying "Authorization Protocol for X" is described in the
|
7 | 7 |
README file of the libXau module of X11.
|
8 | 8 |
|
9 |
- II. BUILDING
|
|
9 |
+II. BUILDING
|
|
10 |
+------------
|
|
10 | 11 |
|
11 | 12 |
Use "./autogen.sh" to configure the package and "make" to compile it.
|
12 | 13 |
A black box check for the correctness of the package can be initiated
|
13 | 14 |
by "make check" (make sure to install "cmdtest" from
|
14 | 15 |
http://liw.fi/cmdtest/). The installation is done by "make install".
|
15 | 16 |
|
16 |
- III. COMMUNICATION
|
|
17 |
+III. COMMUNICATION
|
|
18 |
+------------------
|
|
17 | 19 |
|
18 | 20 |
All questions regarding this software should be directed at the
|
19 | 21 |
Xorg mailing list:
|
20 | 22 |
|
21 |
- http://lists.freedesktop.org/mailman/listinfo/xorg
|
|
22 |
- |
|
23 |
-Please submit bug reports to the Xorg bugzilla:
|
|
24 |
- |
|
25 |
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
|
23 |
+ https://lists.x.org/mailman/listinfo/xorg
|
|
26 | 24 |
|
27 | 25 |
The master development code repository can be found at:
|
28 | 26 |
|
29 |
- git://anongit.freedesktop.org/git/xorg/app/xauth
|
|
27 |
+ https://gitlab.freedesktop.org/xorg/app/xauth
|
|
30 | 28 |
|
31 |
- http://cgit.freedesktop.org/xorg/app/xauth
|
|
29 |
+Please submit bug reports and requests to merge patches there.
|
|
32 | 30 |
|
33 | 31 |
For patch submission instructions, see:
|
34 | 32 |
|
35 |
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
|
36 |
- |
|
37 |
-For more information on the git code manager, see:
|
|
33 |
+ https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
|
38 | 34 |
|
39 |
- http://wiki.x.org/wiki/GitPage
|
|
40 |
- |
|
41 |
- |
|
42 |
- IV. RELEASING
|
|
35 |
+IV. RELEASING
|
|
36 |
+-------------
|
|
43 | 37 |
|
44 | 38 |
This section describes how to release a new version of xauth to the
|
45 | 39 |
public. A detailed description of this process can be found at
|
46 |
-http://www.x.org/wiki/Development/Documentation/ReleaseHOWTO with a
|
|
40 |
+https://www.x.org/wiki/Development/Documentation/ReleaseHOWTO with a
|
|
47 | 41 |
few clarification below.
|
48 | 42 |
|
49 | 43 |
Remember, that the last commit _must_ include the version string in
|
... | ... | @@ -62,10 +56,10 @@ To release a new version of xauth, please follow this steps: |
62 | 56 |
|
63 | 57 |
Ignore these errors shown during release.sh:
|
64 | 58 |
|
65 |
- /bin/sh: ../.changelog.tmp: Permission denied
|
|
66 |
- git directory not found: installing possibly empty changelog.
|
|
67 |
- |
|
68 |
- cp: cannot create regular file '../.INSTALL.tmp': Permission denied
|
|
69 |
- util-macros "pkgdatadir" from xorg-macros.pc not found: installing possibly empty INSTALL.
|
|
59 |
+ /bin/sh: ../.changelog.tmp: Permission denied
|
|
60 |
+ git directory not found: installing possibly empty changelog.
|
|
61 |
+
|
|
62 |
+ cp: cannot create regular file '../.INSTALL.tmp': Permission denied
|
|
63 |
+ util-macros "pkgdatadir" from xorg-macros.pc not found: installing possibly empty INSTALL.
|
|
70 | 64 |
|
71 | 65 |
[eof]
|
... | ... | @@ -22,8 +22,8 @@ dnl Process this file with autoconf to create configure. |
22 | 22 |
|
23 | 23 |
AC_PREREQ([2.60])
|
24 | 24 |
AC_INIT([xauth],
|
25 |
- [1.0.10],
|
|
26 |
- [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
|
25 |
+ [1.1],
|
|
26 |
+ [https://gitlab.freedesktop.org/xorg/app/xauth/issues],
|
|
27 | 27 |
[xauth])
|
28 | 28 |
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
29 | 29 |
|
... | ... | @@ -890,19 +890,11 @@ auth_finalize(void) |
890 | 890 |
"%s: unable to write authority file %s\n",
|
891 | 891 |
ProgramName, temp_name);
|
892 | 892 |
} else {
|
893 |
- (void) unlink (xauth_filename);
|
|
894 |
-#if defined(WIN32) || defined(__UNIXOS2__)
|
|
895 |
- if (rename(temp_name, xauth_filename) == -1)
|
|
896 |
-#else
|
|
897 |
- /* Attempt to rename() if link() fails, since this may be on a FS that does not support hard links */
|
|
898 |
- if (link (temp_name, xauth_filename) == -1 && rename(temp_name, xauth_filename) == -1)
|
|
899 |
-#endif
|
|
900 |
- {
|
|
893 |
+ if (rename(temp_name, xauth_filename) == -1) {
|
|
901 | 894 |
fprintf (stderr,
|
902 |
- "%s: unable to link authority file %s, use %s\n",
|
|
895 |
+ "%s: unable to rename authority file %s, use %s\n",
|
|
903 | 896 |
ProgramName, xauth_filename, temp_name);
|
904 |
- } else {
|
|
905 |
- (void) unlink (temp_name);
|
|
897 |
+ unlink(temp_name);
|
|
906 | 898 |
}
|
907 | 899 |
}
|
908 | 900 |
}
|
... | ... | @@ -1008,7 +1000,7 @@ dump_entry(const char *inputfilename, int lineno, Xauth *auth, char *data) |
1008 | 1000 |
fprintf (fp, "%s", dpyname);
|
1009 | 1001 |
break;
|
1010 | 1002 |
}
|
1011 |
- /* else fall through to default */
|
|
1003 |
+ /* else fall through */
|
|
1012 | 1004 |
default:
|
1013 | 1005 |
fprintf (fp, "#%04x#", auth->family);
|
1014 | 1006 |
fprintfhex (fp, auth->address_length, auth->address);
|
... | ... | @@ -1057,16 +1049,22 @@ extract_entry(const char *inputfilename, int lineno, Xauth *auth, char *data) |
1057 | 1049 |
|
1058 | 1050 |
|
1059 | 1051 |
static int
|
1060 |
-eq_auth(Xauth *a, Xauth *b)
|
|
1052 |
+eq_auth_dpy_and_name(Xauth *a, Xauth *b)
|
|
1061 | 1053 |
{
|
1062 | 1054 |
return((a->family == b->family &&
|
1063 | 1055 |
a->address_length == b->address_length &&
|
1064 | 1056 |
a->number_length == b->number_length &&
|
1065 | 1057 |
a->name_length == b->name_length &&
|
1066 |
- a->data_length == b->data_length &&
|
|
1067 | 1058 |
memcmp(a->address, b->address, a->address_length) == 0 &&
|
1068 | 1059 |
memcmp(a->number, b->number, a->number_length) == 0 &&
|
1069 |
- memcmp(a->name, b->name, a->name_length) == 0 &&
|
|
1060 |
+ memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0);
|
|
1061 |
+}
|
|
1062 |
+ |
|
1063 |
+static int
|
|
1064 |
+eq_auth(Xauth *a, Xauth *b)
|
|
1065 |
+{
|
|
1066 |
+ return((eq_auth_dpy_and_name(a, b) &&
|
|
1067 |
+ a->data_length == b->data_length &&
|
|
1070 | 1068 |
memcmp(a->data, b->data, a->data_length) == 0) ? 1 : 0);
|
1071 | 1069 |
}
|
1072 | 1070 |
|
... | ... | @@ -1100,17 +1098,6 @@ match_auth_dpy(register Xauth *a, register Xauth *b) |
1100 | 1098 |
return 1;
|
1101 | 1099 |
}
|
1102 | 1100 |
|
1103 |
-/* return non-zero iff display and authorization type are the same */
|
|
1104 |
- |
|
1105 |
-static int
|
|
1106 |
-match_auth(register Xauth *a, register Xauth *b)
|
|
1107 |
-{
|
|
1108 |
- return ((match_auth_dpy(a, b)
|
|
1109 |
- && a->name_length == b->name_length
|
|
1110 |
- && memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0);
|
|
1111 |
-}
|
|
1112 |
- |
|
1113 |
- |
|
1114 | 1101 |
static int
|
1115 | 1102 |
merge_entries(AuthList **firstp, AuthList *second, int *nnewp, int *nreplp)
|
1116 | 1103 |
{
|
... | ... | @@ -1144,7 +1131,7 @@ merge_entries(AuthList **firstp, AuthList *second, int *nnewp, int *nreplp) |
1144 | 1131 |
|
1145 | 1132 |
a = first;
|
1146 | 1133 |
for (;;) {
|
1147 |
- if (match_auth (a->auth, b->auth)) { /* found a duplicate */
|
|
1134 |
+ if (eq_auth_dpy_and_name (a->auth, b->auth)) { /* found a duplicate */
|
|
1148 | 1135 |
AuthList tmp; /* swap it in for old one */
|
1149 | 1136 |
tmp = *a;
|
1150 | 1137 |
*a = *b;
|
... | ... | @@ -1175,6 +1162,45 @@ merge_entries(AuthList **firstp, AuthList *second, int *nnewp, int *nreplp) |
1175 | 1162 |
|
1176 | 1163 |
}
|
1177 | 1164 |
|
1165 |
+static void
|
|
1166 |
+sort_entries(AuthList **firstp)
|
|
1167 |
+{
|
|
1168 |
+ /* Insert sort, in each pass it removes auth records of certain */
|
|
1169 |
+ /* cathegory from the given list and inserts them into the sorted list. */
|
|
1170 |
+ |
|
1171 |
+ AuthList *sorted = NULL, *sorted_tail = NULL;
|
|
1172 |
+ AuthList *prev, *iter, *next;
|
|
1173 |
+ |
|
1174 |
+ #define SORT_OUT(_expression_) { \
|
|
1175 |
+ prev = NULL; \
|
|
1176 |
+ for (iter = *firstp; iter; iter = next) { \
|
|
1177 |
+ next = iter->next; \
|
|
1178 |
+ if (_expression_) { \
|
|
1179 |
+ if (prev) \
|
|
1180 |
+ prev->next = next; \
|
|
1181 |
+ else \
|
|
1182 |
+ *firstp = next; \
|
|
1183 |
+ if (sorted_tail == NULL) { \
|
|
1184 |
+ sorted = sorted_tail = iter; \
|
|
1185 |
+ } else { \
|
|
1186 |
+ sorted_tail->next = iter; \
|
|
1187 |
+ sorted_tail = iter; \
|
|
1188 |
+ } \
|
|
1189 |
+ iter->next = NULL; \
|
|
1190 |
+ } else { \
|
|
1191 |
+ prev = iter; \
|
|
1192 |
+ } \
|
|
1193 |
+ } \
|
|
1194 |
+ }
|
|
1195 |
+ |
|
1196 |
+ SORT_OUT(iter->auth->family != FamilyWild && iter->auth->number_length != 0);
|
|
1197 |
+ SORT_OUT(iter->auth->family != FamilyWild && iter->auth->number_length == 0);
|
|
1198 |
+ SORT_OUT(iter->auth->family == FamilyWild && iter->auth->number_length != 0);
|
|
1199 |
+ SORT_OUT(iter->auth->family == FamilyWild && iter->auth->number_length == 0);
|
|
1200 |
+ |
|
1201 |
+ *firstp = sorted;
|
|
1202 |
+}
|
|
1203 |
+ |
|
1178 | 1204 |
static Xauth *
|
1179 | 1205 |
copyAuth(Xauth *auth)
|
1180 | 1206 |
{
|
... | ... | @@ -1513,6 +1539,7 @@ do_merge(const char *inputfilename, int lineno, int argc, const char **argv) |
1513 | 1539 |
printf ("%d entries read in: %d new, %d replacement%s\n",
|
1514 | 1540 |
nentries, nnew, nrepl, nrepl != 1 ? "s" : "");
|
1515 | 1541 |
if (nentries > 0) xauth_modified = True;
|
1542 |
+ sort_entries(&xauth_head);
|
|
1516 | 1543 |
}
|
1517 | 1544 |
|
1518 | 1545 |
return 0;
|
... | ... | @@ -1661,6 +1688,7 @@ do_add(const char *inputfilename, int lineno, int argc, const char **argv) |
1661 | 1688 |
fprintf (stderr, "unable to merge in added record\n");
|
1662 | 1689 |
return 1;
|
1663 | 1690 |
}
|
1691 |
+ sort_entries(&xauth_head);
|
|
1664 | 1692 |
|
1665 | 1693 |
xauth_modified = True;
|
1666 | 1694 |
return 0;
|