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

[BUG] _scan_profiles strips h and m from profile name #69

Closed
1 of 3 tasks
ezherman opened this issue Dec 24, 2023 · 4 comments
Closed
1 of 3 tasks

[BUG] _scan_profiles strips h and m from profile name #69

ezherman opened this issue Dec 24, 2023 · 4 comments
Labels

Comments

@ezherman
Copy link

Describe the bug
The _scan_profiles function removes the .hmm extension using strip. However, this also removes trailing h and m characters from profile names, resulting in Macsyfinder being unable to find a profile.

To Reproduce
Please see mdmparis/defense-finder#42, where I outlined the issue and @ZarulHanifah reported that it is driven by strip.

Expected behavior
The command should exclusively remove the file extension. One option would be to use replace, i.e.

if os.path.isfile(profile_path):
    if profile.endswith(profile_suffix):
        base = profile.replace(profile_suffix, '')
    elif profile.endswith(compressed_suffix):
        base = profile.replace(compressed_suffix, '')

Please complete the following information):

OS:

  • Linux
  • Windows
  • Mac

MacSyFinder Version:

Macsyfinder 2.1.3
using:
- Python 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:03:24) [GCC 12.3.0]
- NetworkX 3.2.1
- Pandas 2.1.4
@ezherman ezherman added the bug label Dec 24, 2023
bneron added a commit that referenced this issue Jan 5, 2024
fix issue
#69

when profile name end with hmm the profile is not retrieved by msf
@bneron bneron closed this as completed Jan 5, 2024
@jewell-bug
Copy link

I was wondering if this bug fix will be incorporated in a conda release in the near future. Or alternatively is there a previous version we can specify that does not have this bug? Thank you

@alexweisberg
Copy link

Seconding Jewell's comment, is there any chance that a new bump release of MacSyFinder containing this fix commit could be released? Myself and others install macsyfinder and defensefinder via conda and this bug is preventing it from running. Thanks!

@jeanrjc
Copy link
Contributor

jeanrjc commented Feb 22, 2024

We released defensefinder (v1.2.2) with a previous version of macsyfinder that did not have the bug. We'll make another release when macsyfinder will be released.

@alexweisberg
Copy link

alexweisberg commented Feb 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants