search for: string_match

Displaying 20 results from an estimated 144 matches for "string_match".

2017 Sep 21
18
[PATCH v2 00/18] Replace many more uses of the Str module with PCRE.
v1 was here: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html This is a more complete evolution of the earlier patch. It replaces most important uses of Str with PCRE throughout the code. It also extends the bindings with some useful features like case-insensitive regexps. The main places I *didn't* touch are the generator (GObject uses Str extensively); and
2016 Jun 03
1
[PATCH] v2v: recognize Virtuozzo tools as Parallels tools
...62bb536..49811a7 100644 --- a/v2v/convert_windows.ml +++ b/v2v/convert_windows.ml @@ -183,7 +183,7 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = raise Not_found; let dispname = g#hivex_value_utf8 valueh in - if not (Str.string_match (Str.regexp ".*Parallels Tools.*") + if not (Str.string_match (Str.regexp ".*\\(Parallels\\|Virtuozzo\\) Tools.*") dispname 0) then raise Not_found; -- 2.5.5
2002 Sep 09
0
Problems using netgroups
...p the full hostname or ip-address but there is only an entry for the short hostname in my nis-database. Example of the smb log-file: --------/var/log/smb [2002/09/09 20:11:01, 3] lib/access.c:check_access(313) check_access: hostnames in host allow/deny list. [2002/09/09 20:11:01, 5] lib/access.c:string_match(87) looking for 141.21.7.54 of domain fzi in netgroup hosts-ids gave No [2002/09/09 20:11:01, 5] lib/access.c:string_match(87) looking for horch.fzi.de of domain fzi in netgroup hosts-ids gave No [2002/09/09 20:11:01, 5] lib/access.c:string_match(87) looking for 141.21.7.54 of domain fzi in n...
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html v2: https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html v3 is almost identical to v2, but I have added 4 extra commits to almost finish the job of replacing Str everywhere possible (note it's not possible to replace Str in common/mlstdutils or the generator because those are pure OCaml). As
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...rnel_under_grub_prefix) in + let paths = Array.to_list paths in + if paths = [] then + error (f_"didn't find grub entry for kernel %s") vmlinuz; + let path = List.hd paths in + let rex = Str.regexp ".*/title\\[\\([1-9][0-9]*\\)\\]/kernel" in + if not (Str.string_match rex path 0) then + error (f_"internal error: regular expression did not match '%s'") + path; + let index = int_of_string (Str.matched_group 1 path) - 1 in + g#aug_set (sprintf "/files%s/default" grub_config) (string_of_int index); + g#aug_save () + +...
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...ernel_under_grub_prefix) in + let paths = Array.to_list paths in + if paths = [] then + error (f_"didn't find grub entry for kernel %s") kernel; + let path = List.hd paths in + let rex = Str.regexp ".*/title\\[\\([1-9][0-9]*\\)\\]/kernel" in + if not (Str.string_match rex path 0) then + error (f_"internal error: regular expression did not match '%s'") + path; + let index = int_of_string (Str.matched_group 1 path) - 1 in + g#aug_set (sprintf "/files%s/default" grub_config) (string_of_int index); + g#aug_save () + +...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
...; + let paths = Array.to_list paths in > + if paths = [] then > + error (f_"didn't find grub entry for kernel %s") vmlinuz; > + let path = List.hd paths in > + let rex = Str.regexp ".*/title\\[\\([1-9][0-9]*\\)\\]/kernel" in > + if not (Str.string_match rex path 0) then > + error (f_"internal error: regular expression did not match '%s'") > + path; > + let index = int_of_string (Str.matched_group 1 path) - 1 in > + g#aug_set (sprintf "/files%s/default" grub_config) (string_of_int index); &g...
2017 Aug 01
0
[PATCH v2 3/3] daemon: Restore PCRE regular expressions in OCaml code.
...\\s" ^ + "path\\s(.*)") let btrfs_subvolume_list mountable = (* Execute 'btrfs subvolume list <fs>', and split the output into lines *) @@ -103,10 +103,10 @@ let btrfs_subvolume_list mountable = *) List.map ( fun line -> - if Str.string_match re_btrfs_subvolume_list line 0 then ( - let id = Int64.of_string (Str.matched_group 1 line) - and top_level_id = Int64.of_string (Str.matched_group 2 line) - and path = Str.matched_group 3 line in + if PCRE.matches re_btrfs_subvolume_list line then ( + let id = Int6...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...) @ - Array.to_list (g#glob_expand "/boot/vmlinuz-*") @ - Array.to_list (g#glob_expand "/vmlinuz-*") in - let rex = Str.regexp ".*\\.\\(dpkg-.*|rpmsave|rpmnew\\)$" in - let vmlinuzes = List.filter ( - fun file -> not (Str.string_match rex file 0) - ) vmlinuzes in - vmlinuzes in + let vmlinuzes = bootloader#list_kernels () in (* Map these to installed kernels. *) filter_map ( @@ -396,21 +279,8 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps = (* Conversion step. *)...
2001 Apr 18
3
samba 2.2.0: host access by netgroup
Hi, I am just fiddeling with 2.2.0 final. I am having trouble with the config files I used with 2.2.0alpha3: check_access: no hostnames in host allow/deny list. [2001/04/18 12:33:37, 3] smbd/server.c:exit_server(473) Server exit (connection denied) [2001/04/18 12:33:37, 5] lib/access.c:string_match(89) looking for 131.234.166.51 of domain hni in netgroup hni_hosts gave No [2001/04/18 12:33:37, 0] lib/access.c:check_access(324) Denied connection from (131.234.166.51) [2001/04/18 12:33:37, 1] smbd/process.c:process_smb(824) Connection denied from 131.234.166.51 But testparm says it shou...
2016 Sep 09
0
[PATCH] v2v: linux: Move kernel detection to a separate module.
...overed by the RPM file list, this is basically - * guesswork. - *) - let initrd = - let files = g#ls "/boot" in - let files = Array.to_list files in - let files = - List.filter (fun n -> Str.string_match rex_initrd n 0) files in - let files = - List.filter ( - fun n -> - String.find n version >= 0 - ) files in - (* Don't consider kdump initramfs images (RHBZ#1138184). *) - let f...
2017 Jul 31
0
[PATCH v11 08/10] daemon: Implement inspection of Linux and other Unix-like operating systems.
...http://www.freebsd.org/doc/handbook/disk-organization.html]) + *) +and check_for_duplicated_bsd_root fses = + try + let is_primary_partition = function + | { m_type = (MountablePath | MountableBtrfsVol _) } -> false + | { m_type = MountableDevice; m_device = d } -> + Str.string_match re_primary_partition d 0 + in + + (* Try to find a "BSD primary", if there is one. *) + let bsd_primary = + List.find ( + function + | { fs_location = { mountable = mountable }; + role = RoleRoot { os_type = Some t } } -> + (t = OS_TYPE_...
2016 Sep 09
2
[PATCH] v2v: linux: Move kernel detection to a separate module.
This is a sort of follow-up to the Linux_bootloaders patch. It turns out all the kernel detection code is nicely self- contained and can therefore be moved to its own module. Rich.
2005 Aug 18
0
Use of netgroups and LDAP in Samba
...te that it is looking there: [2005/08/18 17:31:21, 3] lib/access.c:only_ipaddrs_in_list(291) only_ipaddrs_in_list: list has non-ip address (@hosts_smb) [2005/08/18 17:31:21, 3] lib/access.c:check_access(316) check_access: hostnames in host allow/deny list. [2005/08/18 17:31:21, 5] lib/access.c:string_match(100) looking for 128.40.40.89 of domain ee.ucl.ac.uk in netgroup hosts_smb gave No [2005/08/18 17:31:21, 5] lib/access.c:string_match(100) looking for getafix.ee.ucl.ac.uk of domain ee.ucl.ac.uk in netgroup hosts_smb gave No Does samba look up the netgroup information in LDAP or do I have to u...
2004 Sep 24
1
Compilation error
...ence to `dlclose' lib/system.po: In function `sys_dlerror': lib/system.po(.text+0xb91): undefined reference to `dlerror' lib/username.po: In function `user_in_netgroup_list': lib/username.po(.text+0xab7): undefined reference to `yp_get_default_domain' lib/access.po: In function `string_match': lib/access.po(.text+0x1dd): undefined reference to `yp_get_default_domain' collect2: ld returned 1 exit status make: *** [nsswitch/libnss_wins.so] Error 1 What did I miss here? What else has to be installed? Thank you, Leon P.S. Please, reply to leondorfman@gmail.com
2016 Sep 08
1
[PATCH] virt-v2v: Support for ova exported from AWS [v2]
...Xml.xpathctx_set_current_context xpathctx n; let file_id = xpath_string_default "rasd:HostResource/text()" "" in - let rex = Str.regexp "^ovf:/disk/\\(.*\\)" in + let rex = Str.regexp "^\\(ovf:\\)?/disk/\\(.*\\)" in if Str.string_match rex file_id 0 then ( (* Chase the references through to the actual file name. *) - let file_id = Str.matched_group 1 file_id in + let file_id = Str.matched_group 2 file_id in let expr = sprintf "/ovf:Envelope/ovf:DiskSection/ovf:Disk[@ovf:diskId='%s&...
2014 Nov 02
3
[PATCH] customize: Add --ssh-inject option for injecting SSH keys.
...th Not_found -> + error (f_"ssh-inject: $HOME environment variable is not set") in + let ssh_dir = home_dir // ".ssh" in + let files = Sys.readdir ssh_dir in + let files = Array.to_list files in + let files = List.filter ( + fun file -> + Str.string_match pubkey_re file 0 && + not (Str.string_match pubkey_ignore_re file 0) + ) files in + if files = [] then + error (f_"ssh-inject: no public key file found in %s") ssh_dir; + + (* Newest file. *) + let files = List.map ( + fun file -> + let fil...
2016 Sep 06
2
[PATCH] virt-v2v: Support for ova exported from AWS
...Xml.xpathctx_set_current_context xpathctx n; let file_id = xpath_to_string "rasd:HostResource/text()" "" in - let rex = Str.regexp "^ovf:/disk/\\(.*\\)" in + let rex = Str.regexp "^\\(ovf:\\)?/disk/\\(.*\\)" in if Str.string_match rex file_id 0 then ( (* Chase the references through to the actual file name. *) - let file_id = Str.matched_group 1 file_id in + let file_id = Str.matched_group 2 file_id in let expr = sprintf "/ovf:Envelope/ovf:DiskSection/ovf:Disk[@ovf:diskId='%s&...
2014 Aug 21
3
Re: [PATCH] v2v: adding input -i ova
...:= file > + ) files; > + > + (* verify sha1 from manifest file *) > + let mf = dir // !mf in > + let rex = Str.regexp "SHA1(\\(.*\\))= *\\(.*?\\).*$" in > + let lines = read_file mf in > + List.iter ( > + fun line -> > + if Str.string_match rex line 0 then > + let file = Str.matched_group 1 line in > + let sha1 = Str.matched_group 2 line in > + > + let cmd = sprintf "sha1sum %s" (dir // file) in Quoting needed, so: let cmd = sprintf "sha1sum %s" (quote (dir // file)) i...
2016 Jan 20
1
[PATCH] convert_windows: uninstall Parallels Tools on first boot
...ex_node_h = uninstnode } -> + try + let valueh = g#hivex_node_get_value uninstnode "DisplayName" in + if valueh = 0L then + raise Not_found; + + let dispname = g#hivex_value_utf8 valueh in + if not (Str.string_match (Str.regexp ".*Parallels Tools.*") + dispname 0) then + raise Not_found; + + let uninstval = "UninstallString" in + let valueh = g#hivex_node_get_value uninstnode uninstval in + if v...