From: Stefan Metzmacher Date: Fri, 4 Jun 2021 15:55:46 +0000 (+0200) Subject: lib:cmdline: Use getprogname() to avoid possible issues with setproctitle() X-Git-Tag: tevent-0.11.0~650 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7645aca4d05a74504da8cc82131a7d4fded42251;p=thirdparty%2Fsamba.git lib:cmdline: Use getprogname() to avoid possible issues with setproctitle() Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Tue Jun 8 14:58:58 UTC 2021 on sn-devel-184 --- diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index 21f64de6490..11630287a83 100644 --- a/lib/cmdline/cmdline.c +++ b/lib/cmdline/cmdline.c @@ -331,12 +331,7 @@ static void popt_samba_callback(poptContext popt_ctx, bool ok; /* Find out basename of current program */ - pname = strrchr_m(poptGetInvocationName(popt_ctx), '/'); - if (pname == NULL) { - pname = poptGetInvocationName(popt_ctx); - } else { - pname++; - } + pname = getprogname(); if (reason == POPT_CALLBACK_REASON_PRE) { if (lp_ctx == NULL) {