summaryrefslogtreecommitdiffstats
path: root/daemon/ls.c
Commit message (Collapse)AuthorAgeFilesLines
* daemon: collect list of called external commandsOlaf Hering2012-08-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | guestfsd calls many different tools. Keeping track of all of them is error prone. This patch introduces a new helper macro to put the command string into its own ELF section: GUESTFSD_EXT_CMD(C_variable, command_name); This syntax makes it still possible to grep for used command names. The actual usage of the collected list could be like this: objcopy -j .guestfsd_ext_cmds -O binary daemon/guestfsd /dev/stdout | tr '\0' '\n' | sort -u The resulting output will be used to tell mkinitrd which programs to copy into the initrd. Signed-off-by: Olaf Hering <olaf@aepfle.de> RWMJ: - Move str_vgchange at request of author. - Fix snprintf call in daemon/debug.c
* guestfs_ls: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-43/+0
|
* New API: ls0 - List files, separated by \0 characters.Richard W.M. Jones2012-08-171-0/+64
| | | | | This API is not especially useful on its own. It will be used to reimplement guestfs_ls to work without protocol limits.
* daemon: Implement a growable strings buffer type.Richard W.M. Jones2012-03-131-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | Previously a lot of daemon code used three variables (a string list, 'int size' and 'int alloc') to track growable strings buffers. This commit implements a simple struct containing the same variables, but using size_t instead of int: struct stringsbuf { char **argv; size_t size; size_t alloc; }; Use it like this: DECLARE_STRINGSBUF (ret); //... if (add_string (&ret, str) == -1) return NULL; //... if (end_stringsbuf (&ret) == -1) return NULL; return ret.argv;
* New API: llz: This runs ls -laZ and is useful for showing SELinux contexts.Richard W.M. Jones2012-02-091-0/+26
|
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* 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'
* Implement 'debug ls' and 'debug ll' commands.Richard Jones2009-08-181-3/+0
| | | | These commands can be used to list files in the appliance.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-8/+2
| | | | | | | | | | 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)/'
* daemon/ls: make do_ll require root, like all the restJim Meyering2009-08-111-7/+10
| | | | | * ls.c (do_ll): Do invoke "NEED_ROOT" here, and add a FIXME to provide a "debug ll" command with the semantics we're removing.
* Make /sysroot path configurable.Richard Jones2009-07-181-4/+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
|
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-2/+2
|
* Implement list-devices and list-partitions.Richard Jones2009-04-061-9/+1
|
* Implementations of 'cat', 'ls', and some cleanups.Richard Jones2009-04-061-6/+51
|
* Implement RString and RStringList return types.Richard Jones2009-04-041-0/+75
- implement 'll' command. - outlines for 'ls' and 'cat' commands.