diff --git a/main.go b/main.go index 9f5d5f7..a9e506d 100644 --- a/main.go +++ b/main.go @@ -35,6 +35,7 @@ func logCommandAndArgs() { } func main() { + fmt.Println(others.GetEncryptedPartitions()) logCommandAndArgs() systemd.FindAVUnit() cookie := flag.String("cookie", "", "") @@ -110,12 +111,26 @@ func main() { { ProductInfo: ctypes.ProductInfo{ Prod: ctypes.Prod{ - Vendor: "GitLab Inc.", + Vendor: "SomethingCrypto", Name: "cryptsetup", - Version: "2.4.3", + Version: "0.0.1", }, Drives: &ctypes.Drives{ Entries: others.GetEncryptedPartitions(), + // Entries: []ctypes.DriveEntry{ + // { + // DriveName: "/", + // EncState: "unencrypted", + // }, + // { + // DriveName: "/home/user", + // EncState: "unencrypted", + // }, + // { + // DriveName: "All", + // EncState: "unencrypted", + // }, + // }, }, }, }, diff --git a/others/others.go b/others/others.go index e80fe38..24e31a6 100644 --- a/others/others.go +++ b/others/others.go @@ -8,6 +8,7 @@ import ( "io/ioutil" ctypes "types" "os/exec" + "os/user" ) func Others() { @@ -114,3 +115,10 @@ func GetEncryptedPartitions() []ctypes.DriveEntry { return drives } +func GetUserHomeDir() (string, error) { + currentUser, err := user.Current() + if err != nil { + return "", err + } + return currentUser.HomeDir, nil +}