converters/mpack doesn't apply the patch properly

Vahan Yerkanian vahan at arminco.com
Wed Mar 1 08:08:24 PST 2006


I thought FreeBSD default install doesn't create /usr/tmp directory... 
If you install mpack from the packages it works ok, the problem 
manifests itself when you try to portupgrade or install it via ports.
See below:

# uname -sv
FreeBSD FreeBSD 6.0-RELEASE #1: Wed Nov 16 01:37:51 AMT 2005
# pkg_add -r mpack; rehash
Fetching 
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/mpack.tbz... 
Done.
# mpack -s test sample2.pdf test at domain.com
#

^ successful

# pkg_delete -r "mpack*"
# cd /usr/ports/converters/mpack
# make install clean; rehash
[snip]
===>  Installing for mpack-1.6
===>   Generating temporary packing list
===>  Checking if converters/mpack already installed
/bin/sh ./mkinstalldirs /usr/local/bin
   install  -s -o root -g wheel -m 555  mpack /usr/local/bin/mpack
   install  -s -o root -g wheel -m 555  munpack /usr/local/bin/munpack
make  install-man1
/bin/sh ./mkinstalldirs /usr/local/man/man1
  install  -o root -g wheel -m 444 ./mpack.1 /usr/local/man/man1/mpack.1
  install  -o root -g wheel -m 444 ./munpack.1 /usr/local/man/man1/munpack.1
===>   Compressing manual pages for mpack-1.6
===>   Registering installation for mpack-1.6
===>  Cleaning for mpack-1.6
# mpack -s test sample2.pdf test at domain.com
No such file or directory
# ktrace mpack -s test sample2.pdf test at domain.com
No such file or directory
# kdump -f ktrace.out
[snip]
  38294 mpack    CALL  readlink(0x281305f7,0xbfbfd680,0x3f)
  38294 mpack    NAMI  "/etc/malloc.conf"
  38294 mpack    RET   readlink -1 errno 2 No such file or directory
  38294 mpack    CALL  issetugid
  38294 mpack    RET   issetugid 0
[snip]
  38294 mpack    RET   read 116/0x74
  38294 mpack    CALL  close(0x3)
  38294 mpack    RET   close 0
  38294 mpack    CALL  stat(0xbfbfd750,0xbfbfd660)
  38294 mpack    NAMI  "/usr/tmp"
  38294 mpack    RET   stat -1 errno 2 No such file or directory
  38294 mpack    CALL  close(0xffffffff)
  38294 mpack    RET   close -1 errno 9 Bad file descriptor
  38294 mpack    CALL  open(0xbfbfecca,0,0x1b6)
  38294 mpack    NAMI  "sample2.pdf"
  38294 mpack    RET   open 3
  38294 mpack    CALL  fstat(0x3,0xbfbfd0e0)
  38294 mpack    RET   fstat 0
  38294 mpack    CALL  break(0x8052000)
  38294 mpack    RET   break 0
  38294 mpack    CALL  read(0x3,0x8051000,0x1000)
  38294 mpack    GIO   fd 3 read 4096 bytes
[snip]
  38294 mpack    RET   read 2879/0xb3f
  38294 mpack    CALL  read(0x3,0x8051000,0x1000)
  38294 mpack    GIO   fd 3 read 0 bytes
        ""
  38294 mpack    RET   read 0
  38294 mpack    CALL  lseek(0x3,0,0,0,0)
  38294 mpack    RET   lseek 0
  38294 mpack    CALL  getpid
  38294 mpack    RET   getpid 38294/0x9596
  38294 mpack    CALL  gettimeofday(0xbfbfd248,0)
  38294 mpack    RET   gettimeofday 0
  38294 mpack    CALL  __sysctl(0xbfbfd248,0x2,0x804d620,0xbfbfd264,0,0)
  38294 mpack    RET   __sysctl 0
  38294 mpack    CALL  open(0x804f060,0xa02,0x1a4)
  38294 mpack    NAMI  "/usr/tmp/mpackE7AnJL"
  38294 mpack    RET   open -1 errno 2 No such file or directory
  38294 mpack    CALL  writev(0x2,0xbfbfca30,0x2)
  38294 mpack    GIO   fd 2 wrote 26 bytes
        "No such file or directory
        "
  38294 mpack    RET   writev 26/0x1a
  38294 mpack    CALL  exit(0x1)


