summaryrefslogtreecommitdiffstats
path: root/daemon/xattr.c
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-11/+11
| | | | | | | | | | | | | | | | | | | | The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
* availability: Add optional groups and implement guestfs_available call.Richard Jones2009-11-201-21/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current groups are defined very conservatively using the following criteria: (a) Would be impossible to implement on Windows because of sheer architectural differences (eg: mknod). (b) Already optional (augeas, inotify). (c) Not currently optional but not implemented on older RHEL and Debian releases (ntfs-3g.probe, scrub, zerofree). The optional groups I've defined according to these criteria are: . augeas . inotify . linuxfsuuid . linuxmodules . linuxxattrs . lvm2 . mknod . ntfs3g . scrub . selinux . zerofree (Note that these choices don't prevent us from adding more optional groups in future. On the other hand to avoid breaking ABIs we would not wish to change the above groups). The rest of this large commit is really just implementation: Each optional function is classified using Optional "group" flag in the generator. The daemon has to implement a function int optgroup_<name>_available (void); for each optional group. Some of these functions are fixed at compile time, and some do simple run-time tests. The do_available implementation in the daemon looks up the correct function in a table and runs it. We document the optional groups in the guestfs(3) man page. Also: I added a NOT_AVAILABLE macro in order to unify all the existing places where we had a message equivalent to "function __func__ is not available".
* use STREQ, not strcmp: part 2Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strcmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *!= *0\b/STRNEQ$1/g'
* use STREQ, not strcmp: part 1Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* New API calls: lstatlist, lxattrlist, readlinklist.Richard Jones2009-11-021-0/+205
| | | | | | | | These three functions are very specifically designed for FUSE support, so we can list directories efficiently. Instead of making lots of lstat, lgetxattr and readlink calls, we can make just three calls per directory to grab all the attributes (which we then cache briefly).
* xattr.c: avoid warning about comparison between signed and unsignedJim Meyering2009-08-171-4/+6
| | | | * daemon/xattr.c (getxattrs): Use an unsigned index.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-21/+18
| | | | | | | | | | Nearly every file-related function in daemons/*.c is affected: Remove this pair of statements from each affected do_* function: - NEED_ROOT (return -1); - ABS_PATH (dir, return -1); and change the type of the corresponding parameter to "const char *". * src/generator.ml: Emit NEED_ROOT just once, even when there are two or more Pathname args.
* update all NEED_ROOT usesJim Meyering2009-08-131-1/+1
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* update all uses of ABS_PATHJim Meyering2009-08-131-1/+1
| | | | | | run this command: git grep -l -w ABS_PATH|xargs perl -pi -e \ 's/(?:ABS_PATH)( \(.*?,) (.*?)\)/ABS_PATH$1 return $2)/'
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-11/+11
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* RHEL 5: header was called <sys/xattr.h>Richard W.M. Jones2009-07-141-2/+9
|
* Fix: daemon/xattr.c can now compile even when no xattr support.Richard W.M. Jones2009-07-141-3/+3
|
* Support for Linux extended attributes.Richard W.M. Jones2009-07-141-0/+284
This commit adds six calls to support Linux extended attributes. They are: getxattrs list all extended attributes for a file or directory setxattr add/replace an extended attribute removexattr remove an extended attribute lgetxattrs \ lsetxattr (same as above, but operate on symbolic links) lremovexattr / See attr(5) for more information. This also adds support for the FBuffer field type, which maps to an XDR opaque<> or a C (int, char *) pair.