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

fix(runtime): Fix panic with wildcard in --allow-net flag #25044

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

yazan-abdalrahman
Copy link
Contributor

Title: Fix panic with wildcard in --allow-net flag
This PR fixes issue #23552.

@yazan-abdalrahman
Copy link
Contributor Author

yazan-abdalrahman commented Aug 14, 2024

@lucacasonato @bartlomieju @dsherret
Please review this PR?

colors::red_bold("error"),
msg.trim_start_matches("error: ")
);
std::process::exit(e.exit_code())
Copy link
Member

Choose a reason for hiding this comment

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

This seems much too low level for this part of the code. Probably a result should be surfaced up instead.

Copy link
Contributor Author

@yazan-abdalrahman yazan-abdalrahman Aug 20, 2024

Choose a reason for hiding this comment

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

@dsherret
but this method it's void, and has been called in many methods, its needs many changes, I found that is a better solution that doesn't effect many methods, but if u want to return a Result<(),Anyerror> I will do it

Copy link
Member

Choose a reason for hiding this comment

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

Thinking about it more, isn't there some way we could validate this with clap instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dsherret
done with return clap::error::Result<()>

@yazan-abdalrahman
Copy link
Contributor Author

@dsherret Could you pls review it?

@yazan-abdalrahman
Copy link
Contributor Author

@dsherret Please check this change.

@yazan-abdalrahman
Copy link
Contributor Author

@dsherret
Please check it again...

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

This needs to wait for #25453 to land first.

Comment on lines 3 to 13
use std::collections::HashSet;
use std::env;
use std::ffi::OsString;
use std::net::SocketAddr;
use std::num::NonZeroU32;
use std::num::NonZeroU8;
use std::num::NonZeroUsize;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;

Copy link
Member

Choose a reason for hiding this comment

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

Please revert import changes here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 43 to 46
use crate::args::resolve_no_prompt;
use crate::util::fs::canonicalize_path;

use super::flags_net;
Copy link
Member

Choose a reason for hiding this comment

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

...and here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@yazan-abdalrahman
Copy link
Contributor Author

@bartlomieju , @dsherret
Please check the code,
after the latest merges; it conflicts with my changes, and I discovered it was handled, so only my change will attach the test for that.

@yazan-abdalrahman
Copy link
Contributor Author

@dsherret @bartlomieju

please review it

@yazan-abdalrahman
Copy link
Contributor Author

@bartlomieju

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