Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Nov 14, 2024
1 parent b0c5b5e commit c502654
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apps/desktop/resources/com.bitwarden.desktop.devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ finish-args:
- --talk-name=org.freedesktop.secrets
- --talk-name=com.canonical.AppMenu.Registrar
- --system-talk-name=org.freedesktop.PolicyKit1
# Lock on lockscreen
# Lock on lockscreen
- --talk-name=org.gnome.ScreenSaver
- --talk-name=org.freedesktop.ScreenSaver
- --system-talk-name=org.freedesktop.login1
- --filesystem=xdg-download
# setup biometrics
# note: this allows bitwarden to spawn processes outside of the sandbox
- --talk-name=org.freedesktop.Flatpak
modules:
- name: bitwarden-desktop
buildsystem: simple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
import { biometrics, passwords } from "@bitwarden/desktop-napi";

import { WindowMain } from "../../main/window.main";
import { isFlatpak, isLinux, isSnapStore } from "../../utils";
import { isLinux, isSnapStore } from "../../utils";

import { OsBiometricService } from "./desktop.biometrics.service";

Expand Down Expand Up @@ -109,11 +109,13 @@ export default class BiometricUnixMain implements OsBiometricService {
// The user needs to manually set up the polkit policy outside of the sandbox
// since we allow access to polkit via dbus for the sandboxed clients, the authentication works from
// the sandbox, once the policy is set up outside of the sandbox.
return isLinux() && !isSnapStore() && !isFlatpak();
return isLinux() && !isSnapStore();
}

async osBiometricsSetup(): Promise<void> {
const process = spawn("pkexec", [
const process = spawn("flatpak-spawn", [

Check warning on line 116 in apps/desktop/src/key-management/biometrics/biometric.unix.main.ts

View check run for this annotation

Codecov / codecov/patch

apps/desktop/src/key-management/biometrics/biometric.unix.main.ts#L116

Added line #L116 was not covered by tests
"--host",
"pkexec",
"bash",
"-c",
`echo '${polkitPolicy}' > ${policyPath + policyFileName} && chown root:root ${policyPath + policyFileName} && chcon system_u:object_r:usr_t:s0 ${policyPath + policyFileName}`,
Expand Down

0 comments on commit c502654

Please sign in to comment.