From: Katy Feng Date: Tue, 17 Oct 2023 22:24:48 +0000 (-0700) Subject: Suppress optional arg to backup scripts when empty string. X-Git-Tag: stable-12.3.5~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b5308bb4bdf3eeebd49808eb0efa015aa183772;p=thirdparty%2Fopen-vm-tools.git Suppress optional arg to backup scripts when empty string. Backup scripts can be called with an optional argument. Don't pass the optional arg to the script if it's an empty string. --- diff --git a/open-vm-tools/services/plugins/vmbackup/scriptOps.c b/open-vm-tools/services/plugins/vmbackup/scriptOps.c index 2dc4eb664..2dbf9bf06 100644 --- a/open-vm-tools/services/plugins/vmbackup/scriptOps.c +++ b/open-vm-tools/services/plugins/vmbackup/scriptOps.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2019, 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2019, 2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -157,7 +157,7 @@ VmBackupRunNextScript(VmBackupScriptOp *op) // IN/OUT if (File_IsFile(scripts[index].path)) { char *cmd; - if (op->state->scriptArg != NULL) { + if (op->state->scriptArg != NULL && op->state->scriptArg[0] != '\0') { cmd = Str_Asprintf(NULL, "\"%s\" %s \"%s\"", scripts[index].path, scriptOp, op->state->scriptArg); } else {