diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..850c097 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libXt-1.1.5.tar.bz2 diff --git a/.libXt.metadata b/.libXt.metadata new file mode 100644 index 0000000..8126fb8 --- /dev/null +++ b/.libXt.metadata @@ -0,0 +1 @@ +c79e2c4f7de5259a2ade458817a139b66a043d59 SOURCES/libXt-1.1.5.tar.bz2 diff --git a/SOURCES/0001-no-need-to-check-XFree-arguments.patch b/SOURCES/0001-no-need-to-check-XFree-arguments.patch new file mode 100644 index 0000000..98c846f --- /dev/null +++ b/SOURCES/0001-no-need-to-check-XFree-arguments.patch @@ -0,0 +1,134 @@ +From 1d555838d03f191d5f21268868a4ea180c2b24f2 Mon Sep 17 00:00:00 2001 +From: Walter Harms +Date: Tue, 8 Jan 2019 21:25:00 +0100 +Subject: [PATCH 1/9] no need to check XFree arguments + +--- + src/TMstate.c | 5 ++--- + src/VarCreate.c | 19 +++++++------------ + src/VarGet.c | 16 ++++------------ + 3 files changed, 13 insertions(+), 27 deletions(-) + +diff --git a/src/TMstate.c b/src/TMstate.c +index 4a634b4..9763fc0 100644 +--- a/src/TMstate.c ++++ b/src/TMstate.c +@@ -742,8 +742,7 @@ static void FreeContext( + context->numMatches = 0; + else if (*contextPtr) + { +- if ((*contextPtr)->matches) +- XtFree ((char *) ((*contextPtr)->matches)); ++ XtFree ((char *) ((*contextPtr)->matches)); + XtFree((char *)*contextPtr); + } + +@@ -2062,7 +2061,7 @@ static Boolean ComposeTranslations( + dest->core.tm.proc_table = + (XtActionProc *) MakeBindData(newBindings, numNewBindings, bindData); + +- if (bindData) XtFree((char *)bindData); ++ XtFree((char *)bindData); + + dest->core.tm.translations = newTable; + +diff --git a/src/VarCreate.c b/src/VarCreate.c +index 0fba379..4f5058c 100644 +--- a/src/VarCreate.c ++++ b/src/VarCreate.c +@@ -79,9 +79,8 @@ _XtVaCreateWidget( + widget = _XtCreateWidget(name, widget_class, parent, (ArgList)NULL, + (Cardinal)0, typed_args, num_args); + +- if (typed_args != NULL) { +- XtFree((XtPointer)typed_args); +- } ++ ++ XtFree((XtPointer)typed_args); + + return widget; + } +@@ -165,9 +164,8 @@ XtVaAppCreateShell( + _XtVaToTypedArgList(var, total_count, &typed_args, &num_args); + widget = _XtAppCreateShell((String)name, (String)class, widget_class, + display, (ArgList)NULL, (Cardinal)0, typed_args, num_args); +- if (typed_args != NULL) { +- XtFree((XtPointer)typed_args); +- } ++ ++ XtFree((XtPointer)typed_args); + + va_end(var); + UNLOCK_APP(app); +@@ -199,9 +197,8 @@ XtVaCreatePopupShell( + _XtVaToTypedArgList(var, total_count, &typed_args, &num_args); + widget = _XtCreatePopupShell((String)name, widget_class, parent, + (ArgList)NULL, (Cardinal)0, typed_args, num_args); +- if (typed_args != NULL) { +- XtFree((XtPointer)typed_args); +- } ++ ++ XtFree((XtPointer)typed_args); + + va_end(var); + UNLOCK_APP(app); +@@ -254,9 +251,7 @@ XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resource + + XtSetSubvalues(base, resources, num_resources, args, num_args); + +- if (num_args != 0) { +- XtFree((XtPointer)args); +- } ++ XtFree((XtPointer)args); + + va_end(var); + } +diff --git a/src/VarGet.c b/src/VarGet.c +index 7b4cea6..ccd4d10 100644 +--- a/src/VarGet.c ++++ b/src/VarGet.c +@@ -86,9 +86,7 @@ XtVaGetSubresources( + _XtGetSubresources(widget, base, name, class, resources, num_resources, + NULL, 0, args, num_args); + +- if (num_args != 0) { +- XtFree((XtPointer)args); +- } ++ XtFree((XtPointer)args); + + va_end(var); + UNLOCK_APP(app); +@@ -116,9 +114,7 @@ XtVaGetApplicationResources(Widget widget, XtPointer base, XtResourceList resour + _XtGetApplicationResources(widget, base, resources, num_resources, + NULL, 0, args, num_args); + +- if (num_args != 0) { +- XtFree((XtPointer)args); +- } ++ XtFree((XtPointer)args); + + va_end(var); + UNLOCK_APP(app); +@@ -273,9 +269,7 @@ XtVaGetValues(Widget widget, ...) + } + va_end(var); + +- if (resources != (XtResourceList)NULL) { +- XtFree((XtPointer)resources); +- } ++ XtFree((XtPointer)resources); + + if (total_count != typed_count) { + XtGetValues(widget, args, count); +@@ -307,7 +301,5 @@ XtVaGetSubvalues(XtPointer base,XtResourceList resources, Cardinal num_resource + + XtGetSubvalues(base, resources, num_resources, args, num_args); + +- if (num_args != 0) { +- XtFree((XtPointer)args); +- } ++ XtFree((XtPointer)args); + } +-- +2.19.2 + diff --git a/SOURCES/0002-no-need-to-check-args-for-free.patch b/SOURCES/0002-no-need-to-check-args-for-free.patch new file mode 100644 index 0000000..805db8f --- /dev/null +++ b/SOURCES/0002-no-need-to-check-args-for-free.patch @@ -0,0 +1,25 @@ +From 7eeaf69c224d6b7625d9214ba23df7e5e9d50d3c Mon Sep 17 00:00:00 2001 +From: Walter Harms +Date: Tue, 8 Jan 2019 22:26:25 +0100 +Subject: [PATCH 2/9] no need to check args for free + +--- + src/Alloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Alloc.c b/src/Alloc.c +index c9ffce8..754881b 100644 +--- a/src/Alloc.c ++++ b/src/Alloc.c +@@ -214,7 +214,7 @@ char *XtCalloc( + void XtFree( + char *ptr) + { +- if (ptr != NULL) Xfree(ptr); ++ free(ptr); + } + + char* __XtMalloc( +-- +2.19.2 + diff --git a/SOURCES/0003-resolv-shadows-a-global-declaration.patch b/SOURCES/0003-resolv-shadows-a-global-declaration.patch new file mode 100644 index 0000000..18083f3 --- /dev/null +++ b/SOURCES/0003-resolv-shadows-a-global-declaration.patch @@ -0,0 +1,69 @@ +From e91a7c6e2be7fc5bb7eb5b8e9d28b9bcc36f446b Mon Sep 17 00:00:00 2001 +From: Walter Harms +Date: Fri, 11 Jan 2019 22:54:47 +0100 +Subject: [PATCH 3/9] resolv:shadows a global declaration + +--- + util/makestrs.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/util/makestrs.c b/util/makestrs.c +index 5764849..488c9bb 100644 +--- a/util/makestrs.c ++++ b/util/makestrs.c +@@ -88,7 +88,7 @@ static int solaris_abi_names = FALSE; + * commandline. Needed to separate source and build directories. + */ + static char* includedir = NULL; +-static FILE *ifopen(const char *file, const char *mode) ++static FILE *ifopen(const char *myfile, const char *mode) + { + #ifndef HAVE_ASPRINTF + size_t len; +@@ -97,13 +97,13 @@ static FILE *ifopen(const char *file, const char *mode) + FILE *ret; + + if (includedir == NULL) +- return fopen(file, mode); ++ return fopen(myfile, mode); + + #ifdef HAVE_ASPRINTF +- if (asprintf(&buffer, "%s/%s", includedir, file) == -1) ++ if (asprintf(&buffer, "%s/%s", includedir, myfile) == -1) + return NULL; + #else +- len = strlen(file) + strlen(includedir) + 1; ++ len = strlen(myfile) + strlen(includedir) + 1; + buffer = (char*)malloc(len + 1); + if (buffer == NULL) + return NULL; +@@ -622,7 +622,7 @@ static void DoLine(char *buf) + } + } + +-static void IntelABIIndexEntries (File *file) ++static void IntelABIIndexEntries (File *myfile) + { + Table* t; + TableEnt* te; +@@ -635,7 +635,7 @@ static void IntelABIIndexEntries (File *file) + } + } + +-static void DefaultIndexEntries (File *file) ++static void DefaultIndexEntries (File *myfile) + { + Table* t; + TableEnt* te; +@@ -649,7 +649,7 @@ static void DefaultIndexEntries (File *file) + } + } + +-static void IndexEntries (File *file, int abi) ++static void IndexEntries (File *myfile, int abi) + { + switch (abi) { + case X_SPARC_ABI: +-- +2.19.2 + diff --git a/SOURCES/0004-fix-build-when-XT_GEO_TATTLER-is-defined.patch b/SOURCES/0004-fix-build-when-XT_GEO_TATTLER-is-defined.patch new file mode 100644 index 0000000..3206f86 --- /dev/null +++ b/SOURCES/0004-fix-build-when-XT_GEO_TATTLER-is-defined.patch @@ -0,0 +1,93 @@ +From 94a56091c648b4d2c922b781a9d5031c45aa1908 Mon Sep 17 00:00:00 2001 +From: "Thomas E. Dickey" +Date: Tue, 12 Mar 2019 04:34:28 -0400 +Subject: [PATCH 4/9] fix build when XT_GEO_TATTLER is defined That turns on a + debugging feature (activated by a resource setting). Its use of + was incorrect. Also fix compiler warnings in the related file. + +Signed-off-by: Thomas E. Dickey +--- + include/X11/IntrinsicI.h | 1 + + src/Intrinsic.c | 16 ++++++++-------- + 2 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/include/X11/IntrinsicI.h b/include/X11/IntrinsicI.h +index 845ab48..6e2396b 100644 +--- a/include/X11/IntrinsicI.h ++++ b/include/X11/IntrinsicI.h +@@ -196,6 +196,7 @@ extern void _XtGClistFree(Display *dpy, XtPerDisplay pd); + extern void _XtGeoTab (int); + extern void _XtGeoTrace ( + Widget widget, ++ const char *, + ... + ) _X_ATTRIBUTE_PRINTF(2,3); + +diff --git a/src/Intrinsic.c b/src/Intrinsic.c +index 7119b09..450dce7 100644 +--- a/src/Intrinsic.c ++++ b/src/Intrinsic.c +@@ -85,13 +85,14 @@ in this Software without prior written authorization from The Open Group. + #include /* for _getdrives() */ + #endif + ++#include + #include + + String XtCXtToolkitError = "XtToolkitError"; + + Boolean XtIsSubclass( + Widget widget, +- WidgetClass widgetClass) ++ WidgetClass myWidgetClass) + { + register WidgetClass w; + Boolean retval = FALSE; +@@ -100,7 +101,7 @@ Boolean XtIsSubclass( + LOCK_APP(app); + LOCK_PROCESS; + for (w = widget->core.widget_class; w != NULL; w = w->core_class.superclass) +- if (w == widgetClass) { ++ if (w == myWidgetClass) { + retval = TRUE; + break; + } +@@ -128,7 +129,7 @@ Boolean _XtCheckSubclassFlag( + + Boolean _XtIsSubclassOf( + Widget object, +- WidgetClass widgetClass, ++ WidgetClass myWidgetClass, + WidgetClass superClass, + _XtXtEnum flag) + { +@@ -139,7 +140,7 @@ Boolean _XtIsSubclassOf( + } else { + register WidgetClass c = object->core.widget_class; + while (c != superClass) { +- if (c == widgetClass) { ++ if (c == myWidgetClass) { + UNLOCK_PROCESS; + return True; + } +@@ -1566,14 +1567,13 @@ _XtGeoTab (int direction) /* +1 or -1 */ + + + void +-_XtGeoTrace (Widget widget, ...) ++_XtGeoTrace (Widget widget, const char *fmt, ...) + { + va_list args; +- char *fmt; + int i ; ++ + if (IsTattled(widget)) { +- va_start(args, widget); +- fmt = va_arg(args, char *); ++ va_start(args, fmt); + for (i=0; i +Date: Fri, 15 Mar 2019 20:06:26 -0400 +Subject: [PATCH 5/9] fix bug introduced by commit + 57c8b133bbcf38a9a1e345eabeeabe2a3e07c1c8, which modified util/makestrs.c to + avoid a shadowing warning of a function parameter versus global variable, but + overlooked use of the parameter within the functions. That caused all of the + resource strings in Shell.h to have the same value. + +Signed-off-by: Thomas E. Dickey +--- + util/makestrs.c | 122 ++++++++++++++++++++++++++++++------------------ + 1 file changed, 76 insertions(+), 46 deletions(-) + +diff --git a/util/makestrs.c b/util/makestrs.c +index 488c9bb..e626dee 100644 +--- a/util/makestrs.c ++++ b/util/makestrs.c +@@ -35,7 +35,7 @@ typedef struct _TableEnt { + struct _TableEnt* next; + char* left; + char* right; +- int offset; ++ size_t offset; + } TableEnt; + + typedef struct _Table { +@@ -44,7 +44,7 @@ typedef struct _Table { + TableEnt* tableentcurrent; + TableEnt** tableenttail; + char* name; +- int offset; ++ size_t offset; + } Table; + + typedef struct _File { +@@ -108,7 +108,7 @@ static FILE *ifopen(const char *myfile, const char *mode) + if (buffer == NULL) + return NULL; + +- snprintf(buffer, len + 1, "%s/%s", includedir, file); ++ snprintf(buffer, len + 1, "%s/%s", includedir, myfile); + #endif + + ret = fopen(buffer, mode); +@@ -123,7 +123,7 @@ static void WriteHeaderProlog (FILE *f, File *phile) + TableEnt* te; + + (void) fprintf (f, "#ifdef %s\n", featurestr); +- for (t = phile->table; t; t = t->next) ++ for (t = phile->table; t; t = t->next) { + for (te = t->tableent; te; te = te->next) { + if (strcmp (te->left, "RAtom") == 0) { + (void) fprintf (f, +@@ -135,6 +135,7 @@ static void WriteHeaderProlog (FILE *f, File *phile) + prefixstr, te->left, te->right); + } + } ++ } + (void) fprintf (f, "%s", "#else\n"); + } + +@@ -148,10 +149,12 @@ static void IntelABIWriteHeader (FILE *f, File *phile) + for (t = phile->table; t; t = t->next) { + (void) fprintf (f, "%s %sConst char %s[];\n", + externrefstr, conststr ? conststr : fileprotstr, t->name); +- for (te = t->tableent; te; te = te->next) ++ for (te = t->tableent; te; te = te->next) { + (void) fprintf (f, +- "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n", +- prefixstr, te->left, prefixstr, te->left, t->name, te->offset); ++ "#ifndef %s%s\n#define %s%s ((char*)&%s[%lu])\n#endif\n", ++ prefixstr, te->left, prefixstr, te->left, t->name, ++ (unsigned long) te->offset); ++ } + } + + (void) fprintf (f, "#endif /* %s */\n", featurestr); +@@ -162,10 +165,12 @@ static void SPARCABIWriteHeader (FILE *f, File *phile) + Table* t; + TableEnt* te; + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + (void) fprintf (f, "#define %s%s \"%s\"\n", + prefixstr, te->left, te->right); ++ } ++ } + } + + static void FunctionWriteHeader (FILE *f, File *phile) +@@ -179,12 +184,14 @@ static void FunctionWriteHeader (FILE *f, File *phile) + externrefstr, conststr ? conststr : fileprotstr, + phile->table->name); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + (void) fprintf (f, +- "#ifndef %s%s\n#define %s%s (%s(%d))\n#endif\n", ++ "#ifndef %s%s\n#define %s%s (%s(%lu))\n#endif\n", + prefixstr, te->left, prefixstr, te->left, phile->table->name, +- te->offset); ++ (unsigned long) te->offset); ++ } ++ } + + (void) fprintf (f, "#endif /* %s */\n", featurestr); + } +@@ -196,13 +203,15 @@ static void ArrayperWriteHeader (FILE *f, File *phile) + + WriteHeaderProlog (f, phile); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + (void) fprintf (f, + "#ifndef %s%s\n%s %sConst char %s%s[];\n#endif\n", + prefixstr, te->left, + externrefstr, conststr ? conststr : fileprotstr, + prefixstr, te->left); ++ } ++ } + + (void) fprintf (f, "#endif /* %s */\n", featurestr); + } +@@ -218,12 +227,14 @@ static void DefaultWriteHeader (FILE *f, File *phile) + externrefstr, conststr ? conststr : fileprotstr, + phile->table->name); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + (void) fprintf (f, +- "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n", ++ "#ifndef %s%s\n#define %s%s ((char*)&%s[%lu])\n#endif\n", + prefixstr, te->left, prefixstr, te->left, phile->table->name, +- te->offset); ++ (unsigned long) te->offset); ++ } ++ } + + (void) fprintf (f, "#endif /* %s */\n", featurestr); + } +@@ -232,7 +243,7 @@ static void CopyTmplProlog (FILE *tmpl, FILE *f) + { + char buf[1024]; + static const char* magic_string = X_MAGIC_STRING; +- int magic_string_len = strlen (magic_string); ++ size_t magic_string_len = strlen (magic_string); + + while (fgets (buf, sizeof buf, tmpl)) { + if (strncmp (buf, magic_string, magic_string_len) == 0) { +@@ -316,7 +327,7 @@ static void WriteSourceLine (TableEnt *te, int abi, int fudge) + (void) printf ("%s", "\n"); + } + +-static const char* const_string = "%s %sConst char %s[] = {\n"; ++#define const_string "%s %sConst char %s[] = {\n" + + static void IntelABIWriteSource (int abi) + { +@@ -329,8 +340,9 @@ static void IntelABIWriteSource (int abi) + for (t = phile->table; t; t = t->next) { + (void) printf (const_string, externdefstr, + conststr ? conststr : "", t->name); +- for (te = t->tableent; te; te = te->next) ++ for (te = t->tableent; te; te = te->next) { + WriteSourceLine (te, abi, 0); ++ } + (void) printf ("%s\n\n", "};"); + } + } +@@ -347,17 +359,21 @@ static void IntelABIBCWriteSource (int abi) + (void) printf (const_string, externdefstr, + conststr ? conststr : "", phile->table->name); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + WriteSourceLine (te, abi, t->next ? 1 : 0); ++ } ++ } + (void) printf ("%s\n\n", "};"); + + if (phile->table->next) { + (void) printf (const_string, externdefstr, + conststr ? conststr : "", phile->table->next->name); +- for (t = phile->table->next; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table->next; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + WriteSourceLine (te, abi, 0); ++ } ++ } + (void) printf ("%s\n\n", "};"); + } + } +@@ -374,9 +390,11 @@ static void FunctionWriteSource (int abi) + (void) printf ("static %sConst char _%s[] = {\n", + conststr ? conststr : "", phile->table->name); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + WriteSourceLine (te, abi, t->next ? 1 : 0); ++ } ++ } + (void) printf ("%s\n\n", "};"); + + (void) printf ("%sConst char* %s(index)\n int index;\n{\n return &_%s[index];\n}\n\n", +@@ -394,7 +412,7 @@ static void ArrayperWriteSource (int abi) + Table* t; + TableEnt* te; + +- for (t = phile->table; t; t = t->next) ++ for (t = phile->table; t; t = t->next) { + for (te = t->tableent; te; te = te->next) { + if (strcmp (te->left, "RAtom") == 0) { + if (done_atom) return; +@@ -405,6 +423,7 @@ static void ArrayperWriteSource (int abi) + prefixstr, + te->left, te->right); + } ++ } + } + } + +@@ -419,9 +438,11 @@ static void DefaultWriteSource (int abi) + (void) printf (const_string, externdefstr, conststr ? conststr : "", + phile->table->name); + +- for (t = phile->table; t; t = t->next) +- for (te = t->tableent; te; te = te->next) ++ for (t = phile->table; t; t = t->next) { ++ for (te = t->tableent; te; te = te->next) { + WriteSourceLine (te, abi, t->next ? 1 : 0); ++ } ++ } + (void) printf ("%s\n\n", "};"); + } + } +@@ -457,7 +478,10 @@ static void WriteSource(char *tagline, int abi) + + (*sourceproc[abi])(abi); + +- if (tmpl) CopyTmplEpilog (tmpl, stdout); ++ if (tmpl) { ++ CopyTmplEpilog (tmpl, stdout); ++ fclose(tmpl); ++ } + } + + static void DoLine(char *buf) +@@ -586,9 +610,9 @@ static void DoLine(char *buf) + { + char* right; + TableEnt* tableent; +- int llen; +- int rlen; +- int len; ++ size_t llen; ++ size_t rlen; ++ size_t len; + + if ((right = strchr(buf, ' '))) + *right++ = 0; +@@ -602,7 +626,8 @@ static void DoLine(char *buf) + llen = len = strlen(buf) + 1; + rlen = strlen(right) + 1; + if (right != buf + 1) len += rlen; +- if ((tableent = (TableEnt*)malloc(sizeof(TableEnt) + len)) == NULL) ++ tableent = (TableEnt*)calloc(sizeof(TableEnt) + len, 1); ++ if (tableent == NULL) + exit(1); + tableent->left = (char *)(tableent + 1); + strcpy(tableent->left, buf); +@@ -627,11 +652,12 @@ static void IntelABIIndexEntries (File *myfile) + Table* t; + TableEnt* te; + +- for (t = file->table; t; t = t->next) ++ for (t = myfile->table; t; t = t->next) { + for (te = t->tableent; te; te = te->next) { + te->offset = t->offset; + t->offset += strlen (te->right); + t->offset++; ++ } + } + } + +@@ -639,13 +665,14 @@ static void DefaultIndexEntries (File *myfile) + { + Table* t; + TableEnt* te; +- int offset = 0; ++ size_t offset = 0; + +- for (t = file->table; t; t = t->next) ++ for (t = myfile->table; t; t = t->next) { + for (te = t->tableent; te; te = te->next) { + te->offset = offset; + offset += strlen (te->right); + offset++; ++ } + } + } + +@@ -656,10 +683,10 @@ static void IndexEntries (File *myfile, int abi) + break; + case X_INTEL_ABI: + case X_INTEL_ABI_BC: +- IntelABIIndexEntries (file); ++ IntelABIIndexEntries (myfile); + break; + default: +- DefaultIndexEntries (file); ++ DefaultIndexEntries (myfile); + break; + } + } +@@ -669,12 +696,12 @@ static char* DoComment (char *line) + char* tag; + char* eol; + char* ret; +- int len; ++ size_t len; + + /* assume that the first line with two '$' in it is the RCS tag line */ + if ((tag = strchr (line, '$')) == NULL) return NULL; + if ((eol = strchr (tag + 1, '$')) == NULL) return NULL; +- len = eol - tag; ++ len = (size_t)(eol - tag); + if ((ret = malloc (len)) == NULL) + exit (1); + (void) strncpy (ret, tag + 1, len - 1); +@@ -684,7 +711,7 @@ static char* DoComment (char *line) + + int main(int argc, char *argv[]) + { +- int len, i; ++ size_t len; + char* tagline = NULL; + File* phile; + FILE *f; +@@ -698,6 +725,7 @@ int main(int argc, char *argv[]) + + f = stdin; + if (argc > 1) { ++ int i; + for (i = 1; i < argc; i++) { + if (strcmp (argv[i], "-f") == 0) { + if (++i < argc) +@@ -706,10 +734,12 @@ int main(int argc, char *argv[]) + return 1; + } + if (strcmp (argv[i], "-i") == 0) { +- if (++i < argc) ++ if (++i < argc) { + includedir = argv[i]; +- else ++ } else { ++ if (f != 0 && f != stdin) fclose(f); + return 1; ++ } + } + if (strcmp (argv[i], "-sparcabi") == 0) + abi = X_SPARC_ABI; +-- +2.19.2 + diff --git a/SOURCES/0006-Use-standard-size_t-type-in-the-casts-for-length-par.patch b/SOURCES/0006-Use-standard-size_t-type-in-the-casts-for-length-par.patch new file mode 100644 index 0000000..71115df --- /dev/null +++ b/SOURCES/0006-Use-standard-size_t-type-in-the-casts-for-length-par.patch @@ -0,0 +1,206 @@ +From 15ce56425b5e5b89486481fdf7a8b077639f3c78 Mon Sep 17 00:00:00 2001 +From: "Thomas E. Dickey" +Date: Sun, 17 Mar 2019 20:59:21 -0400 +Subject: [PATCH 6/9] Use standard size_t type in the casts for + length-parameter of memcpy, memmove and bzero. When the library was written + (1989), none of those had been standardized, and the source-code used "(int)" + casts to help with K&R compilers. The cleanup done in the previous update + used binary-compare to validate, which does not work for these because the + compiler is recording the cast's effect. + +This change reduces the number of gcc warnings from 163 to 128. + +Signed-off-by: Thomas E. Dickey +--- + include/X11/IntrinsicI.h | 6 +++--- + src/Create.c | 6 +++--- + src/Resources.c | 24 ++++++++++++------------ + src/SetValues.c | 8 ++++---- + 4 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/include/X11/IntrinsicI.h b/include/X11/IntrinsicI.h +index 6e2396b..c028701 100644 +--- a/include/X11/IntrinsicI.h ++++ b/include/X11/IntrinsicI.h +@@ -110,14 +110,14 @@ SOFTWARE. + + #define XtMemmove(dst, src, size) \ + if ((char *)(dst) != (char *)(src)) { \ +- (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ ++ (void) memcpy((char *) (dst), (char *) (src), (size_t) (size)); \ + } + + #define XtBZero(dst, size) \ +- bzero((char *) (dst), (int) (size)) ++ bzero((char *) (dst), (size_t) (size)) + + #define XtMemcmp(b1, b2, size) \ +- memcmp((char *) (b1), (char *) (b2), (int) (size)) ++ memcmp((char *) (b1), (char *) (b2), (size_t) (size)) + + + /**************************************************************** +diff --git a/src/Create.c b/src/Create.c +index da00192..bbea9ce 100644 +--- a/src/Create.c ++++ b/src/Create.c +@@ -412,14 +412,14 @@ xtCreate( + wsize = widget_class->core_class.widget_size; + csize = 0; + req_widget = (Widget) XtStackAlloc(wsize, widget_cache); +- (void) memmove ((char *) req_widget, (char *) widget, (int) wsize); ++ (void) memmove ((char *) req_widget, (char *) widget, (size_t) wsize); + CallInitialize (XtClass(widget), req_widget, widget, args, num_args); + if (parent_constraint_class != NULL) { + csize = parent_constraint_class->constraint_class.constraint_size; + if (csize) { + req_constraints = XtStackAlloc(csize, constraint_cache); + (void) memmove((char*)req_constraints, widget->core.constraints, +- (int)csize); ++ (size_t)csize); + req_widget->core.constraints = req_constraints; + } else req_widget->core.constraints = NULL; + CallConstraintInitialize(parent_constraint_class, req_widget, widget, +@@ -778,7 +778,7 @@ _XtCreateHookObj(Screen* screen) + CompileCallbacks(hookobj); + wsize = hookObjectClass->core_class.widget_size; + req_widget = (Widget) XtStackAlloc(wsize, widget_cache); +- (void) memmove ((char *) req_widget, (char *) hookobj, (int) wsize); ++ (void) memmove ((char *) req_widget, (char *) hookobj, (size_t) wsize); + CallInitialize (hookObjectClass, req_widget, hookobj, + (ArgList)NULL, (Cardinal) 0); + XtStackFree((XtPointer)req_widget, widget_cache); +diff --git a/src/Resources.c b/src/Resources.c +index 9e0f065..456da7a 100644 +--- a/src/Resources.c ++++ b/src/Resources.c +@@ -110,7 +110,7 @@ void _XtCopyFromArg( + register unsigned int size) + { + if (size > sizeof(XtArgVal)) +- (void) memmove((char *) dst, (char *) src, (int) size); ++ (void) memmove((char *) dst, (char *) src, (size_t) size); + else { + union { + long longval; +@@ -133,7 +133,7 @@ void _XtCopyFromArg( + else if (size == sizeof(char*)) u.charptr = (char*)src; + else p = (char*)&src; + +- (void) memmove(dst, p, (int) size); ++ (void) memmove(dst, p, (size_t) size); + } + } /* _XtCopyFromArg */ + +@@ -158,7 +158,7 @@ void _XtCopyToArg( + XtPointer ptr; + } u; + if (size <= sizeof(XtArgVal)) { +- (void) memmove((char*)&u, (char*)src, (int)size ); ++ (void) memmove((char*)&u, (char*)src, (size_t)size ); + if (size == sizeof(long)) *dst = (XtArgVal)u.longval; + #ifdef LONG64 + else if (size == sizeof(int)) *dst = (XtArgVal)u.intval; +@@ -167,10 +167,10 @@ void _XtCopyToArg( + else if (size == sizeof(char)) *dst = (XtArgVal)u.charval; + else if (size == sizeof(char*)) *dst = (XtArgVal)u.charptr; + else if (size == sizeof(XtPointer)) *dst = (XtArgVal)u.ptr; +- else (void) memmove((char*)dst, (char*)src, (int)size ); ++ else (void) memmove((char*)dst, (char*)src, (size_t)size ); + } + else +- (void) memmove((char*)dst, (char*)src, (int)size ); ++ (void) memmove((char*)dst, (char*)src, (size_t)size ); + #else + XtErrorMsg("invalidGetValues", "xtGetValues", XtCXtToolkitError, + "NULL ArgVal in XtGetValues", (String*) NULL, (Cardinal*) NULL); +@@ -178,7 +178,7 @@ void _XtCopyToArg( + } + else { + /* proper GetValues semantics: argval is pointer to destination */ +- (void) memmove((char*)*dst, (char*)src, (int)size ); ++ (void) memmove((char*)*dst, (char*)src, (size_t)size ); + } + } /* _XtCopyToArg */ + +@@ -202,7 +202,7 @@ static void CopyToArg( + XtPointer ptr; + } u; + if (size <= sizeof(XtArgVal)) { +- (void) memmove((char*)&u, (char*)src, (int)size ); ++ (void) memmove((char*)&u, (char*)src, (size_t)size ); + if (size == sizeof(long)) *dst = (XtArgVal)u.longval; + #ifdef LONG64 + else if (size == sizeof(int)) *dst = (XtArgVal)u.intval; +@@ -211,14 +211,14 @@ static void CopyToArg( + else if (size == sizeof(char)) *dst = (XtArgVal)u.charval; + else if (size == sizeof(char*)) *dst = (XtArgVal)u.charptr; + else if (size == sizeof(XtPointer)) *dst = (XtArgVal)u.ptr; +- else (void) memmove((char*)dst, (char*)src, (int)size ); ++ else (void) memmove((char*)dst, (char*)src, (size_t)size ); + } + else +- (void) memmove((char*)dst, (char*)src, (int)size ); ++ (void) memmove((char*)dst, (char*)src, (size_t)size ); + } + else { + /* proper GetValues semantics: argval is pointer to destination */ +- (void) memmove((char*)*dst, (char*)src, (int)size ); ++ (void) memmove((char*)*dst, (char*)src, (size_t)size ); + } + } /* CopyToArg */ + +@@ -519,8 +519,8 @@ static XtCacheRef *GetResources( + } + + /* Mark each resource as not found on arg list */ +- bzero((char *) found, (int) (num_resources * sizeof(Boolean))); +- bzero((char *) typed, (int) (num_resources * sizeof(int))); ++ bzero((char *) found, (size_t) (num_resources * sizeof(Boolean))); ++ bzero((char *) typed, (size_t) (num_resources * sizeof(int))); + + /* Copy the args into the resources, mark each as found */ + { +diff --git a/src/SetValues.c b/src/SetValues.c +index e432ec7..f274000 100644 +--- a/src/SetValues.c ++++ b/src/SetValues.c +@@ -224,7 +224,7 @@ void XtSetValues( + UNLOCK_PROCESS; + oldw = (Widget) XtStackAlloc(widgetSize, oldwCache); + reqw = (Widget) XtStackAlloc (widgetSize, reqwCache); +- (void) memmove((char *) oldw, (char *) w, (int) widgetSize); ++ (void) memmove((char *) oldw, (char *) w, (size_t) widgetSize); + + /* Set resource values */ + +@@ -233,7 +233,7 @@ void XtSetValues( + wc->core_class.num_resources, args, num_args); + UNLOCK_PROCESS; + +- (void) memmove ((char *) reqw, (char *) w, (int) widgetSize); ++ (void) memmove ((char *) reqw, (char *) w, (size_t) widgetSize); + + hasConstraints = (XtParent(w) != NULL && !XtIsShell(w) && XtIsConstraint(XtParent(w))); + +@@ -253,7 +253,7 @@ void XtSetValues( + oldw->core.constraints = XtStackAlloc(constraintSize, oldcCache); + reqw->core.constraints = XtStackAlloc(constraintSize, reqcCache); + (void) memmove((char *) oldw->core.constraints, +- (char *) w->core.constraints, (int) constraintSize); ++ (char *) w->core.constraints, (size_t) constraintSize); + + /* Set constraint values */ + LOCK_PROCESS; +@@ -262,7 +262,7 @@ void XtSetValues( + cwc->constraint_class.num_resources, args, num_args); + UNLOCK_PROCESS; + (void) memmove((char *) reqw->core.constraints, +- (char *) w->core.constraints, (int) constraintSize); ++ (char *) w->core.constraints, (size_t) constraintSize); + } + + /* Inform widget of changes, then inform parent of changes */ +-- +2.19.2 + diff --git a/SOURCES/0007-Fix-leaks-detected-by-covscan.patch b/SOURCES/0007-Fix-leaks-detected-by-covscan.patch new file mode 100644 index 0000000..318db3f --- /dev/null +++ b/SOURCES/0007-Fix-leaks-detected-by-covscan.patch @@ -0,0 +1,118 @@ +From a35bef8c333f3fcf12d66e38ad769bc5f1df16a3 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Thu, 11 Apr 2019 17:26:58 +0200 +Subject: [PATCH 7/9] Fix leaks detected by covscan + +The following leaks are reported by covscan: + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/ResConfig.c:542: alloc_arg: "_get_part" allocates memory that is stored into "part". +libXt-20190411/src/ResConfig.c:544: noescape: Resource "part" is not freed or pointed-to in "_match_resource_to_widget". +libXt-20190411/src/ResConfig.c:560: leaked_storage: Variable "part" going out of scope leaks the storage it points to. + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/TMgrab.c:108: alloc_arg: "XtKeysymToKeycodeList" allocates memory that is stored into "keycodes". +libXt-20190411/src/TMgrab.c:115: var_assign: Assigning: "keycodeP" = "keycodes". +libXt-20190411/src/TMgrab.c:124: leaked_storage: Variable "keycodeP" going out of scope leaks the storage it points to. +libXt-20190411/src/TMgrab.c:124: leaked_storage: Variable "keycodes" going out of scope leaks the storage it points to. + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/TMparse.c:1544: alloc_fn: Storage is returned from allocation function "XtMalloc". +libXt-20190411/src/TMparse.c:1544: var_assign: Assigning: "event" = storage returned from "XtMalloc(88U)". +libXt-20190411/src/TMparse.c:1549: noescape: Resource "event" is not freed or pointed-to in "ParseQuotedStringEvent". +libXt-20190411/src/TMparse.c:1555: leaked_storage: Variable "event" going out of scope leaks the storage it points to. + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/TMparse.c:1779: alloc_fn: Storage is returned from allocation function "XtMalloc". +libXt-20190411/src/TMparse.c:1779: var_assign: Assigning: "action" = storage returned from "XtMalloc(32U)". +libXt-20190411/src/TMparse.c:1784: noescape: Resource "action" is not freed or pointed-to in "ParseAction". +libXt-20190411/src/TMparse.c:1785: leaked_storage: Variable "action" going out of scope leaks the storage it points to. + +In addition to this legitimate leaks, covscan can get confused by +the allocated memory in XtKeysymToKeycodeList: + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/TMgrab.c:108: alloc_arg: "XtKeysymToKeycodeList" allocates memory that is stored into "keycodes". +libXt-20190411/src/TMgrab.c:114: leaked_storage: Variable "keycodes" going out of scope leaks the storage it points to. + +Signed-off-by: Benjamin Tissoires +--- + src/ResConfig.c | 1 + + src/TMgrab.c | 10 ++++++++-- + src/TMparse.c | 6 +++++- + 3 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/ResConfig.c b/src/ResConfig.c +index 5a7f6d2..bd6792c 100644 +--- a/src/ResConfig.c ++++ b/src/ResConfig.c +@@ -557,6 +557,7 @@ _set_and_search ( + } else + _search_child (w, local_index, remainder, + resource, value, last_token, last_part); ++ XtFree (part); + return; + } + if (token == '*') { +diff --git a/src/TMgrab.c b/src/TMgrab.c +index 08cb486..4e7d20d 100644 +--- a/src/TMgrab.c ++++ b/src/TMgrab.c +@@ -105,13 +105,17 @@ static void GrabAllCorrectKeys( + careOn |= modMatch->modifiers; + careMask |= modMatch->modifierMask; + ++ keycodes = NULL; + XtKeysymToKeycodeList( + dpy, + (KeySym)typeMatch->eventCode, + &keycodes, + &keycount + ); +- if (keycount == 0) return; ++ if (keycount == 0) { ++ XtFree((char *)keycodes); ++ return; ++ } + for (keycodeP = keycodes; keycount--; keycodeP++) { + if (modMatch->standard) { + /* find standard modifiers that produce this keysym */ +@@ -120,8 +124,10 @@ static void GrabAllCorrectKeys( + Modifiers modifiers_return; + XtTranslateKeycode( dpy, *keycodeP, (Modifiers)0, + &modifiers_return, &keysym ); +- if (careOn & modifiers_return) ++ if (careOn & modifiers_return) { ++ XtFree((char *)keycodes); + return; ++ } + if (keysym == typeMatch->eventCode) { + XtGrabKey(widget, *keycodeP, careOn, + grabP->owner_events, +diff --git a/src/TMparse.c b/src/TMparse.c +index df94181..086f53d 100644 +--- a/src/TMparse.c ++++ b/src/TMparse.c +@@ -1551,6 +1551,7 @@ static String ParseEventSeq( + XtCXtToolkitError, + "... probably due to non-Latin1 character in quoted string", + (String*)NULL, (Cardinal*)NULL); ++ XtFree((char *)event); + return PanicModeRecovery(str); + } + *nextEvent = event; +@@ -1781,7 +1782,10 @@ static String ParseActionSeq( + action->next = NULL; + + str = ParseAction(str, action, &quark, error); +- if (*error) return PanicModeRecovery(str); ++ if (*error) { ++ XtFree((char *)action); ++ return PanicModeRecovery(str); ++ } + + action->idx = _XtGetQuarkIndex(parseTree, quark); + ScanWhitespace(str); +-- +2.19.2 + diff --git a/SOURCES/0008-dummy-fix-for-covscan.patch b/SOURCES/0008-dummy-fix-for-covscan.patch new file mode 100644 index 0000000..f11749d --- /dev/null +++ b/SOURCES/0008-dummy-fix-for-covscan.patch @@ -0,0 +1,59 @@ +From a9e6eecdd61b43367d5b7873532952db54b1b124 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Thu, 11 Apr 2019 17:27:12 +0200 +Subject: [PATCH 8/9] dummy fix for covscan + +covscan seems lost here: + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/Intrinsic.c:1074: alloc_fn: Storage is returned from allocation function "__XtMalloc". +libXt-20190411/src/Intrinsic.c:1074: var_assign: Assigning: "buf2" = storage returned from "__XtMalloc(4096U)". +libXt-20190411/src/Intrinsic.c:1110: leaked_storage: Variable "buf2" going out of scope leaks the storage it points to. + +Error: USE_AFTER_FREE (CWE-416): +libXt-20190411/src/Intrinsic.c:1113: alias: Assigning: "buf" = "buf2". Now both point to the same storage. +libXt-20190411/src/Intrinsic.c:1108: freed_arg: "XtFree" frees "buf2". +libXt-20190411/src/Intrinsic.c:1110: use_after_free: Using freed pointer "buf". + +Both are false positive, but we can make it understand where it +is wrong. + +Signed-off-by: Benjamin Tissoires +--- + src/Intrinsic.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/Intrinsic.c b/src/Intrinsic.c +index 450dce7..3a16d5e 100644 +--- a/src/Intrinsic.c ++++ b/src/Intrinsic.c +@@ -1070,8 +1070,9 @@ String XtFindFile( + int len; + Boolean firstTime = TRUE; + +- buf = buf1 = __XtMalloc((unsigned)PATH_MAX); ++ buf1 = __XtMalloc((unsigned)PATH_MAX); + buf2 = __XtMalloc((unsigned)PATH_MAX); ++ buf = buf1; + + if (predicate == NULL) predicate = TestFile; + +@@ -1105,9 +1106,12 @@ String XtFindFile( + #ifdef XNL_DEBUG + printf("File found.\n"); + #endif /* XNL_DEBUG */ +- if (buf == buf1) XtFree(buf2); +- else XtFree(buf1); +- return buf; ++ if (buf == buf1) { ++ XtFree(buf2); ++ return buf1; ++ } ++ XtFree(buf1); ++ return buf2; + } + if (buf == buf1) + buf = buf2; +-- +2.19.2 + diff --git a/SOURCES/0009-Fix-covscan-complain.patch b/SOURCES/0009-Fix-covscan-complain.patch new file mode 100644 index 0000000..ecbb411 --- /dev/null +++ b/SOURCES/0009-Fix-covscan-complain.patch @@ -0,0 +1,69 @@ +From fa2acae4f13209aaefa5a38d046aca3da545fe63 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Thu, 11 Apr 2019 17:21:17 +0200 +Subject: [PATCH 9/9] Fix covscan complain + +covscan gets confused by the test before the XtFree. + +Error: RESOURCE_LEAK (CWE-772): +libXt-20190411/src/Event.c:743: alloc_fn: Storage is returned from allocation function "__XtMalloc". +libXt-20190411/src/Event.c:743: var_assign: Assigning: "proc" = storage returned from "__XtMalloc((Cardinal)((size_t)numprocs * 16UL))". +libXt-20190411/src/Event.c:745: var_assign: Assigning: "closure" = "proc". +libXt-20190411/src/Event.c:776: leaked_storage: Variable "closure" going out of scope leaks the storage it points to. +libXt-20190411/src/Event.c:776: leaked_storage: Variable "proc" going out of scope leaks the storage it points to. + +Mixing static arrays and dynamic ones was a good idea +in the 90s when malloc was expensive, but now, we should +probably make the code clearer by just allocating the +memory when needed. + +Signed-off-by: Benjamin Tissoires +--- + src/Event.c | 17 +++++------------ + 1 file changed, 5 insertions(+), 12 deletions(-) + +diff --git a/src/Event.c b/src/Event.c +index 11823d6..c01b65d 100644 +--- a/src/Event.c ++++ b/src/Event.c +@@ -725,8 +725,6 @@ static Boolean CallEventHandlers( + register XtEventRec *p; + XtEventHandler *proc; + XtPointer *closure; +- XtEventHandler procs[EHMAXSIZE]; +- XtPointer closures[EHMAXSIZE]; + Boolean cont_to_disp = True; + int i, numprocs; + +@@ -739,14 +737,10 @@ static Boolean CallEventHandlers( + (p->has_type_specifier && event->type == EXT_TYPE(p))) + numprocs++; + } +- if (numprocs > EHMAXSIZE) { +- proc = (XtEventHandler *)__XtMalloc(numprocs * (sizeof(XtEventHandler) + +- sizeof(XtPointer))); +- closure = (XtPointer *)(proc + numprocs); +- } else { +- proc = procs; +- closure = closures; +- } ++ proc = (XtEventHandler *)__XtMalloc(numprocs * (sizeof(XtEventHandler) + ++ sizeof(XtPointer))); ++ closure = (XtPointer *)(proc + numprocs); ++ + numprocs = 0; + for (p=widget->core.event_table; p; p = p->next) { + if ((!p->has_type_specifier && (mask & p->mask)) || +@@ -771,8 +765,7 @@ static Boolean CallEventHandlers( + */ + for (i = 0; i < numprocs && cont_to_disp; i++) + (*(proc[i]))(widget, closure[i], event, &cont_to_disp); +- if (numprocs > EHMAXSIZE) +- XtFree((char *)proc); ++ XtFree((char *)proc); + return cont_to_disp; + } + +-- +2.19.2 + diff --git a/SPECS/libXt.spec b/SPECS/libXt.spec new file mode 100644 index 0000000..7159a66 --- /dev/null +++ b/SPECS/libXt.spec @@ -0,0 +1,369 @@ +%global tarball libXt +#global gitdate 20130524 +%global gitversion 1f4802b74 + +Summary: X.Org X11 libXt runtime library +Name: libXt +Version: 1.1.5 +Release: 12%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +License: MIT +URL: http://www.x.org + +%if 0%{?gitdate} +Source0: %{tarball}-%{gitdate}.tar.bz2 +Source1: make-git-snapshot.sh +Source2: commitid +%else +Source0: http://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}.tar.bz2 +%endif + +Patch1: 0001-no-need-to-check-XFree-arguments.patch +Patch2: 0002-no-need-to-check-args-for-free.patch +Patch3: 0003-resolv-shadows-a-global-declaration.patch +Patch4: 0004-fix-build-when-XT_GEO_TATTLER-is-defined.patch +Patch5: 0005-fix-bug-introduced-by.patch +Patch6: 0006-Use-standard-size_t-type-in-the-casts-for-length-par.patch +Patch7: 0007-Fix-leaks-detected-by-covscan.patch +Patch8: 0008-dummy-fix-for-covscan.patch +Patch9: 0009-Fix-covscan-complain.patch + +Requires: libX11%{?_isa} >= 1.5.99.902 + +BuildRequires: xorg-x11-util-macros +BuildRequires: autoconf automake libtool +BuildRequires: pkgconfig(xproto) pkgconfig(x11) pkgconfig(sm) +BUildRequires: libX11-devel >= 1.5.99.902 + +%description +X.Org X11 libXt runtime library + +%package devel +Summary: X.Org X11 libXt development package +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +X.Org X11 libXt development package + +%prep +%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} +%patch1 -p1 -b .git_102ba41a668568d7e7e506b0ab9f064d1f2c4ec5 +%patch2 -p1 -b .git_12eda76f2c7ff5d43dd68d7ff0ebc29cf27e9897 +%patch3 -p1 -b .git_57c8b133bbcf38a9a1e345eabeeabe2a3e07c1c8 +%patch4 -p1 -b .git_fe32434ab1a6a85d222b15e730fed9a5d8a74a2d +%patch5 -p1 -b .git_283db645c56a5aa55af1665c309182e492a3c863 +%patch6 -p1 -b .git_91c08f4d9cb915d5f7c3074db3e72ad15ec14c01 +%patch7 -p1 -b .git_bca67f981dd3bcf730ac3816836b66049dd09f33 +%patch8 -p1 -b .git_6a7584e0337bb5cfec7f786231597f46c6d5fb16 +%patch9 -p1 -b .git_ba4ec937680ee72f2fcd463752766340a4b3729d + +%build +autoreconf -v --install --force +# FIXME: Work around pointer aliasing warnings from compiler for now +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +%configure --disable-static \ + --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S" + +V=1 make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +# adding to installed docs in order to avoid using %%doc magic +cp -p COPYING ${RPM_BUILD_ROOT}%{_datadir}/doc/%{name}/COPYING + +%ldconfig_post +%ldconfig_postun + +%files +%{_libdir}/libXt.so.6 +%{_libdir}/libXt.so.6.0.0 +%dir %{_datadir}/X11/app-defaults +# not using %%doc because of side-effect (#1001246) +%dir %{_docdir}/%{name} +%{_docdir}/%{name}/COPYING + +%files devel +%{_docdir}/%{name}/*.xml +%{_includedir}/X11/CallbackI.h +%{_includedir}/X11/Composite.h +%{_includedir}/X11/CompositeP.h +%{_includedir}/X11/ConstrainP.h +%{_includedir}/X11/Constraint.h +%{_includedir}/X11/ConvertI.h +%{_includedir}/X11/Core.h +%{_includedir}/X11/CoreP.h +%{_includedir}/X11/CreateI.h +%{_includedir}/X11/EventI.h +%{_includedir}/X11/HookObjI.h +%{_includedir}/X11/InitialI.h +%{_includedir}/X11/Intrinsic.h +%{_includedir}/X11/IntrinsicI.h +%{_includedir}/X11/IntrinsicP.h +%{_includedir}/X11/Object.h +%{_includedir}/X11/ObjectP.h +%{_includedir}/X11/PassivGraI.h +%{_includedir}/X11/RectObj.h +%{_includedir}/X11/RectObjP.h +%{_includedir}/X11/ResConfigP.h +%{_includedir}/X11/ResourceI.h +%{_includedir}/X11/SelectionI.h +%{_includedir}/X11/Shell.h +%{_includedir}/X11/ShellI.h +%{_includedir}/X11/ShellP.h +%{_includedir}/X11/StringDefs.h +%{_includedir}/X11/ThreadsI.h +%{_includedir}/X11/TranslateI.h +%{_includedir}/X11/VarargsI.h +%{_includedir}/X11/Vendor.h +%{_includedir}/X11/VendorP.h +%{_includedir}/X11/Xtos.h +%{_libdir}/libXt.so +%{_libdir}/pkgconfig/xt.pc +%{_mandir}/man3/*.3* + +%changelog +* Tue Jun 4 2019 Olivier Fourdan - 1.1.5-12 +- Bump version for gating + +* Fri Apr 12 2019 Benjamin Tissoires - 1.1.5-11 +- add covscan fixes + +* Fri Feb 01 2019 Fedora Release Engineering - 1.1.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.1.5-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 29 2018 Adam Jackson - 1.1.5-8 +- Use ldconfig scriptlet macros + +* Wed Feb 07 2018 Fedora Release Engineering - 1.1.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 1.1.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.1.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.1.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.1.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri May 01 2015 Adam Jackson 1.1.5-1 +- libXt 1.1.5 + +* Sun Aug 17 2014 Fedora Release Engineering - 1.1.4-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.1.4-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Dec 13 2013 Michael Schwendt - 1.1.4-8 +- Fix duplicate documentation (#1001246) by not using %%doc +- Turn on verbose build output via V=1 make +- Remove %%defattr +- Use %%?_isa in explicit package deps + +* Wed Oct 02 2013 Adam Jackson 1.1.4-7 +- Exclude docs from main package + +* Sat Aug 03 2013 Fedora Release Engineering - 1.1.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri May 31 2013 Peter Hutterer 1.1.4-5 +- libXt 1.1.4 + +* Mon May 27 2013 Peter Hutterer - 1.1.3-5.20130524git1f4802b74 +- Require libX11 1.6RC2 for _XEatDataWords + +* Fri May 24 2013 Peter Hutterer 1.1.3-4.20130524git1f4802b74 +- Update to git snapshot to fix CVEs listed below: +- CVE-2013-2002 +- CVE-2013-2005 + +* Thu Mar 07 2013 Peter Hutterer - 1.1.3-3 +- autoreconf for aarch64 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 26 2012 Adam Jackson 1.1.3-1 +- libXt 1.1.3 + +* Thu Jul 19 2012 Fedora Release Engineering - 1.1.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Mar 15 2012 Adam Jackson 1.1.2-2 +- libXt-1.1.2-git.patch: Bugfix from git. + +* Thu Mar 08 2012 Adam Jackson 1.1.2-1 +- libXt 1.1.2 + +* Fri Jan 13 2012 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Mar 10 2011 Adam Jackson 1.1.1-1 +- libXt 1.1.1 + +* Mon Mar 07 2011 Adam Jackson 1.1.0-1 +- libXt 1.1.0 + +* Mon Feb 07 2011 Fedora Release Engineering - 1.0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Nov 08 2010 Adam Jackson 1.0.9-1 +- libXt 1.0.9 + +* Tue Oct 13 2009 Adam Jackson 1.0.7-1 +- libXt 1.0.7 + +* Fri Jul 24 2009 Fedora Release Engineering - 1.0.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 23 2009 Adam Jackson 1.0.6-2 +- Un-require xorg-x11-filesystem +- Remove useless %%dir + +* Thu Jul 02 2009 Adam Jackson 1.0.6-1 +- libXt 1.0.6 + +* Wed Feb 25 2009 Fedora Release Engineering - 1.0.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Sep 04 2008 Adam Jackson 1.0.5-1 +- libXt 1.0.5 + +* Tue Feb 19 2008 Fedora Release Engineering - 1.0.4-5 +- Autorebuild for GCC 4.3 + +* Tue Jan 15 2008 parag - 1.0.4-4 +- Merge-Review #226090 +- Removed XFree86-libs, xorg-x11-libs XFree86-devel, xorg-x11-devel as Obsoletes +- Removed BR:pkgconfig +- Removed zero-length README AUTHORS NEWS file + +* Tue Aug 21 2007 Adam Jackson - 1.0.4-3 +- Rebuild for build id + +* Sat Apr 21 2007 Matthias Clasen 1.0.4-2 +- Don't install INSTALL + +* Mon Nov 20 2006 Adam Jackson 1.0.4-1.fc7 +- Update to 1.0.4 + +* Wed Jul 12 2006 Jesse Keating 1.0.2-3.1.fc6 +- rebuild + +* Tue Jul 11 2006 Mike A. Harris 1.0.2-3.fc6 +- Add the {_datadir}/X11/app-defaults directory to the file manifest, as + libXt is the canonical owner of the directory. Discovered in (#198025). + +* Wed Jun 28 2006 Adam Jackson 1.0.2-2 +- Added libXt-1.0.2-libsm-fix.patch to remove libSM from the Requires: line + in the installed pkgconfig file. Apps should link against libSM if they + need it, but we shouldn't force them to link against it if they don't. + +* Wed Jun 21 2006 Mike A. Harris 1.0.2-1 +- Updated libXt to version 1.0.2 from X11R7.1 + +* Fri Jun 09 2006 Mike A. Harris 1.0.1-3 +- Added "Requires: xorg-x11-proto-devel" to devel package for xt.pc + +* Mon Jun 05 2006 Mike A. Harris 1.0.1-2 +- Added "BuildRequires: pkgconfig" for (#193503) +- Replace "makeinstall" with "make install DESTDIR=..." +- Remove package ownership of mandir/libdir/etc. + +* Thu Apr 27 2006 Adam Jackson 1.0.1-1 +- Update to 1.0.1 + +* Fri Feb 10 2006 Jesse Keating 1.0.0-2.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating 1.0.0-2.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 23 2006 Mike A. Harris 1.0.0-2 +- Bumped and rebuilt + +* Fri Dec 16 2005 Mike A. Harris 1.0.0-1 +- Updated libXt to version 1.0.0 from X11R7 RC4 +- Added makestrs and it's manpage to the devel subpackage. + +* Tue Dec 13 2005 Mike A. Harris 0.99.3-1 +- Updated libXt to version 0.99.3 from X11R7 RC3 +- Added "Requires(pre): xorg-x11-filesystem >= 0.99.2-3", to ensure + that /usr/lib/X11 and /usr/include/X11 pre-exist. +- Removed 'x' suffix from manpage directories to match RC3 upstream. + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Fri Dec 02 2005 Kristian Høgsberg 0.99.2-3 +- Use the default value from configure.ac for --with-xfile-search-path + except with %%{_datadir} instead of $(libdir), so Xt can search for + app-default files as usual. +- Move the --with-xfile-search-path outside the with_static condition. + +* Tue Nov 29 2005 Mike A. Harris 0.99.2-2 +- Invoke ./configure --with-xfile-search-path=%%{_datadir}/X11/app-defaults + to make sure Xt is looking in the right place for app-defaults files. + +* Fri Nov 11 2005 Mike A. Harris 0.99.2-1 +- Updated libXt to version 0.99.2 from X11R7 RC2 +- Changed 'Conflicts: XFree86-devel, xorg-x11-devel' to 'Obsoletes' +- Changed 'Conflicts: XFree86-libs, xorg-x11-libs' to 'Obsoletes' + +* Wed Nov 02 2005 Mike A. Harris 0.99.2-3 +- Actually spell RPM_OPT_FLAGS correctly this time. + +* Mon Oct 31 2005 Mike A. Harris 0.99.2-2 +- Build with -fno-strict-aliasing to work around possible pointer aliasing + issue + +* Mon Oct 24 2005 Mike A. Harris 0.99.1-1 +- Updated libXt to version 0.99.1 from X11R7 RC1 +- Updated file manifest to find manpages in 'man3x' + +* Thu Oct 06 2005 Mike A. Harris 0.99.0-5 +- Added Requires: libX11-devel to libXt-devel subpackage, as Xt headers + include Xlib headers causing xterm and other things to fail to compile. + +* Thu Sep 29 2005 Mike A. Harris 0.99.0-4 +- Renamed package to remove xorg-x11 from the name due to unanimous decision + between developers. +- Use Fedora Extras style BuildRoot tag. +- Disable static library creation by default. +- Add missing defattr to devel subpackage +- Add missing documentation files to doc macro +- Fix BuildRequires to use new style X library package names + +* Wed Aug 24 2005 Mike A. Harris 0.99.0-3 +- Changed all virtual BuildRequires to the "xorg-x11-" prefixed non-virtual + package names, as we want xorg-x11 libs to explicitly build against + X.Org supplied libs, rather than "any implementation", which is what the + virtual provides is intended for. + +* Tue Aug 23 2005 Mike A. Harris 0.99.0-2 +- Renamed package to prepend "xorg-x11" to the name for consistency with + the rest of the X11R7 packages. +- Added "Requires: %%{name} = %%{version}-%%{release}" dependency to devel + subpackage to ensure the devel package matches the installed shared libs. +- Added virtual "Provides: lib" and "Provides: lib-devel" to + allow applications to use implementation agnostic dependencies. +- Added post/postun scripts which call ldconfig. +- Added Conflicts with XFree86-libs and xorg-x11-libs to runtime package, + and Conflicts with XFree86-devel and xorg-x11-devel to devel package. + +* Mon Aug 22 2005 Mike A. Harris 0.99.0-1 +- Initial build.