# ln -s /tmp /usr/tmp
# rm /usr/tmp/mpack* /tmp/mpack*
# ktrace mpack -s test sample2.pdf test at domain.com
File exists
# kdump -f ktrace.out
  38314 mpack    RET   read 116/0x74
  38314 mpack    CALL  close(0x3)
  38314 mpack    RET   close 0
  38314 mpack    CALL  stat(0xbfbfd750,0xbfbfd660)
  38314 mpack    NAMI  "/usr/tmp"
  38314 mpack    RET   stat 0
  38314 mpack    CALL  open(0xbfbfd750,0xa02,0x180)
  38314 mpack    NAMI  "/usr/tmp/mpackOcT4Hj"
  38314 mpack    RET   open 3
  38314 mpack    CALL  close(0x3)
  38314 mpack    RET   close 0
  38314 mpack    CALL  open(0xbfbfecca,0,0x1b6)
  38314 mpack    NAMI  "sample2.pdf"
  38314 mpack    RET   open 3
  38314 mpack    CALL  fstat(0x3,0xbfbfd0e0)
  38314 mpack    RET   fstat 0
  38314 mpack    CALL  break(0x8052000)
  38314 mpack    RET   break 0
  38314 mpack    CALL  read(0x3,0x8051000,0x1000)
  38314 mpack    GIO   fd 3 read 4096 bytes
[snip]
  38314 mpack    RET   read 2879/0xb3f
  38314 mpack    CALL  read(0x3,0x8051000,0x1000)
  38314 mpack    GIO   fd 3 read 0 bytes
        ""
  38314 mpack    RET   read 0
  38314 mpack    CALL  lseek(0x3,0,0,0,0)
  38314 mpack    RET   lseek 0
  38314 mpack    CALL  getpid
  38314 mpack    RET   getpid 38314/0x95aa
  38314 mpack    CALL  gettimeofday(0xbfbfd248,0)
  38314 mpack    RET   gettimeofday 0
  38314 mpack    CALL  __sysctl(0xbfbfd248,0x2,0x804d620,0xbfbfd264,0,0)
  38314 mpack    RET   __sysctl 0
  38314 mpack    CALL  open(0x804f060,0xa02,0x1a4)
  38314 mpack    NAMI  "/usr/tmp/mpackOcT4Hj"
  38314 mpack    RET   open -1 errno 17 File exists
  38314 mpack    CALL  writev(0x2,0xbfbfca30,0x2)
  38314 mpack    GIO   fd 2 wrote 12 bytes
        "File exists
        "
  38314 mpack    RET   writev 12/0xc
  38314 mpack    CALL  exit(0x1)
#

Any clues?

Regards,
Vahan



Paul Schmehl wrote:
> --On Wednesday, March 01, 2006 18:15:40 +0400 Vahan Yerkanian 
> <vahan at arminco.com> wrote:
> 
>> PORTNAME=       mpack
>> PORTVERSION=    1.6
>>
>> Doesn't apply the required patch that replaces /usr/tmp with /var/tmp
>> This results in 'No such file or directory' error upon the execution.
>>
> That patch should have been removed, but it patches a man page, so I 
> can't see how it can have anything to do with the error you reported.  
> Can you provide some more detail?  What OS version?  What command?  What 
> were you trying to do at the time?
> 
> Paul Schmehl (pauls at utdallas.edu)
> Adjunct Information Security Officer
> University of Texas at Dallas
> AVIEN Founding Member
> http://www.utdallas.edu/ir/security/


More information about the freebsd-ports mailing list