diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-01-15 02:05:35 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-01-15 02:05:35 +0800 |
commit | 3eb4bdae2e03fd170ab041800d3ba49821ae6eec (patch) | |
tree | 5ff603a5c19379982400978c5f6f974993f417bb /x11 | |
parent | 9d1bee3acab7970fa5c8278c6305d1a301841a30 (diff) | |
download | freebsd-ports-gnome-3eb4bdae2e03fd170ab041800d3ba49821ae6eec.tar.gz freebsd-ports-gnome-3eb4bdae2e03fd170ab041800d3ba49821ae6eec.tar.zst freebsd-ports-gnome-3eb4bdae2e03fd170ab041800d3ba49821ae6eec.zip |
- Open /dev/apm read-only;
- don't leak file descripton if for fome reasom ioctl(2) on /dev/apm has
failed.
Submitted by: Anders Andersson <anders@hack.org> (ro /dev/apm)
sobomax (descriptor leak)
Diffstat (limited to 'x11')
-rw-r--r-- | x11/gnome-applets/Makefile | 1 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battery::read-battery.c | 22 | ||||
-rw-r--r-- | x11/gnomeapplets/Makefile | 1 | ||||
-rw-r--r-- | x11/gnomeapplets/files/patch-battery::read-battery.c | 22 | ||||
-rw-r--r-- | x11/gnomeapplets2/Makefile | 1 | ||||
-rw-r--r-- | x11/gnomeapplets2/files/patch-battery::read-battery.c | 22 |
6 files changed, 69 insertions, 0 deletions
diff --git a/x11/gnome-applets/Makefile b/x11/gnome-applets/Makefile index af1f57b53dd8..8496b15e02c8 100644 --- a/x11/gnome-applets/Makefile +++ b/x11/gnome-applets/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomeapplets PORTVERSION= 1.4.0.4 +PORTREVISION= 1 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= stable/sources/gnome-applets diff --git a/x11/gnome-applets/files/patch-battery::read-battery.c b/x11/gnome-applets/files/patch-battery::read-battery.c new file mode 100644 index 000000000000..b21c4f82e519 --- /dev/null +++ b/x11/gnome-applets/files/patch-battery::read-battery.c @@ -0,0 +1,22 @@ + +$FreeBSD$ + +--- battery/read-battery.c 2002/01/14 14:23:46 1.1 ++++ battery/read-battery.c 2002/01/14 14:25:45 +@@ -170,7 +170,7 @@ + *hours_remaining = -1; + *minutes_remaining = 1; + +- fd = open(APMDEV, O_RDWR); ++ fd = open(APMDEV, O_RDONLY); + if (fd == -1) + { + g_error (_("Cannot open /dev/apm; can't get data.")); +@@ -179,6 +179,7 @@ + + if (ioctl(fd, APMIO_GETINFO, &aip) == -1) { + g_error(_("ioctl failed on /dev/apm.")); ++ close(fd); + return FALSE; + } + diff --git a/x11/gnomeapplets/Makefile b/x11/gnomeapplets/Makefile index af1f57b53dd8..8496b15e02c8 100644 --- a/x11/gnomeapplets/Makefile +++ b/x11/gnomeapplets/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomeapplets PORTVERSION= 1.4.0.4 +PORTREVISION= 1 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= stable/sources/gnome-applets diff --git a/x11/gnomeapplets/files/patch-battery::read-battery.c b/x11/gnomeapplets/files/patch-battery::read-battery.c new file mode 100644 index 000000000000..b21c4f82e519 --- /dev/null +++ b/x11/gnomeapplets/files/patch-battery::read-battery.c @@ -0,0 +1,22 @@ + +$FreeBSD$ + +--- battery/read-battery.c 2002/01/14 14:23:46 1.1 ++++ battery/read-battery.c 2002/01/14 14:25:45 +@@ -170,7 +170,7 @@ + *hours_remaining = -1; + *minutes_remaining = 1; + +- fd = open(APMDEV, O_RDWR); ++ fd = open(APMDEV, O_RDONLY); + if (fd == -1) + { + g_error (_("Cannot open /dev/apm; can't get data.")); +@@ -179,6 +179,7 @@ + + if (ioctl(fd, APMIO_GETINFO, &aip) == -1) { + g_error(_("ioctl failed on /dev/apm.")); ++ close(fd); + return FALSE; + } + diff --git a/x11/gnomeapplets2/Makefile b/x11/gnomeapplets2/Makefile index af1f57b53dd8..8496b15e02c8 100644 --- a/x11/gnomeapplets2/Makefile +++ b/x11/gnomeapplets2/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomeapplets PORTVERSION= 1.4.0.4 +PORTREVISION= 1 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= stable/sources/gnome-applets diff --git a/x11/gnomeapplets2/files/patch-battery::read-battery.c b/x11/gnomeapplets2/files/patch-battery::read-battery.c new file mode 100644 index 000000000000..b21c4f82e519 --- /dev/null +++ b/x11/gnomeapplets2/files/patch-battery::read-battery.c @@ -0,0 +1,22 @@ + +$FreeBSD$ + +--- battery/read-battery.c 2002/01/14 14:23:46 1.1 ++++ battery/read-battery.c 2002/01/14 14:25:45 +@@ -170,7 +170,7 @@ + *hours_remaining = -1; + *minutes_remaining = 1; + +- fd = open(APMDEV, O_RDWR); ++ fd = open(APMDEV, O_RDONLY); + if (fd == -1) + { + g_error (_("Cannot open /dev/apm; can't get data.")); +@@ -179,6 +179,7 @@ + + if (ioctl(fd, APMIO_GETINFO, &aip) == -1) { + g_error(_("ioctl failed on /dev/apm.")); ++ close(fd); + return FALSE; + } + |