LCOV - code coverage report
Current view: top level - pkg/users - utils.js Coverage Total Hit
Test: cockpit Lines: 58.3 % 12 7
Test Date: 2026-06-16 14:09:37

            Line data    Source code
       1              : // SPDX-License-Identifier: LGPL-2.1-or-later
       2           15 : import cockpit from 'cockpit';
       3              : 
       4            1 : export const get_locked = name =>
       5            1 :     cockpit.spawn(["passwd", "-S", name], { environ: ["LC_ALL=C"], superuser: "require" })
       6            1 :             .then(content => {
       7            1 :                 const status = content.split(" ")[1];
       8              :                 // libuser uses "LK", shadow-utils use "L".
       9            1 :                 return status == "LK" || status == "L";
      10            1 :             })
      11            0 :             .catch(exc => {
      12            0 :                 if (exc.problem !== "access-denied") {
      13            0 :                     console.warn(`Failed to obtain account lock information for ${name}`, exc);
      14            0 :                 }
      15            0 :             });
        

Generated by: LCOV version 2.0-1