More improvments of the sqlfs code and the command line interface:
-
read rights are not checks in each traversed directory (via sql in a
single query to locate the path)
-
diropen additionally checks for execute rights
-
fopen checks for read or write depending on the mode
-
chmod, chgrp, chown methods in sqlfs and egw_vfs/vfs plus an
egw_vfs::$is_root var used to grant root rights (no access controll and
chown or chgrp without being the owner of a file)
-
find method (some more params to come) to recursivly search and
optionaly execute some callback
-
egw_vfs::remove doing a “rm -r” / recursive remove or dirs and files
-
new files or dirs inherit the perms and ownership from the parent
directory (no umask)
-
files/dirs the user has no read rights, in a directory where he has no
write rights, get hidden (eg. not showing all the other users / groups
home dirs
-
many new cli commands (chmod, chgrp, chown, find), recursive option
for most commands and the ability to use it with root rights, see the
usage message if called without options
-
“cp -r -p” to copy a whole tree incl. ownership and perms, eg. backing
up /home to /backup
Just to elaborate on the last point, if you have a ldap based system,
where the eGW accounts and groups are also system accounts, you can use
ls.php --cp -r -p vfs://root_user:pass@default/home /backup
to copy the whole user and groups dir (incl. perms) somewhere in the
filesystem.
An other thing you can do now is to create arbitrary directories with
permissions to allow users to save stuff in an own structure.
The next steps will be:
- creating the home dirs via hooks, like with the old system
- probably renaming ls.php to cli.php as it does now far more then ls
- and than either:
a) starting directly with a UI or
b) creating an emulation layer allowing to use the new system via an
identical interface like to old one
I rather like to go with a), as b) might have a quicker result, but it’s
just wasted time.
I keep you posted …
Ralf
Ralf Becker schrieb:
I want to give a short overview about the current status of my work on
eGW’s VFS classes:
As we agreed on the developer meeting in Kibo, I implemented the new vfs
as stream wrappers
(http://www.php.net/manual/en/function.stream-wrapper-register.php).
That means we register a new protocol/scheme ‘vfs’ and you can access
eGW’s VFS using URL’s with that scheme, eg. vfs://default/home/ralf/file
After the protocoll get’s registered, you can use that url’s with any
php stream function or you can use the static methods of the new egw_vfs
class:
http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/class.egw_vfs.inc.php?view=markup
The vfs stream-wrapper itself uses a kind of /etc/fstab to mount several
backends into eGW’s vfs. In the most simple case currently used by
default, the root of the old vfs into the root of the new one:
/ => 'oldvfs://default/
As a prove of concept I implemented a oldvfs steam-wrapper, which uses
the existing vfs class to access eGW’s vfs. It only bypasses the stream
routines, to directly fopen the file in the filesystem, to eg. allow to
write huge files in junks.
You can try out all sorts of operations with the command line client
filemangager/ls.php. Call it without parameters for a usage message. If
you use a path without protocoll, it uses the filesystem of the server.
To access the vfs you either need to use:
- oldvfs://user:password@domain/home/user/file
- vfs://user:password@domain/home/user/file
To copy eg. a cd image into your vfs home directory:
filemanager/ls.php -cp /path/to/cd.iso vfs://user:pass@domain/home/user
This works without a huge memory limit, as it copies in 8k junks.
My next steps will be:
- rework the current WebDAV class to use the new stream wrappers
- write a stream-wrapper to directly access (a modernized) version of
the vfs
- start with UI
- write a streamwrapper accessing a samba server, to use it for the homedirs
I will at first not enable the new stuff by default, as already many
people using trunk and I dont want to break their installations. So I
will post here, what you have to do to use test the new code.
Ralf
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers