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

Bug#650284: fte: Directory view is broken

Package: fte
Version: 0.50.2b6-1
Severity: important
Tags: upstream

Dear Maintainer,

In the latest version of fte (0.50.2b6-1) the directory view is broken. The
file permissions are messed up and the date is shown as 1 Jan 1970 02:00 for
all files. The directories are also shown as normal files making it very
difficult to navigate the directory tree (in previous versions directories we
shown in bold before the files and with a slash at the end of their name).

This problem appears on 32 bit systems and seems to be caused by the fact that
off_t is interpreted differently depending in which source file you are. I just
printed sizeof(off_t) in FileFind::FindNext in s_direct.cpp and it has size 4
and then I printed it in EDirectory::RescanList in o_directory.cpp (which calls
FindNext) and there the size is 8. The end result is that the attribute members
of the FileInfo class are shifted by 4 bytes on 32 bit platforms and the values
for type, mtime and mode are reading the wrong memory addresses.

I recompiled version 0.50.2-1 and there it works fine, so I'm not sure what led
to this situation, probably the addition of #include <time.h> or #include
<stdio.h> at the beginning of o_directory.cpp which may give off_t a diferent
meaning than that given by #include <sys/types.h> from s_direct.h. Now I have
no idea why off_t would be interpreted differently depending which header file
you include first, but that seems to be the case. Maybe this is also a bug in
the standard header files, I don't know.

In order to fix this, I changed off_t to off64_t on s_direct.h and the problem
went away, however I did not include a patch with this bug report as I'm not
sure if this is a cross platform solution and it's possible the upstream author
may come up with a different solution.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/bash

Versions of packages fte depends on:
ii  libc6       2.13-21  
ii  libgcc1     1:4.6.2-5
ii  libstdc++6  4.6.2-5  

Versions of packages fte recommends:
ii  fte-console   0.50.2b6-1
ii  fte-terminal  0.50.2b6-1
ii  fte-xwindow   0.50.2b6-1

Versions of packages fte suggests:
ii  exuberant-ctags  1:5.9~svn20110310-3
ii  fte-docs         0.50.2b6-1         

-- no debconf information

Reply to: