playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: sudo privilege not revoked after installing dependencies

Open alxndrsn opened this issue 1 month ago • 1 comments

Version

  • 1.56.1
  • 1.57.0

Steps to reproduce

  1. run npx playwright install --with-deps
  2. enter password
  3. wait for command to complete successfully
  4. check sudo privileges

Expected behavior

sudo privilege should be revoked immediately after it was used (e.g. sudo -k)

would be observable as:

$ sudo -n true; echo $?
1

Actual behavior

$ npx playwright install --with-deps
Installing dependencies...
Switching to root user to install dependencies...
[sudo] password for user:
...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo -n true; echo $?
0

Additional context

No response

Environment

System:
    OS: Linux Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    Container: Yes
  Binaries:
    Node: 22.21.0
    npm: 10.9.4
  Languages:
    Bash: 5.2.21 - /usr/bin/bash
  npmPackages:
    @playwright/test: 1.56.1

alxndrsn avatar Dec 08 '25 16:12 alxndrsn

We discussed it with the team, but are hesitant to change things because it might break existing script usage that depends on the session not being revoked. Let's collect upvotes, if many people want this change we can reconsider.

Skn0tt avatar Dec 09 '25 18:12 Skn0tt