-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(runtime): Fix panic with wildcard in --allow-net flag #25044
Conversation
@lucacasonato @bartlomieju @dsherret |
cli/args/flags.rs
Outdated
colors::red_bold("error"), | ||
msg.trim_start_matches("error: ") | ||
); | ||
std::process::exit(e.exit_code()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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<()>
This reverts commit bd4e7e5.
@dsherret Could you pls review it? |
@dsherret Please check this change. |
@dsherret |
…to---allow-net-flag' into Fix-panic-when-passing-wildcard-to---allow-net-flag
There was a problem hiding this 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.
cli/args/flags.rs
Outdated
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; | ||
|
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cli/args/flags.rs
Outdated
use crate::args::resolve_no_prompt; | ||
use crate::util::fs::canonicalize_path; | ||
|
||
use super::flags_net; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@bartlomieju , @dsherret |
please review it |
Please review this change. |
Please review this change. |
It was fixed in the last release, so I'll close it. |
Title: Fix panic with wildcard in --allow-net flag
This PR fixes issue #23552.