search for: c_isdigit

Displaying 20 results from an estimated 54 matches for "c_isdigit".

Did you mean: i_isdigit
2017 Feb 22
1
[PATCH] inspect: ignore /dev/cdN devices in /etc/fstab
...diff --git a/lib/inspect-fs-unix.c b/lib/inspect-fs-unix.c index 7e940d6..9b6bfbf 100644 --- a/lib/inspect-fs-unix.c +++ b/lib/inspect-fs-unix.c @@ -1305,6 +1305,7 @@ check_fstab (guestfs_h *g, struct inspect_fs *fs) * discs. */ if ((STRPREFIX (spec, "/dev/fd") && c_isdigit (spec[7])) || + (STRPREFIX (spec, "/dev/cd") && c_isdigit (spec[7])) || STREQ (spec, "/dev/floppy") || STREQ (spec, "/dev/cdrom") || STRPREFIX (spec, "/dev/iso9660/")) -- 2.9.3
2017 Aug 31
2
The issue about code coverage for libguestfs
...ge unix -linkpkg \ -warn-error A -I .. mlguestfs.cmxa debug_logging.ml -o debug_logging ../libmlguestfs.a(libguestfsocaml_a-utils.o): In function `guestfs_int_string_is_valid': utils.c:(.text+0xb99): undefined reference to `c_isalpha' utils.c:(.text+0xbbf): undefined reference to `c_isdigit' collect2: error: ld returned 1 exit status File "caml_startup", line 1: Error: Error during linking make[2]: *** [debug_logging] Error 2 make[2]: *** Waiting for unfinished jobs.... ../libmlguestfs.a(libguestfsocaml_a-utils.o): In function `guestfs_int_string_is_valid': utils.c:(...
2016 Jul 25
1
[PATCH] osinfo: parse also single-digit version numbers
...struct osinfo *osinfo) CLEANUP_FREE char *content = NULL; content = (char *) xmlNodeGetContent (node); - if (content) { + /* We parse either "X.Y" or "X" as version strings, so try to parse + * only if the first character is a digit. + */ + if (content && c_isdigit (content[0])) { struct version version; - int res = guestfs_int_version_from_x_y (g, &version, content); + int res = guestfs_int_version_from_x_y_or_x (g, &version, content); if (res < 0) return -1; else if (res > 0) { -- 2.7.4
2017 Sep 01
2
Re: The issue about code coverage for libguestfs
...ild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml/Makefile > > > ../libmlguestfs.a(libguestfsocaml_a-utils.o): In function > > `guestfs_int_string_is_valid': > > utils.c:(.text+0xb99): undefined reference to `c_isalpha' > > utils.c:(.text+0xbbf): undefined reference to `c_isdigit' > > I suppose that we need to link the OCaml bindings to -lgnu, which > your patch attempts: > > > +libguestfsocaml_a_LIBADD = \ > > + $(top_builddir)/gnulib/lib/libgnu.la > > + > > ... but the problem is that libguestfsocaml.a isn't really used for &...
2017 Jan 19
3
[PATCH 1/2] daemon: Fix part-to-dev when the partition name includes p<N>.
From: Pino Toscano <ptoscano@redhat.com> If the device name ends with a number, Linux uses partition names of the form <device>p<N>. Handle this case by knocking off the 'p' character. --- daemon/devsparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 5862ae2..b764f63 100644 --- a/daemon/devsparts.c +++
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...N (d->d_name, "hd", 2) || - STREQLEN (d->d_name, "ubd", 3) || - STREQLEN (d->d_name, "vd", 2) || - STREQLEN (d->d_name, "sr", 2) || - (return_md && - STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { - CLEANUP_FREE char *dev_path = NULL; - if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) { - reply_with_perror ("asprintf"); - closedir (dir); - return NULL; - } - - /* Ignore the root device. */ - i...
2017 Jan 19
0
[PATCH 2/2] daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510).
...N (d->d_name, "ubd", 3) || STREQLEN (d->d_name, "vd", 2) || - STREQLEN (d->d_name, "sr", 2)) { + STREQLEN (d->d_name, "sr", 2) || + (return_md && + STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); /* Ignore the root device. */ @@ -131,7 +134,12 @@ add_device (const char *device, struct stringsbuf *r) char ** do_list_devices (void) { - return foreach_block_device (add_device); +...
2017 Aug 31
0
Re: The issue about code coverage for libguestfs
.../CFLAGS = /g' /home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml/Makefile > ../libmlguestfs.a(libguestfsocaml_a-utils.o): In function `guestfs_int_string_is_valid': > utils.c:(.text+0xb99): undefined reference to `c_isalpha' > utils.c:(.text+0xbbf): undefined reference to `c_isdigit' I suppose that we need to link the OCaml bindings to -lgnu, which your patch attempts: > +libguestfsocaml_a_LIBADD = \ > + $(top_builddir)/gnulib/lib/libgnu.la > + ... but the problem is that libguestfsocaml.a isn't really used for anything. See the comment in the same Makefil...
2010 Apr 03
1
hivex: Exported foreign symbols in libhivex.so.0.0.0
...tion names, whereas it should only be exporting hivex_* function names. This page may help with this: http://gcc.gnu.org/wiki/Visibility Symbols: asnprintf at Base 1.2.1 c_isalnum at Base 1.2.1 c_isalpha at Base 1.2.1 c_isascii at Base 1.2.1 c_isblank at Base 1.2.1 c_iscntrl at Base 1.2.1 c_isdigit at Base 1.2.1 c_isgraph at Base 1.2.1 c_islower at Base 1.2.1 c_isprint at Base 1.2.1 c_ispunct at Base 1.2.1 c_isspace at Base 1.2.1 c_isupper at Base 1.2.1 c_isxdigit at Base 1.2.1 c_tolower at Base 1.2.1 c_toupper at Base 1.2.1 exit_failure at Base 1.2.1 full_read at Base 1.2.1 full_...
2015 Mar 16
0
[PATCH] inspection: add support for systemd .mount files
...g_get (g, augpath); + if (spec == NULL) + return -1; + + /* Ignore /dev/fd (floppy disks) (RHBZ#642929) and CD-ROM drives. + * + * /dev/iso9660/FREEBSD_INSTALL can be found in FreeBSDs installation + * discs. + */ + if ((STRPREFIX (spec, "/dev/fd") && c_isdigit (spec[7])) || + STREQ (spec, "/dev/floppy") || + STREQ (spec, "/dev/cdrom") || + STRPREFIX (spec, "/dev/iso9660/")) + continue; + + snprintf (augpath, sizeof augpath, "%s/Mount/Where/value", *entry); + mp = guestfs_aug_get (g,...
2015 Mar 16
2
[PATCH] RFE: Inspection should support systemd mount units
Adds support for systemd .mount files, uses Augeas to extract mount points. Fixes RHBZ#1113153. Maros Zatko (1): inspection: add support for systemd .mount files src/inspect-fs-unix.c | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) -- 1.9.3
2014 Aug 26
6
[PATCH 0/3] fix setting lvm filter with newer lvm2
Hi, newer lvm2 releases don't have have uncommented "filter" lines, so the current way to edit lvm.conf doesn't work anymore. Instead, switch to augeas (with a "custom" len) for a cleaner and working way to set the lvm filter. Pino Toscano (3): daemon: add add_sprintf daemon: move AUGEAS_ERROR to the common header daemon: lvm-filter: use augeas for setting the
2017 Feb 14
0
[PATCH 2/2] GCC 7: Allocate sufficient space for sprintf output.
...ev_path[256]; int fd; dir = opendir ("/sys/block"); @@ -64,7 +63,12 @@ foreach_block_device (block_dev_func_t func, bool return_md) STREQLEN (d->d_name, "sr", 2) || (return_md && STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { - snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); + CLEANUP_FREE char *dev_path; + if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) { + reply_with_perror ("asprintf"); + closedir (dir); +...
2013 Nov 28
3
[PATCH 1/3] inspect: recognise Debian live images as such
Check for filesystem.squashfs also in /live, since it is where live-build places it. --- src/inspect-fs-cd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/inspect-fs-cd.c b/src/inspect-fs-cd.c index 407e4f8..eaeaa6f 100644 --- a/src/inspect-fs-cd.c +++ b/src/inspect-fs-cd.c @@ -429,7 +429,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs) *
2017 Feb 14
0
[PATCH v2 2/2] GCC 7: Allocate sufficient space for sprintf output.
...ev_path[256]; int fd; dir = opendir ("/sys/block"); @@ -64,7 +63,12 @@ foreach_block_device (block_dev_func_t func, bool return_md) STREQLEN (d->d_name, "sr", 2) || (return_md && STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { - snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); + CLEANUP_FREE char *dev_path; + if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) { + reply_with_perror ("asprintf"); + closedir (dir); +...
2020 Feb 20
0
[PATCH] daemon: Translate device names if Linux device ordering is unstable (RHBZ#1804207).
...ok it up in the cache, and if found return the canonical name. + * If not found return a copy of the original string. + */ + for (i = 0; i < cache_size; ++i) { + const size_t len = strlen (cache[i]); + + if (STREQ (device, cache[i]) || + (STRPREFIX (device, cache[i]) && c_isdigit (device[len]))) { + if (asprintf (&ret, "%s%s", cache[i], &device[len]) == -1) { + reply_with_perror ("asprintf"); + return NULL; + } + break; + } + } - /* Currently a no-op. */ - ret = strdup (device); if (ret == NULL) { - repl...
2016 Dec 24
0
[PATCH] lib: Use a common function to validate strings.
...+ + if ((min_length > 0 && len < min_length) || + (max_length < SIZE_MAX && len > max_length)) + return false; + + for (i = 0; i < len; ++i) { + bool valid_char; + + valid_char = + (alpha && c_isalpha (str[i])) || + (digit && c_isdigit (str[i])) || + (extra && strchr (extra, str[i])); + + if (!valid_char) return false; + } + + return true; +} + #if 0 /* not used yet */ /** * Hint that we will read or write the file descriptor normally. -- 2.9.3
2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...mlNodePtr node, struct osinfo *osinfo) +{ + CLEANUP_FREE char *content = NULL; + + content = (char *) xmlNodeGetContent (node); + /* We parse either "X.Y" or "X" as version strings, so try to parse + * only if the first character is a digit. + */ + if (content && c_isdigit (content[0])) { + struct version version; + const int res = guestfs_int_version_from_x_y_or_x (g, &version, content); + if (res < 0) + return -1; + else if (res > 0) { + osinfo->major_version = version.v_major; + osinfo->minor_version = version.v_minor; +...
2017 Feb 10
0
[PATCH v3 05/10] lib: extract osinfo DB traversing API
...mlNodePtr node, struct osinfo *osinfo) +{ + CLEANUP_FREE char *content = NULL; + + content = (char *) xmlNodeGetContent (node); + /* We parse either "X.Y" or "X" as version strings, so try to parse + * only if the first character is a digit. + */ + if (content && c_isdigit (content[0])) { + struct version version; + const int res = guestfs_int_version_from_x_y_or_x (g, &version, content); + if (res < 0) + return -1; + else if (res > 0) { + osinfo->major_version = version.v_major; + osinfo->minor_version = version.v_minor; +...
2017 Jun 19
0
[PATCH v7 2/9] lib: extract osinfo DB traversing API
...mlNodePtr node, struct osinfo *osinfo) +{ + CLEANUP_FREE char *content = NULL; + + content = (char *) xmlNodeGetContent (node); + /* We parse either "X.Y" or "X" as version strings, so try to parse + * only if the first character is a digit. + */ + if (content && c_isdigit (content[0])) { + struct version version; + const int res = guestfs_int_version_from_x_y_or_x (g, &version, content); + if (res < 0) + return -1; + else if (res > 0) { + osinfo->major_version = version.v_major; + osinfo->minor_version = version.v_minor; +...