diff options
| author | Xiaofeng Yan <xiaofeng.yan@windriver.com> | 2011-11-17 19:03:21 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-24 22:12:03 +0000 |
| commit | e04de73421b05d76f9b92f064598f954445b9cc8 (patch) | |
| tree | 22cde6017ae1000d06c4fd8bba3cadf215b152cd | |
| parent | 32ee63229573eb094c611ce017c59c1e9813f8a5 (diff) | |
| download | poky-e04de73421b05d76f9b92f064598f954445b9cc8.tar.gz | |
tslib: Set open mode for ts_calibate.c
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
(From OE-Core rev: 61928384b91f7328aaa72c6d1299d8598c24574d)
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch | 30 | ||||
| -rw-r--r-- | meta/recipes-graphics/tslib/tslib_1.0.bb | 5 |
2 files changed, 33 insertions, 2 deletions
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 0000000000..738ef9aad1 --- /dev/null +++ b/meta/recipes-graphics/tslib/tslib/set-open-mode-for-ts_calibrate_c.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | Get patch from: http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/27614 | ||
| 2 | |||
| 3 | Upstream-Status: Inappropriate [configuration] | ||
| 4 | |||
| 5 | diff --git a/tests/ts_calibrate.c b/tests/ts_calibrate.c | ||
| 6 | index 004517b..c0a9771 100644 | ||
| 7 | --- a/tests/ts_calibrate.c | ||
| 8 | +++ b/tests/ts_calibrate.c | ||
| 9 | @@ -21,6 +21,7 @@ | ||
| 10 | #include <sys/ioctl.h> | ||
| 11 | #include <sys/mman.h> | ||
| 12 | #include <sys/time.h> | ||
| 13 | +#include <sys/stat.h> | ||
| 14 | #include <linux/kd.h> | ||
| 15 | #include <linux/vt.h> | ||
| 16 | #include <linux/fb.h> | ||
| 17 | @@ -224,9 +225,11 @@ int main() | ||
| 18 | for (i = 0; i < 7; i++) printf("%d ", cal.a [i]); | ||
| 19 | printf("\n"); | ||
| 20 | if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) { | ||
| 21 | - cal_fd = open (calfile, O_CREAT | O_RDWR); | ||
| 22 | + cal_fd = open (calfile, O_CREAT | O_RDWR, | ||
| 23 | + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); | ||
| 24 | } else { | ||
| 25 | - cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR); | ||
| 26 | + cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR, | ||
| 27 | + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); | ||
| 28 | } | ||
| 29 | sprintf (cal_buffer,"%d %d %d %d %d %d %d", | ||
| 30 | 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 dbabce02c0..f47116f596 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" | |||
| 10 | LICENSE = "LGPLv2" | 10 | LICENSE = "LGPLv2" |
| 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=f30a9716ef3762e3467a2f62bf790f0a" | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=f30a9716ef3762e3467a2f62bf790f0a" |
| 12 | 12 | ||
| 13 | PR = "r19" | 13 | PR = "r20" |
| 14 | 14 | ||
| 15 | SRC_URI = "http://download.berlios.de/tslib/tslib-${PV}.tar.bz2 \ | 15 | SRC_URI = "http://download.berlios.de/tslib/tslib-${PV}.tar.bz2 \ |
| 16 | file://fix_version.patch \ | 16 | file://fix_version.patch \ |
| 17 | file://0001-Link-plugins-against-libts.patch \ | 17 | file://0001-Link-plugins-against-libts.patch \ |
| 18 | file://ts.conf \ | 18 | file://ts.conf \ |
| 19 | file://tslib.sh" | 19 | file://tslib.sh \ |
| 20 | file://set-open-mode-for-ts_calibrate_c.patch" | ||
| 20 | 21 | ||
| 21 | SRC_URI[md5sum] = "92b2eb55b1e4ef7e2c0347069389390e" | 22 | SRC_URI[md5sum] = "92b2eb55b1e4ef7e2c0347069389390e" |
| 22 | SRC_URI[sha256sum] = "9c40d914e4f6fe00bdd77137d671c7ce4f211686228f2eb8b2d3c2360bc249c8" | 23 | SRC_URI[sha256sum] = "9c40d914e4f6fe00bdd77137d671c7ce4f211686228f2eb8b2d3c2360bc249c8" |
