summaryrefslogtreecommitdiffstats
path: root/daemon/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Improved checking, documentation of modes (RHBZ#582901, RHBZ#582929).Richard Jones2010-04-171-0/+5
| | | | | | | | | | | 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.Richard Jones2010-02-121-8/+8
| | | | | | | | | | | | | | | | | | | | 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.Richard Jones2009-12-071-5/+11
|
* 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: truncate, truncate_size, mkdir_mode, utimens, lchown.Richard Jones2009-11-021-0/+17
| | | | | | | | | | | | | | | 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_mkdtempJim Meyering2009-08-131-17/+8
| | | | | * 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" designationJim Meyering2009-08-131-20/+5
| | | | | | | | | | 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-6/+6
| | | | | | 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-6/+6
| | | | | | 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-2/+2
| | | | | | | | | | | 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.Richard Jones2009-07-181-5/+2
| | | | | | | | | 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 blanksJim Meyering2009-07-031-1/+1
|
* Add mkdtemp command.Richard W.M. Jones2009-06-241-0/+30
|
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-5/+5
|
* Fix mkdir-p if directory exists (RHBZ#503133).Richard W.M. Jones2009-05-291-0/+11
|
* Added test suite.Richard Jones2009-04-111-1/+26
|
* New commands: rm rmdir rm-rf mkdir mkdir-p chmod chownRichard Jones2009-04-101-0/+167