pkgsrc-Bugs archive

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

pkg/43072: buildhash in ispell-base may create file in inappropriate directory



>Number:         43072
>Category:       pkg
>Synopsis:       buildhash may create file in inappropriate directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 29 12:05:00 +0000 2010
>Originator:     enami tsugutomo
>Release:        NetBSD 5.99.23
>Organization:
>Environment:
System: NetBSD rplaca.sm.sony.co.jp 5.99.23 NetBSD 5.99.23 (GENERIC) #5: Wed 
Jan 6 11:19:56 JST 2010 
enami%sigkill.sm.sony.co.jp@localhost:/home/enami/src/current/obj.amd64/sys/arch/amd64/compile/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:
        buildhash of textproc/ispell-base trys to create name of
        stats file by replacing file extension with .stat,
        but it doesn't care if the portion replaced is really a
        file extension.

        for example, if ispell-base is built with OBJMACHINE is set,
        buildhash called via munchlist script during build process
        creates stats file as textproc/ispell-base/work.stat which is
        obviously inappropriate location.

        since bulidhash and munchlist are installed program, this is not
        just a build time problem.

>How-To-Repeat:
        put OBJMACHINE=yes in your mk.conf and cd textproc/ispell-base
        and type make.

>Fix:
        below is possible fix (changes to distinfo omitted).

        alternatively, munchlist can be fixed to call buildhash
        with passing filename with actual file extenstion (currently,
        $FAKEDICT doesn't have extension).

        i'm not sure which is better.

Index: patches/patch-ad
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/ispell-base/patches/patch-ad,v
retrieving revision 1.3
diff -u -r1.3 patch-ad
--- patches/patch-ad    7 Jul 2005 12:42:20 -0000       1.3
+++ patches/patch-ad    29 Mar 2010 07:20:54 -0000
@@ -2,6 +2,15 @@
 
 --- buildhash.c.orig   2005-04-28 12:26:06.000000000 +1200
 +++ buildhash.c
+@@ -176,7 +176,7 @@ int main (argc, argv)
+ 
+     strcpy (Sfile, Dfile);
+     lastdot = rindex (Sfile, '.');
+-    if (lastdot != NULL)
++    if (lastdot != NULL && rindex (Sfile, '/') < lastdot)
+       *lastdot = '\0';
+     strcat (Sfile, STATSUFFIX);
+ #ifdef MSDOS
 @@ -248,7 +248,7 @@ static void output ()
      {
      register FILE *           houtfile;



Home | Main Index | Thread Index | Old Index