search for: is_reg

Displaying 16 results from an estimated 16 matches for "is_reg".

Did you mean: s_reg
2003 Jan 16
1
Core dump in sftp from CVS
...ion SFTP protocol version 3 sftp> get /bin/ls ./copy.1 sftp> put /bin/ls ./copy.2 Segmentation Fault (core dumped) The cause appears to be sftp-int.c line 508: 506 /* Only one match, dst may be file, directory or unspecified */ 507 if (g.gl_pathv[0] && g.gl_matchc == 1) { 508 if (!is_reg(g.gl_pathv[i])) { ^^^ The variable "i" is uninitialized at this point. The code is the same in OpenBSD and portable. Attached patch passes regression on Solaris 8. -- Darren Tucker (dtucker at zip.com.au) GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69...
2014 Sep 22
2
[PATCH] New APIs: Implement stat calls that return nanosecond timestamps (RHBZ#1144891).
...const struct guestfs_stat *stat, + const struct guestfs_statns *stat, const struct guestfs_xattr_list *xattrs, void *unused) { @@ -476,45 +476,45 @@ show_file (const char *dir, const char *name, /* Display the basic fields. */ output_start_line (); - if (is_reg (stat->mode)) + if (is_reg (stat->st_mode)) filetype = "-"; - else if (is_dir (stat->mode)) + else if (is_dir (stat->st_mode)) filetype = "d"; - else if (is_chr (stat->mode)) + else if (is_chr (stat->st_mode)) filetype = "c"; - el...
2014 Oct 13
0
[PATCH] ls: in CSV mode, always have a checksum field (RHBZ#1151900).
.../ls.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cat/ls.c b/cat/ls.c index de8248e..2cb4e74 100644 --- a/cat/ls.c +++ b/cat/ls.c @@ -524,12 +524,15 @@ show_file (const char *dir, const char *name, path = full_path (dir, name); - if (checksum && is_reg (stat->st_mode)) { - csum = guestfs_checksum (g, checksum, path); - if (!csum) - exit (EXIT_FAILURE); + if (checksum) { + if (is_reg (stat->st_mode)) { + csum = guestfs_checksum (g, checksum, path); + if (!csum) + exit (EXIT_FAILURE); - output_string (csum...
2016 Dec 14
1
Re: [PATCH v2 3/4] sysprep: Add a new operation to remove editor backup files (RHBZ#1401320).
...visit g#ocaml_handle fs ( > + fun dir filename { G.st_mode = mode } _ -> > + match dir, filename, mode with > + (* Ignore root directory and non-regular files. *) > + | _, None, _ -> () > + | _, Some _, mode when not (is_reg mode) -> () > + | dir, Some filename, _ -> > + (* Check the filename against all of the globs, and if it > + * matches any then delete it. > + *) > + let matching glob = fnmatch glob filename [FNM_NOESCAPE] in...
2003 Oct 01
1
3.7.1p2 sftp recurse patch
...s to %s\n", g.gl_pathv[i], abs_dst); - if (do_download(conn, g.gl_pathv[i], abs_dst, pflag) == -1) + if (do_recursive_download(conn, g.gl_pathv[i], abs_dst, pflag) == -1) err = -1; xfree(abs_dst); abs_dst = NULL; @@ -528,7 +634,7 @@ } for (i = 0; g.gl_pathv[i]; i++) { - if (!is_reg(g.gl_pathv[i])) { + if (!is_reg(g.gl_pathv[i]) && !(recursion && is_dir(g.gl_pathv[i]))) { error("skipping non-regular file %s", g.gl_pathv[i]); continue; @@ -557,7 +663,8 @@ abs_dst = make_absolute(tmp, pwd); printf("Uploading %s to %s\n&qu...
2017 Sep 26
5
[PATCH 0/5] Miscellaneous refactoring of common/utils, create common/mltools
Miscellaneous refactoring, but the main one is to rename mllib/ as common/mltools/ Rich.
2016 Dec 14
6
[PATCH v2 0/4] sysprep: Remove various backup files.
In v2: - The backup-files operation now operates on a conservative whitelist of filesystems, so it won't touch anything in /usr. Consequently it also runs much more quickly, about 4 seconds on the barebones virt-builder fedora-25 image. - Call Gc.compact () in visit_tests. - Added documentation to fnmatch.mli.
2016 Dec 14
4
[PATCH 0/4] sysprep: Remove various backup files.
https://bugzilla.redhat.com/show_bug.cgi?id=1401320 This series contains two new operations. The second -- and least controversial -- is "passwd-backups" which removes files such as /etc/passwd-, /etc/shadow- and so on. The first one ("backup-files") searches the whole guest filesystem for any regular file which looks like an editor backup file, such as "*~" and
2016 Dec 14
5
[PATCH v3 0/5] sysprep: Remove various backup files.
v3: - Split out test for "unix-like" guest OSes into separate commit. - Add guestfish --format=qcow2 to the test (x2). Rich.
2015 Jan 02
2
(no subject)
Hi, we needed these changes when we had to build a guest image compatible with a starting guest image but not backed by it in any way? We needed some tool to check our progress, comparing original and? rebuilt (from scratch) images, and virt-diff seemed the best option, but? we had to soften the comparison to reduce the noise in the output. I added some options to ignore certain informations when
2015 Jan 02
0
[PATCH] virt-diff: add additional ignore options
...me_nsec = 0; + xattrs = guestfs_copy_xattr_list (xattrs_orig); + xattrs_copy = guestfs_copy_xattr_list (xattrs_orig); if (xattrs == NULL) { perror ("guestfs_copy_xattr_list"); goto error; } + if (no_compare_xattrs) + xattrs->len = 0; if (checksum && is_reg (stat->st_mode)) { csum = guestfs_checksum (t->g, checksum, path); @@ -534,6 +581,8 @@ visit_entry (const char *dir, const char *name, t->files[i].stat = stat; t->files[i].xattrs = xattrs; t->files[i].csum = csum; + t->files[i].stat_orig = stat_copy; + t->files[...
2016 Dec 14
0
[PATCH v2 3/4] sysprep: Add a new operation to remove editor backup files (RHBZ#1401320).
...ymlinks:false fs then ( + visit g#ocaml_handle fs ( + fun dir filename { G.st_mode = mode } _ -> + match dir, filename, mode with + (* Ignore root directory and non-regular files. *) + | _, None, _ -> () + | _, Some _, mode when not (is_reg mode) -> () + | dir, Some filename, _ -> + (* Check the filename against all of the globs, and if it + * matches any then delete it. + *) + let matching glob = fnmatch glob filename [FNM_NOESCAPE] in + if List....
2015 Jan 06
0
[PATCH] virt-diff: add additional ignore options
...ime_nsec = stat->st_mtime_nsec = stat->st_ctime_nsec = 0; + xattrs = guestfs_copy_xattr_list (xattrs_orig); + xattrs_copy = guestfs_copy_xattr_list (xattrs_orig); if (xattrs == NULL) { perror ("guestfs_copy_xattr_list"); goto error; } - if (checksum && is_reg (stat->st_mode)) { csum = guestfs_checksum (t->g, checksum, path); if (!csum) @@ -534,6 +585,8 @@ visit_entry (const char *dir, const char *name, t->files[i].stat = stat; t->files[i].xattrs = xattrs; t->files[i].csum = csum; + t->files[i].stat_orig = stat_copy;...
2015 Jan 05
2
Re: [PATCH] virt-diff: add additional ignore options
...cts indicates the number of items in the list itself, so I'd avoid resetting it to 0 otherwise this information is lost. Much better to check (no_)compare_xattrs in compare_stats. Even better, if the xattrs comparison is off, then just avoid copying xattrs_orig. > if (checksum && is_reg (stat->st_mode)) { > csum = guestfs_checksum (t->g, checksum, path); > @@ -534,6 +581,8 @@ visit_entry (const char *dir, const char *name, > t->files[i].stat = stat; > t->files[i].xattrs = xattrs; > t->files[i].csum = csum; > + t->files[i].stat_ori...
2018 Oct 01
7
[PATCH v2 API PROPOSAL 0/5] inspection Add network interfaces to inspection data.
The proposed API is the same as v1, but this includes an implementation (for /etc/sysconfig/network-scripts/ifcfg-*) and modifications to virt-inspector. This compiles and works. If you look in patch 5 you can see proposed output as virt-inspector XML for a guest (although this guest has not been booted, so a real guest would hopefully have a hwaddr="MAC" attribute too). Rich.
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...6,7 @@ #include <getopt.h> #include <fcntl.h> #include <errno.h> +#include <error.h> #include <locale.h> #include <assert.h> #include <time.h> @@ -709,20 +710,14 @@ diff (struct file *file1, guestfs_h *g1, struct file *file2, guestfs_h *g2) assert (is_reg (file1->stat->st_mode)); assert (is_reg (file2->stat->st_mode)); - if (asprintf (&tmpd, "%s/virtdiffXXXXXX", tmpdir) < 0) { - perror ("asprintf"); - exit (EXIT_FAILURE); - } - if (mkdtemp (tmpd) == NULL) { - perror ("mkdtemp"); -...