diff --git a/aaa_base.changes b/aaa_base.changes index 19872a3..e51fc87 100644 --- a/aaa_base.changes +++ b/aaa_base.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 27 15:34:59 UTC 2010 - cristian.rodriguez@opensuse.org + +- get_kernel_version : use O_CLOEXEC everywhere + ------------------------------------------------------------------- Fri Jul 16 17:22:27 CEST 2010 - werner@suse.de diff --git a/get_kernel_version.c b/get_kernel_version.c index edc5509..b1f706c 100644 --- a/get_kernel_version.c +++ b/get_kernel_version.c @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _GNU_SOURCE #include #include #include @@ -47,7 +48,7 @@ main (int argc, char *argv[]) /* check if file exist and is compressed */ { unsigned char buf [2]; - int fd = open (argv[1], O_RDONLY); + int fd = open (argv[1], O_RDONLY | O_CLOEXEC); if (fd == -1) { fprintf (stderr, "Cannot open kernel image \"%s\"\n", argv[1]); @@ -64,7 +65,7 @@ main (int argc, char *argv[]) if (buf [0] == 037 && (buf [1] == 0213 || buf [1] == 0236)) { snprintf (command, sizeof (command), "/bin/gzip -dc %s 2>/dev/null", argv[1]); - fp = popen (command, "r"); + fp = popen (command, "re"); if (fp == NULL) { fprintf (stderr, "%s: faild\n", command); @@ -73,7 +74,7 @@ main (int argc, char *argv[]) } else { - fp = fopen (argv[1],"r"); + fp = fopen (argv[1],"re"); } close (fd); }