]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:cmdline: Use getprogname() to avoid possible issues with setproctitle()
authorStefan Metzmacher <metze@samba.org>
Fri, 4 Jun 2021 15:55:46 +0000 (17:55 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 8 Jun 2021 14:58:58 +0000 (14:58 +0000)
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun  8 14:58:58 UTC 2021 on sn-devel-184

lib/cmdline/cmdline.c

index 21f64de64900bef897751b09d25671bbf33ccb0f..11630287a8369420f53d715c448d488402680bca 100644 (file)
@@ -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) {