Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errant matches for large decimal numbers #304

Closed
jtmoon79 opened this issue Jun 17, 2024 · 0 comments
Closed

errant matches for large decimal numbers #304

jtmoon79 opened this issue Jun 17, 2024 · 0 comments
Labels
bug Something isn't working P0 most important

Comments

@jtmoon79
Copy link
Owner

jtmoon79 commented Jun 17, 2024

Describe the bug

Overzealous matching of decimal numbers leads to false positives. Datetimes are wildly wrong.

To Reproduce

Given file /var/log/anaconda/packaging.log found on Cent OS 9

14:49:03,354 INF packaging: Estimated size: download 1.58 GiB & install 4.71 GiB
14:49:03,354 DBG packaging: No sufficient mountpoints found
14:49:03,354 DBG packaging: Install + download space required 6.29 GiB
14:49:03,412 DBG packaging: Source doesn't require network for installation
14:49:28,676 DBG packaging: Source doesn't require network for installation
14:49:28,762 DBG packaging: Input mount points: {'/dev': Size (4 MiB), '/dev/shm': Size (984.98046875 MiB), '/run': Size (381.37890625 MiB), '/run/install/repo': Size (0 B), '/': Size (1.05307769775390625 GiB), '/tmp': Size (963.30859375 MiB), '/mnt/sysroot/boot': 1041529569, '/mnt/sysroot': 17701934202}
14:49:28,762 INF packaging: Estimated size: download 1.58 GiB & install 4.71 GiB
14:49:28,762 INF packaging: Sufficient mountpoints found: {'/mnt/sysroot': 17701934202}
14:49:28,762 DBG packaging: Install + download space required 6.29 GiB
14:49:28,851 DBG packaging: Input mount points: {'/dev': Size (4 MiB), '/dev/shm': Size (984.98046875 MiB), '/run': Size (381.37890625 MiB), '/run/install/repo': Size (0 B), '/': Size (1.05307769775390625 GiB), '/tmp': Size (963.30859375 MiB), '/mnt/sysroot/boot': 1041529569, '/mnt/sysroot': 17701934202}

A single match of a large decimal number results in parsing of the file

$ ./target/release/s4 /var/log/anaconda/packaging.log -u
14570519T093125.000+0000:16:51:40,895 DBG packaging: Input mount points: {'/dev': Size (4 MiB), '/dev/shm': Size (981.4453125 MiB), '/run': Size (374.50390625 MiB), '/run/install/repo': Size (0 B), '/': Size (1.15943145751953125 GiB), '/tmp': Size (958.99609375 MiB), '/mnt/sysroot/boot': 1041529569, '/mnt/sysroot': 28072476671}
14570519T093125.000+0000:16:51:40,895 INF packaging: Estimated size: download 1.5 GiB & install 4.64 GiB
14570519T093125.000+0000:16:51:40,895 INF packaging: Sufficient mountpoints found: {'/mnt/sysroot': 28072476671}
14570519T093125.000+0000:16:51:40,895 DBG packaging: Install + download space required 6.13 GiB
14570519T093125.000+0000:16:51:40,982 DBG packaging: Input mount points: {'/dev': Size (4 MiB), '/dev/shm': Size (981.4453125 MiB), '/run': Size (374.50390625 MiB), '/run/install/repo': Size (0 B), '/': Size (1.15943145751953125 GiB), '/tmp': Size (958.99609375 MiB), '/mnt/sysroot/boot': 1041529569, '/mnt/sysroot': 28072476671}
14570519T093125.000+0000:16:51:40,982 INF packaging: Estimated size: download 1.5 GiB & install 4.64 GiB
14570519T093125.000+0000:16:51:40,982 INF packaging: Sufficient mountpoints found: {'/mnt/sysroot': 28072476671}
14570519T093125.000+0000:16:51:40,982 DBG packaging: Install + download space required 6.13 GiB
14570519T093125.000+0000:16:52:01,507 INF packaging: checking software selection
14570519T093125.000+0000:16:52:01,507 DBG packaging: disabling modules: []
14570519T093125.000+0000:16:52:01,507 DBG packaging: enabling modules: []
14570519T093125.000+0000:16:52:01,507 DBG packaging: applying DNF package/group/module selection

The 17701934202 from ... '/mnt/sysroot': 17701934202} is matched.
This is considered datetime 1770-01-09T10:42:02.000+0000

Environment:

  • OS: CentOS Linux 9
  • s4 version: 0.7.73

Screenshots

Screenshot 2024-06-16 184143

@jtmoon79 jtmoon79 added bug Something isn't working P0 most important labels Jun 17, 2024
jtmoon79 added a commit that referenced this issue Jun 17, 2024
jtmoon79 added a commit that referenced this issue Jun 17, 2024
jtmoon79 added a commit that referenced this issue Jun 22, 2024
jtmoon79 added a commit that referenced this issue Jun 22, 2024
Epoch is just a number. Numbers are common to find in files.
Constrain the number range of acceptable epochs from Jan 1 2000
to Feb 2038.

Issue #304
@jtmoon79 jtmoon79 closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 most important
Projects
None yet
Development

No branches or pull requests

1 participant