mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-06 02:29:57 +02:00
Only allow empty passwords when forcing
This commit is contained in:
parent
d3f1288824
commit
b8a03b89dd
2 changed files with 12 additions and 8 deletions
6
IDEAS.md
6
IDEAS.md
|
@ -1,9 +1,6 @@
|
||||||
# First release
|
# First release
|
||||||
- Implement `-f` flag for forcing
|
|
||||||
- Allow creating non existent directories with the `-f` flag
|
|
||||||
- Only allow file extension renaming on upload with `-f` flag
|
- Only allow file extension renaming on upload with `-f` flag
|
||||||
- Only allow empty passwords with `-f` flag
|
- Only allow empty passwords with `-f` flag
|
||||||
- Implement `-y` flag for assume yes
|
|
||||||
- Check for file expiry everywhere
|
- Check for file expiry everywhere
|
||||||
- Soft limit uploads to 1GB and 2GB
|
- Soft limit uploads to 1GB and 2GB
|
||||||
- Remember all uploaded files, make files listable
|
- Remember all uploaded files, make files listable
|
||||||
|
@ -32,9 +29,6 @@
|
||||||
- Dotfile for default properties
|
- Dotfile for default properties
|
||||||
- Host configuration file for host tags, to easily upload to other hosts
|
- Host configuration file for host tags, to easily upload to other hosts
|
||||||
- Generate man pages
|
- Generate man pages
|
||||||
- Move API URL generator methods out of remote file class
|
|
||||||
- Prompt if a file download password is required
|
|
||||||
- Must use `-f` to overwrite existing file
|
|
||||||
- Rename host to server?
|
- Rename host to server?
|
||||||
- Read and write files from and to stdin and stdout with `-` as file
|
- Read and write files from and to stdin and stdout with `-` as file
|
||||||
- Ask to add MIME extension to downloaded files without one on Windows
|
- Ask to add MIME extension to downloaded files without one on Windows
|
||||||
|
|
|
@ -103,13 +103,23 @@ pub fn prompt_password(main_matcher: &MainMatcher) -> String {
|
||||||
quit_error(err_msg("Missing password, must be specified in no-interact mode").compat());
|
quit_error(err_msg("Missing password, must be specified in no-interact mode").compat());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prompt and return
|
// Prompt for the password
|
||||||
match prompt_password_stderr("Password: ") {
|
let password = match prompt_password_stderr("Password: ") {
|
||||||
Ok(password) => password,
|
Ok(password) => password,
|
||||||
Err(err) => quit_error(err.context(
|
Err(err) => quit_error(err.context(
|
||||||
"Failed to read password from password prompt"
|
"Failed to read password from password prompt"
|
||||||
)),
|
)),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Do not allow empty passwords unless forced
|
||||||
|
if !main_matcher.force() && password.is_empty() {
|
||||||
|
quit_error(err_msg("\
|
||||||
|
An empty password is not supported by the web interface, \
|
||||||
|
use '-f' to force\
|
||||||
|
").compat())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
password
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a password if required.
|
/// Get a password if required.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue