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

libcdb-cli: add --offline-only, refactor unstrip and add fetch parser for download libc-database #2478

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

the-soloist
Copy link
Contributor

  1. make unstrip as default behavior, except file parser
  2. add return_raw for search_by_symbol_offsets
  3. add fetch arg parser to download and update libc-database

CHANGELOG.md Outdated Show resolved Hide resolved
@the-soloist the-soloist changed the title libcdb-cli: changes for previous updates libcdb-cli: add --offline-only, refactor unstrip and add fetch parser for download libc-database Oct 2, 2024
help = 'Set libc-database path, If it is empty, the default path will be `context.local_libcdb` (%s)' % context.local_libcdb
)

fetch_parser.add_argument(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird to run libcdb fetch and have the command do nothing. Maybe do the update by default and ask if you want to clone/init first if the directory is still empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think init and upgrade repository is better, and remove --init.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the second time you run libcdb fetch it does nothing. I'd remove all arguments and just update the database if it exists and install it first if its the first time you run the command.

Copy link
Contributor Author

@the-soloist the-soloist Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't quite understand. Currently, the expected behavior of second time run libcdb fetch will upgrade the repo.

image

If we want update database, we should pass -u

image

fetch_parser.add_argument(
    '-u', '--update',
    metavar = 'update',
    nargs = '*',
    choices = ['all', 'ubuntu', 'debian', 'rpm', 'centos', 'arch', 'alpine', 'kali', 'parrotsec', 'launchpad'],
    help = 'Fetch the desired libc categories'
)

like libcdb fetch -u ubuntu
image

First time run libcdb fetch or database path didn't exists, it will ask if you want init repo.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting a default value for -u meet your requirements?

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

Successfully merging this pull request may close these issues.

3 participants