Update FSF address.
daemon: Don't use ../src path to include generator_protocol.h This file is already hard-linked into the current directory, so the relative path is not required.
daemon: Move 'exists', 'is-file' and 'is-dir' to separate file. This commit is just code movement.
Improved checking, documentation of modes (RHBZ#582901, RHBZ#582929). chmod: Disallow negative mode, document mode affected by umask. mkdir-mode: Disallow negative mode, document that filesystems may interpret the mode in different ways. mknod: Disallow negative mode, document mode affected by umask. umask: Check the range of umask mask value carefully.
daemon: Don't need to prefix error messages with the command name. 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:..)
daemon error handling: recursive_mkdir shouldn't need to set errno.
use STREQ, not strcmp: part 1 git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
New API calls: truncate, truncate_size, mkdir_mode, utimens, lchown. truncate, truncate_size: Used to truncate files to a particular size, or to zero bytes. mkdir_mode: Like mkdir but allows you to also specify the initial permissions for the new directory. utimens: Set timestamp on a file with nanosecond accuracy. lchown: Corresponding to lchown(2) syscall (we already have chown). The implementation is complicated by the fact that we had to add an Int64 parameter type to the generator.
generator.ml: constify do_mkdtemp * daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter. * src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
generator.ml: use new "Pathname" designation 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 uses run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
update all uses of ABS_PATH 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. 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 : $_'
Make /sysroot path configurable. Currently /sysroot is hard-coded throughout the daemon code. This patch turns the path into a variable so that we can change it in future, for example to allow standalone mode to be implemented. This patch was tested by running all the C API tests successfully.
remove trailing blanks
Add mkdtemp command.
In the daemon, change all const char * parameters to char *.
Fix mkdir-p if directory exists (RHBZ#503133).
Added test suite.
New commands: rm rmdir rm-rf mkdir mkdir-p chmod chown