[gnome-session/gnome-3-24] gnome-session-inhibit: fix child cmd arguments



commit 0847717bcc1baed2bc5ec17e963619fe53809fa4
Author: Maxime de Roucy <maxime deroucy oxalide com>
Date:   Wed Oct 12 22:38:51 2016 +0200

    gnome-session-inhibit: fix child cmd arguments
    
    int execvp(const char *file, char *const argv[]);
    The execv(), execvp(), and execvpe() functions provide an array of pointers
    to null-terminated strings that represent the argument list available to the
    new program. The first argument, by convention, should point to the filename
    associated with the file being executed.
    
    In the above paragraph "The first argument" is argv[0] (not the first
    parameter of the execvp function).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772825

 tools/gnome-session-inhibit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tools/gnome-session-inhibit.c b/tools/gnome-session-inhibit.c
index 622def1..ffab3f9 100644
--- a/tools/gnome-session-inhibit.c
+++ b/tools/gnome-session-inhibit.c
@@ -142,7 +142,7 @@ wait_for_child_app (char **argv)
 
   if (pid == 0)
     {
-      execvp (*argv, argv + 1);
+      execvp (*argv, argv);
       g_print (_("Failed to execute %s\n"), *argv);
       exit (1);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]