Skip to content

dbc leaves partially installed driver around when signature verification fails #40

Closed

Description

@amoeba

There may be two bugs here.

  1. We fail to verify the driver signature if the driver package doesn't have a signature
  2. When we appear to fail an install due to (1) or other reasons, we leave a partially installed driver.
go run ./cmd/dbc install snowflake
Error: signature verification failed: gopenpgp: verify signature reader failed: read /Users/bryce/Library/Application Support/ADBC/Drivers/snowflake_macos_arm64_v1.7.0: is a directory
exit status 1

And notice there's no manifest here:

$ tree ADBC
ADBC
└── Drivers
    └── snowflake_macos_arm64_v1.7.0
        ├── libadbc_driver_snowflake.dylib
        ├── libadbc_driver_snowflake.dylib.sig
        ├── LICENSE.txt
        └── NOTICE.txt

We see the error is:

"/Users/bryce/Library/Application Support/ADBC/Drivers/snowflake_macos_arm64_v1.7.0: is a directory".

The relevant code is,

dbc/cmd/dbc/install.go

Lines 64 to 72 in f9fecb7

sig, err := os.Open(filepath.Join(path, m.Files.Signature))
if err != nil {
return fmt.Errorf("could not open signature file: %w", err)
}
defer sig.Close()
if err := dbc.SignedByColumnar(lib, sig); err != nil {
return fmt.Errorf("signature verification failed: %w", err)
}

And in this particular instance, m.Files.Signature is "",

(dlv) p m.Files
struct { Driver string "toml:\"driver,omitempty\""; Signature string "toml:\"signature,omitempty\"" } {
        Driver: "libadbc_driver_snowflake.dylib",
        Signature: "",}

So sig is a directory and not a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions