search for: strstr

Displaying 20 results from an estimated 429 matches for "strstr".

2019 Feb 28
1
[PATCH v2] inspect: return osinfo short IDs for recent Windows versions
..._name) + return NULL; + product_variant = guestfs_inspect_get_product_variant (g, root); + if (!product_variant) + return NULL; + + switch (major) { + case 5: + switch (minor) { + case 1: + return safe_strdup (g, "winxp"); + case 2: + if (strstr (product_name, "XP")) + return safe_strdup (g, "winxp"); + else if (strstr (product_name, "R2")) + return safe_strdup (g, "win2k3r2"); + else + return safe_strdup (g, "win2k3"); + } + break; + ca...
2019 Feb 25
1
[PATCH] inspect: return osinfo short IDs for recent Windows versions
..._name) + return NULL; + product_variant = guestfs_inspect_get_product_variant (g, root); + if (!product_variant) + return NULL; + + switch (major) { + case 5: + switch (minor) { + case 1: + return safe_strdup (g, "winxp"); + case 2: + if (strstr (product_name, "XP")) + return safe_strdup (g, "winxp"); + else if (strstr (product_name, "R2")) + return safe_strdup (g, "win2k3r2"); + else + return safe_strdup (g, "win2k3"); + } + break; + ca...
2001 Jul 11
2
[PATCH]: Cygwin: Allow sshd to switch user context without password
...-21,10 +21,14 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.4 2001 #include <fcntl.h> #include <stdlib.h> +#include <sys/utsname.h> #include <sys/vfs.h> #include <windows.h> #define is_winnt (GetVersion() < 0x80000000) +#define ntsec_on(c) ((c) && strstr((c),"ntsec") && !strstr((c),"nontsec")) +#define ntea_on(c) ((c) && strstr((c),"ntea") && !strstr((c),"nontea")) + #if defined(open) && open == binary_open # undef open #endif @@ -61,12 +65,34 @@ int check_nt_auth(int pwd_au...
2012 Jul 16
2
[PATCH V4] NEW API: add new api xfs_info
...tic guestfs_int_xfsinfo * +parse_xfs_info (char **lines) +{ + guestfs_int_xfsinfo *ret; + char *buf, *p; + size_t i; + + ret = calloc (1, sizeof *ret); + if (ret == NULL) { + reply_with_error ("calloc"); + return NULL; + } + + for (i = 0; lines[i] != NULL; ++i) { + if (p = strstr (lines[i], "meta-data=")) { + ret->mntpoint = split_strdup (p + 10); + if (ret->mntpoint == NULL) goto error; + } else if (p = strstr (lines[i], "isize=")) { + buf = split_strdup (p + 6); + if (buf == NULL) goto error; + if (parse_uint32 (&r...
2016 Mar 23
7
[PATCH v4 0/6] tests/qemu: Add program for tracing and analyzing boot times.
v4: - Lots more analysis of the /init script and other parts. - Display a list of the longest to shortest activities. - Rebase on top of current head. Rich.
2011 May 05
2
Looking for equivalent for "strstr"
Friends This is an elementary question. Is there is a built in R function for finding a sub-string in another string? Like strstr in C. I can easily roll my own, but if there is a built in that is one less thing I can do wrong! cheers Worik [[alternative HTML version deleted]]
2015 May 19
4
[PATCH v4 0/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
Patch extracts MSB/LSB info from /bin/file output and passes it as separate parameret from elf_arch. Then it is sent to impl_file_architecture and checked/ Modified magic_for_file to handle regex changes. Now with tests for file_architecture. Fixes: RHBZ#1211996 Maros Zatko (2): inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996) tests: ppc64 and ppc64le for file_architecture
2015 May 19
0
[PATCH v4 1/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
...ic char * -canonical_elf_arch (guestfs_h *g, const char *elf_arch) +canonical_elf_arch (guestfs_h *g, const char *endianness, const char *elf_arch) { const char *r; char *ret; @@ -85,8 +85,12 @@ canonical_elf_arch (guestfs_h *g, const char *elf_arch) r = "sparc64"; else if (strstr (elf_arch, "IA-64")) r = "ia64"; - else if (match (g, elf_arch, re_elf_ppc64)) - r = "ppc64"; + else if (match (g, elf_arch, re_elf_ppc64)) { + if (strstr (endianness, "MSB")) + r = "ppc64"; + else if (strstr (endianness, "...
2016 Mar 19
1
[PATCH] tests/qemu: Add program for tracing and analyzing boot times.
...UESTFS_EVENT_CLOSE); + + /* Find where we invoke supermin --build. This should be a null + * operation, but it still takes time to run the external command. + */ + FIND ("supermin:build", 0, + data->events[j].source == GUESTFS_EVENT_LIBRARY && + strstr (data->events[j].message, + "begin building supermin appliance"), + data->events[k].source == GUESTFS_EVENT_LIBRARY && + strstr (data->events[k].message, + "finished building supermin appliance")); + + /* Fi...
2015 May 22
0
[PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
...ic char * -canonical_elf_arch (guestfs_h *g, const char *elf_arch) +canonical_elf_arch (guestfs_h *g, const char *endianness, const char *elf_arch) { const char *r; char *ret; @@ -85,8 +85,16 @@ canonical_elf_arch (guestfs_h *g, const char *elf_arch) r = "sparc64"; else if (strstr (elf_arch, "IA-64")) r = "ia64"; - else if (match (g, elf_arch, re_elf_ppc64)) - r = "ppc64"; + else if (match (g, elf_arch, re_elf_ppc64)) { + if (strstr (endianness, "MSB")) + r = "ppc64"; + else if (strstr (endianness, "...
2016 Jan 25
1
[PATCH] btrfs_subvolume_show: fix root/toplevel check w/ btrfs-progs >= 4.4
...@@ do_btrfs_subvolume_show (const char *subvolume) } /* If the path is the btrfs root, `btrfs subvolume show' reports: - * <path> is btrfs root + * <path> is btrfs root [in btrfs-progs < 4.4] + * <path> is toplevel subvolume */ - if (out && strstr (out, "is btrfs root") != NULL) { + if (out && + (strstr (out, "is btrfs root") != NULL || + strstr (out, "is toplevel subvolume") != NULL)) { reply_with_error ("%s is btrfs root", subvolume); return NULL; } -- 2.5.0
2017 Jul 14
0
[PATCH 12/27] daemon: Reimplement ‘file_architecture’ API in OCaml.
...; command on ELF files to the canonical - * architecture string. Caller must free the result. - */ -static char * -canonical_elf_arch (guestfs_h *g, - const char *bits, const char *endianness, - const char *elf_arch) -{ - const char *r; - char *ret; - - if (strstr (elf_arch, "Intel 80386") || - strstr (elf_arch, "Intel 80486")) - r = "i386"; - else if (strstr (elf_arch, "x86-64") || - strstr (elf_arch, "AMD x86-64")) - r = "x86_64"; - else if (strstr (elf_arch, "SPARC32&q...
2016 Jul 11
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...rom include/linux/uuid.h:19, from include/linux/mod_devicetable.h:12, from scripts/mod/devicetable-offsets.c:2: include/linux/dynamic_debug.h: In function ‘ddebug_dyndbg_module_param_cb’: include/linux/dynamic_debug.h:122:2: error: implicit declaration of function ‘strstr’ [-Werror=implicit-function-declaration] if (strstr(param, "dyndbg")) { ^ include/linux/dynamic_debug.h:122:6: warning: incompatible implicit declaration of built-in function ‘strstr’ [enabled by default] if (strstr(param, "dyndbg")) { ^ Since kernel.h is referencing...
2015 Oct 19
5
Re: [PATCH 1/2] New API: vfs_min_size
...r (i = 0; lines[i] != NULL; ++i) > + fprintf (stderr, "ntfs_min_size: lines[%zu] = \"%s\"\n", i, lines[i]); > + } > + > + if (r == -1) { > + /* If volume is full, ntfsresize returns error. */ > + for (i = 0; lines[i] != NULL; ++i) { > + if (strstr (lines[i], full_pattern)) Better use STRPREFIX here, which is what we use all around libguestfs. > + is_full = 1; > + else if ((p = strstr (lines[i], cluster_size_pattern))) { > + if (sscanf (p + strlen(cluster_size_pattern), > + "%*[ ]:%&quo...
2015 May 22
2
[PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
Patch extracts MSB/LSB info from /bin/file output and passes it as separate parameret from elf_arch. Then it is sent to impl_file_architecture and checked/ Modified magic_for_file to handle regex changes. Now with tests for file_architecture, and error reporting for unknown endianness. Fixes: RHBZ#1211996 Maros Zatko (1): inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
2016 Jul 13
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...n 11/07/16 23:46, Markus Mayer wrote: > > Hi Markus, > > Amazing. I see this happening as well, but I know it shouldn't. > > The reason the #ifndef guards in headers are there is precisely to allow > circular dependencies. > > The problem in your output reads as: > strstr() is in string.h > #include string.h -> that includes kernel.h -> that includes string.h > > The third should do nothing based on _LINUX_STRING_H_ being defined already > and all code inside the #ifndef in string.h not being executed. > Yet it shouldn't block the first incl...
2006 Sep 01
0
[PATCH] Cygwin: Avoid implicit declaration warnings
...N +#if defined(open) && open == binary_open +# undef open +#endif +#if defined(pipe) && open == binary_pipe +# undef pipe +#endif + #include <sys/types.h> #include <sys/stat.h> #include <sys/utsname.h> @@ -47,13 +54,6 @@ #define ntsec_on(c) ((c) && strstr((c),"ntsec") && !strstr((c),"nontsec")) #define ntsec_off(c) ((c) && strstr((c),"nontsec")) #define ntea_on(c) ((c) && strstr((c),"ntea") && !strstr((c),"nontea")) - -#if defined(open) && open == binar...
2017 Mar 05
0
[PATCH] Fix recognition of keeppxe option
....000000000 -0700 > @@ -48,14 +48,6 @@ int new_linux_kernel(char *okernel, char > > sprintf(cmdline, "BOOT_IMAGE=%s %s", kernel_name, args); > > - /* "keeppxe" handling */ > -#if IS_PXELINUX > - extern char KeepPXE; > - > - if (strstr(cmdline, "keeppxe")) > - KeepPXE |= 1; > -#endif > - > if (strstr(cmdline, "quiet")) > opt_quiet = true; > > --- syslinux-6.04-pre1.orig/com32/lib/syslinux/load_linux.c 2016-03-01 21:06:02.000000000 -0800 > +++ sy...
2002 Jul 31
0
[PATCH]: Match Cygwin version check to reality
...in_util.c --- openbsd-compat/bsd-cygwin_util.c 15 Apr 2002 22:00:52 -0000 1.8 +++ openbsd-compat/bsd-cygwin_util.c 31 Jul 2002 09:47:29 -0000 @@ -43,6 +43,7 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.8 2002 #define is_winnt (GetVersion() < 0x80000000) #define ntsec_on(c) ((c) && strstr((c),"ntsec") && !strstr((c),"nontsec")) +#define ntsec_off(c) ((c) && strstr((c),"nontsec")) #define ntea_on(c) ((c) && strstr((c),"ntea") && !strstr((c),"nontea")) #if defined(open) && open == binary_open...
2016 Jun 10
4
[PATCH] Fix recognition of keeppxe option
...inux-6.04-pre1/com32/elflink/ldlinux/kernel.c 2016-06-08 20:08:43.000000000 -0700 @@ -48,14 +48,6 @@ int new_linux_kernel(char *okernel, char sprintf(cmdline, "BOOT_IMAGE=%s %s", kernel_name, args); - /* "keeppxe" handling */ -#if IS_PXELINUX - extern char KeepPXE; - - if (strstr(cmdline, "keeppxe")) - KeepPXE |= 1; -#endif - if (strstr(cmdline, "quiet")) opt_quiet = true; --- syslinux-6.04-pre1.orig/com32/lib/syslinux/load_linux.c 2016-03-01 21:06:02.000000000 -0800 +++ syslinux-6.04-pre1/com32/lib/syslinux/load_linux.c 2016-06-08 20:08:48.00000...