[Pkg-shadow-devel] Bug#528060: Can't delete user: user is currently logged in

Loïc Minier lool at dooz.org
Sun May 10 19:57:16 UTC 2009


On Sun, May 10, 2009, Loïc Minier wrote:
>  Running ./test_utmp in the situation of the bug gives:
> ut_type: 7
> ut_user: foobar
> ut_id: 2
> ut_type: 6
> ut_user: LOGIN
> ut_id: 2
> userdel check
> user foobar is currently logged in

 "w foobar" checks whether the PID still corresponds to an existing
 process.

 I've rebuilt procps' w and confirmed that I'm hitting the PID test.

    best = getproc(u, tty + 5, &jcpu, &ut_pid_found);

    /* just skip if stale utmp entry (i.e. login proc doesn't exist).  If there
     * is a desire a cmdline flag could be added to optionally show it with a
     * prefix of (stale) in front of cmd or something like that.
     */
    if (!ut_pid_found) {
        return;
    }

 (getproc() is a bit long to copy here and I didn't read it fully)

-- 
Loïc Minier





More information about the Pkg-shadow-devel mailing list