Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sssd: fix faulty program detection inside is_running_sssd #7661

Closed
wants to merge 1 commit into from

Commits on Oct 29, 2024

  1. sssd: fix faulty program detection inside is_running_sssd

    The ``is_running_sssd`` function erroneously returns false even
    though the program binary is called ``sssd``. This is because it
    looks at the wrong portion of the filename.
    
    Observed:
    
    ```
    …
    (gdb) r
    …
    is_running_sssd () at src/util/sss_ini.c:156
    156         const char *s = NULL;
    (gdb) n
    158         ret = readlink("/proc/self/exe", exe, sizeof(exe) - 1);
    159         if ((ret > 0) && (ret < 1024)) {
    160             exe[ret] = 0;
    161             s = strstr(exe, debug_prg_name);
    (gdb) p exe
    $6 = "/home/ej/repos/sssd/.libs/sssd", '\000' <repeats 993 times>
    (gdb) p debug_prg_name
    $7 = 0x7ffff77fc110 "sssd"
    (gdb) p s
    $8 = 0x7ffff7fa72cf <exe+15> "sssd/.libs/sssd"
    ```
    
    Expected:
    
    ```
    (gdb) p s
    $8 = 0x7ffff7fa72da <exe+26> "sssd"
    ```
    
    Fixes: 2.9.0-453-g9fbaf6d74
    jengelh committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    ab28c48 View commit details
    Browse the repository at this point in the history