[LTP] [PATCH v3 1/4] shell: Add tst_sudo.c helper

Li Wang liwang@redhat.com
Thu Nov 27 13:11:15 CET 2025


On Thu, Nov 27, 2025 at 7:57 PM Li Wang <liwang@redhat.com> wrote:

> Hi Petr,
>
> I feel that the filename tst_sudo.c is a bit misleading. The helper
> doesn’t
> replicate sudo behavior (authentication, privilege escalation), it simply
> drops from root to a fixed UID/GID before executing a command.
>
> So readers may expect a “sudo-like” elevation wrapper when, however
> it’s a privilege-dropping trampoline.
>
> What about renaming it to:
>   tst_runas.c,
>   tst_runas_nobody.c, or
>   tst_drop_privs.c?
>


Personally, I prefer the tst_runas_nody.c because it reflects the
default privilege,
but due it supports the more env so contains "su" maybe better:
  tst_su_switch.c, tst_su_cmd.c


-- 
Regards,
Li Wang


More information about the ltp mailing list