kitty +open: Ask for permission before executing script files that are not marked as executable

This prevents accidental execution of script files via MIME type
association from programs that unconditionally "open"
attachments/downloaded files via MIME type associations.
This commit is contained in:
Kovid Goyal
2023-05-07 08:11:39 +05:30
parent 79c19562b5
commit 537cabca71
6 changed files with 64 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ func extra_for(width, screen_width int) int {
return utils.Max(0, screen_width-width)/2 + 1
}
func choices(o *Options) (response string, err error) {
func GetChoices(o *Options) (response string, err error) {
response = ""
lp, err := loop.New()
if err != nil {

View File

@@ -33,7 +33,7 @@ func main(_ *cli.Command, o *Options, args []string) (rc int, err error) {
}
switch o.Type {
case "yesno", "choices":
result.Response, err = choices(o)
result.Response, err = GetChoices(o)
if err != nil {
return 1, err
}