Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] tslib:Set open mode for ts_calibate.c
@ 2011-11-17 11:10 Xiaofeng Yan
  2011-11-17 11:10 ` [PATCH 1/1] tslib: Set " Xiaofeng Yan
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaofeng Yan @ 2011-11-17 11:10 UTC (permalink / raw)
  To: openembedded-core

From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

Get patch from: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/27614 There is a potentially "unsafe" use of open(). Ubuntu 8.10+, for instance, by default enables the compiler flag -D_FORTIFY_SOURCE=2 which throws an error of ts_calibrate.c. To fix this, set a mode in the open() call, patch patched ts_calibrate.c to set 0644 (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) and it compiles fine 

Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: xiaofeng/ts_lib
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/ts_lib

Thanks,
    Xiaofeng Yan <xiaofeng.yan@windriver.com>
---


Xiaofeng Yan (1):
  tslib: Set open mode for ts_calibate.c

 .../tslib/set-open-mode-for-ts_calibrate_c.patch   |   30 ++++++++++++++++++++
 meta/recipes-graphics/tslib/tslib_1.0.bb           |    5 ++-
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] tslib: Set open mode for ts_calibate.c
  2011-11-17 11:10 [PATCH 0/1] tslib:Set open mode for ts_calibate.c Xiaofeng Yan
@ 2011-11-17 11:10 ` Xiaofeng Yan
  2011-11-25  0:06   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaofeng Yan @ 2011-11-17 11:10 UTC (permalink / raw)
  To: openembedded-core

From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

Get patch from: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/27614

There is a potentially "unsafe" use of open(). Ubuntu 8.10+, for instance,
by default enables the compiler flag -D_FORTIFY_SOURCE=2 \
which throws an error of ts_calibrate.c. To fix this, \
set a mode in the open() call, patch patched ts_calibrate.c \
to set 0644 (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) and it compiles fine

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 .../tslib/set-open-mode-for-ts_calibrate_c.patch   |   30 ++++++++++++++++++++
 meta/recipes-graphics/tslib/tslib_1.0.bb           |    5 ++-
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch

diff --git a/meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch b/meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch
new file mode 100644
index 0000000..738ef9a
--- /dev/null
+++ b/meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch
@@ -0,0 +1,30 @@
+Get patch from: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/27614
+
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/tests/ts_calibrate.c b/tests/ts_calibrate.c
+index 004517b..c0a9771 100644
+--- a/tests/ts_calibrate.c
++++ b/tests/ts_calibrate.c
+@@ -21,6 +21,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <sys/time.h>
++#include <sys/stat.h>
+ #include <linux/kd.h>
+ #include <linux/vt.h>
+ #include <linux/fb.h>
+@@ -224,9 +225,11 @@ int main()
+		for (i = 0; i < 7; i++) printf("%d ", cal.a [i]);
+		printf("\n");
+		if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {
+-			cal_fd = open (calfile, O_CREAT | O_RDWR);
++			cal_fd = open (calfile, O_CREAT | O_RDWR,
++			S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		} else {
+-			cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR);
++			cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR,
++			S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		}
+		sprintf (cal_buffer,"%d %d %d %d %d %d %d",
+			 cal.a[1], cal.a[2], cal.a[0],
diff --git a/meta/recipes-graphics/tslib/tslib_1.0.bb b/meta/recipes-graphics/tslib/tslib_1.0.bb
index dbabce0..f47116f 100644
--- a/meta/recipes-graphics/tslib/tslib_1.0.bb
+++ b/meta/recipes-graphics/tslib/tslib_1.0.bb
@@ -10,13 +10,14 @@ SECTION = "base"
 LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=f30a9716ef3762e3467a2f62bf790f0a"
 
-PR = "r19"
+PR = "r20"
 
 SRC_URI = "http://download.berlios.de/tslib/tslib-${PV}.tar.bz2 \
            file://fix_version.patch \
            file://0001-Link-plugins-against-libts.patch \
            file://ts.conf \
-           file://tslib.sh"
+           file://tslib.sh \
+           file://set-open-mode-for-ts_calibrate_c.patch"
 
 SRC_URI[md5sum] = "92b2eb55b1e4ef7e2c0347069389390e"
 SRC_URI[sha256sum] = "9c40d914e4f6fe00bdd77137d671c7ce4f211686228f2eb8b2d3c2360bc249c8"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] tslib: Set open mode for ts_calibate.c
  2011-11-17 11:10 ` [PATCH 1/1] tslib: Set " Xiaofeng Yan
@ 2011-11-25  0:06   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2011-11-25  0:06 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2011-11-17 at 19:10 +0800, Xiaofeng Yan wrote:
> From: Xiaofeng Yan <xiaofeng.yan@windriver.com>
> 
> Get patch from: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/27614
> 
> There is a potentially "unsafe" use of open(). Ubuntu 8.10+, for instance,
> by default enables the compiler flag -D_FORTIFY_SOURCE=2 \
> which throws an error of ts_calibrate.c. To fix this, \
> set a mode in the open() call, patch patched ts_calibrate.c \
> to set 0644 (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) and it compiles fine
> 
> Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
> ---
>  .../tslib/set-open-mode-for-ts_calibrate_c.patch   |   30 ++++++++++++++++++++
>  meta/recipes-graphics/tslib/tslib_1.0.bb           |    5 ++-
>  2 files changed, 33 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-25  0:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 11:10 [PATCH 0/1] tslib:Set open mode for ts_calibate.c Xiaofeng Yan
2011-11-17 11:10 ` [PATCH 1/1] tslib: Set " Xiaofeng Yan
2011-11-25  0:06   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox