[gnome-continuous] libqa: construct a different execLine when new user's default session is not specified



commit 4c027a5e824d3d8c852cd0b2da201fed4e25f42b
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Sat May 10 17:01:52 2014 +0200

    libqa: construct a different execLine when new user's default session is not specified

 src/js/libqa.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/js/libqa.js b/src/js/libqa.js
index 4468abe..63d1c92 100644
--- a/src/js/libqa.js
+++ b/src/js/libqa.js
@@ -230,10 +230,11 @@ function injectTestUserCreation(currentDir, currentEtcDir, username, params, can
         // AccountService requires passing a crypt, so using passwd would be easier
         passwordCommand = Format.vprintf("echo %s | passwd --stdin %s", [params.password, username]);
     }
-    if (params.session != null) {
+    execLine = Format.vprintf('/bin/sh -c "%s"; /bin/sh -c "%s"', [addUserCommand, passwordCommand])
+    if (params.session) {
         setSessionCommand = Format.vprintf(commandTemplate, ['/User1000', 'User.SetXSession', 'string:' + 
params.session])
+        execLine += Format.vprintf('; /bin/sh -c "%s"', [setSessionCommand])
     }
-    execLine = Format.vprintf('/bin/sh -c "%s"; /bin/sh -c "%s"; /bin/sh -c "%s"', [addUserCommand, 
passwordCommand, setSessionCommand])
     let addUserService = '[Unit]\n\
 Description=Add user %s\n\
 Before=gdm.service\n\


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