[AVFS] Preload and glibc (and others)

Nicolas George <[email protected]> Mon, 18 Jul 2005 18:02:38 +0200
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
Hi.

I have been interested by AVFS especially by its fully-userland mode using
LD_PRELOAD. Alas, I can see that it does not work with GNU/Linux.

After some experiments, I have understood the reason of the problem: in the
glibc, the open symbol is a weak alias to the __open symbol, and the various
library functions call __open directly (or even __open_nocancel).

I have tried to rebuild the glibc after patching it so that opendir use a
raw open instead of __open(_nocancel), and it appears to work: overloading
the open symbol affects programs using opendir. Furthermore, it can be done
by any user, since it is enough to set the LD_LIBRARY_PATH to the directory
holding the patched libc.

It would require some work, but I think it would be possible to write a
script that patches the glibc so that it can be used with avfs in preload
mode.

What do you think about it?


Second, is anyone working on a SFTP module? The current SSH module is quite
inefficient, since, as far as I can see, it copies the whole files before
granting any access, and it parses ls output, which is not very reliable.
SFTP is a full-featured network protocole running over a SSH link, and
furthermore it is quite well designed. The functions of the protocol are
directly inspired by the Unix filesystem primitives (open, read...) which
make it particullarily well suited for AVFS.

(<URL: http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/ > for
details about the protocol)


Third, I have remarked that chdir lacks some effects under Solaris 8:

$ cd /#avfsstat
$ pwd
/#avfsstat
$ ls
<snip listing of the root directory>
$ ls `pwd`
cache/  copyright  debug  http_proxy  logfile  modules  version

(the same problem occurs for a #ssh: directory, it is not related to
#avfsstat) It is a known issue?

Regards,

-- 
  Nicolas George
signature.asc (application/pgp-signature, 185 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (SunOS)

iD8DBQFC29KdsGPZlzblTJMRAr7xAJ4us9c4a47YRng8/89dr9UYifixwwCgn4Nl
Jlo1foU1bMg7ogsqWpHNkiA=
=ctOP
-----END PGP SIGNATURE-----