]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Suppress optional arg to backup scripts when empty string.
authorKaty Feng <fkaty@vmware.com>
Tue, 17 Oct 2023 22:24:48 +0000 (15:24 -0700)
committerKaty Feng <fkaty@vmware.com>
Tue, 17 Oct 2023 22:24:48 +0000 (15:24 -0700)
Backup scripts can be called with an optional argument. Don't pass the
optional arg to the script if it's an empty string.

open-vm-tools/services/plugins/vmbackup/scriptOps.c

index 2dc4eb664a3e21943b890092ed827216e4ca3341..2dbf9bf063b48e8d315565b5b6d7b185415857a0 100644 (file)
@@ -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 {