Skip to content

Improve error message for when devices are mounted or in use #105

Closed
@ifd3f

Description

@ifd3f

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Plug in a USB
  2. ./caligula-x86_64-darwin burn caligula-x86_64-darwin
  3. Go through the prompts
  4. Select the plugged USB
  5. The osascript prompt pops up. Entering in the password, however, does not appear to grant sudo, and the password is asked in the terminal again.
  6. Running yields the error

Full terminal output:

> ./caligula-x86_64-darwin burn caligula-x86_64-darwin
Couldn't detect compression format for caligula-x86_64-darwin
> What format to use? no compression
> What is the file's hash?
Input is empty
> What is the file's hash?
Input is empty
? What is the file's hash? <canceled>
> Select target disk disk2 | Generic STORAGE DEVICE Media - 62.6 GB (disk, remov
able: yes)
Input: caligula-x86_64-darwin
  Size: 4.0 MB
  Compression: no compression

Output: disk2
  Model: Generic STORAGE DEVICE Media
  Size: 62.6 GB
  Type: disk
  Path: /dev/rdisk2
  Removable: yes

> Is this okay? Yes
> We don't have permissions on /dev/rdisk2. Escalate using sudo? Yes

Password:
An unexpected error occurred: panicked at src/ui/main.rs:36:9:
Explicit failure signaled: Some(UnknownChildProcError("Resource busy (os error 16)"))

Please report bugs to https://github.com/ifd3f/caligula/issues and attach the following log files, if they exist:
- /var/folders/f1/0sb8zs9d5ps5pt4h1w9g8zzm0000gp/T/caligula/log/1714949843182.main.log
- /var/folders/f1/0sb8zs9d5ps5pt4h1w9g8zzm0000gp/T/caligula/log/1714949843182.child.log

Expected behavior

You only get asked for password once, and the burn happens

Log files

1714949843182.child.log
1714949843182.main.log

OS/Environment

  • OS: MacOS Version 14.2.1 (23C71) x86_64
  • Version: v0.4.4
  • Distribution channel: release binary

Additional context

N/A

Metadata

Metadata

Assignees

Labels

arch: x86_64bugSomething isn't workingos: darwinIssues specific to the MacOS build.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions