pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/create Explicitly check tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/569a0265966d
branches:  trunk
changeset: 538224:569a0265966d
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Feb 02 15:47:52 2008 +0000

description:
Explicitly check that meta data files are regular.

diffstat:

 pkgtools/pkg_install/files/create/util.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 13a53e6a45a8 -r 569a0265966d pkgtools/pkg_install/files/create/util.c
--- a/pkgtools/pkg_install/files/create/util.c  Sat Feb 02 13:38:53 2008 +0000
+++ b/pkgtools/pkg_install/files/create/util.c  Sat Feb 02 15:47:52 2008 +0000
@@ -142,6 +142,8 @@
 
        update_ids(file);
 
+       if ((file->st.st_mode & S_IFMT) != S_IFREG)
+               errx(1, "meta data file %s is not regular file", disk_name);
        if (file->st.st_size > SSIZE_MAX ||
            (file->data = malloc(file->st.st_size)) == NULL)
                errx(2, "cannot allocate memory for file %s", disk_name);



Home | Main Index | Thread Index | Old Index