summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2012-04-02 11:02:34 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2012-04-02 11:02:34 -0700
commit1dd63b129169e9a03f62fe3674dd6b6f96036b60 (patch)
treedda188393abe44fe5f5675b786be98c6891cd957
parentc10fe16f77f2dfe151d09d4711010b418694d572 (diff)
downloadxorg-launch-helper-1dd63b129169e9a03f62fe3674dd6b6f96036b60.tar.gz
xorg-launch-helper-1dd63b129169e9a03f62fe3674dd6b6f96036b60.tar.bz2
xorg-launch-helper-1dd63b129169e9a03f62fe3674dd6b6f96036b60.zip
Move Xauth to just after env(). Stop creating ~/.xsession-errors.
All log output just goes into the journal.
-rw-r--r--src/main.c2
-rw-r--r--src/user.c14
-rw-r--r--src/xserver.c11
3 files changed, 2 insertions, 25 deletions
diff --git a/src/main.c b/src/main.c
index 19161c1..9471653 100644
--- a/src/main.c
+++ b/src/main.c
@@ -108,8 +108,6 @@ int main(int argc, char **argv)
set_tty();
- setup_xauth();
-
setup_pam_session();
switch_to_user();
diff --git a/src/user.c b/src/user.c
index 69fb089..8d06414 100644
--- a/src/user.c
+++ b/src/user.c
@@ -143,6 +143,8 @@ void switch_to_user(void)
ret = chdir(pass->pw_dir);
+ setup_xauth();
+
fp = fopen(user_xauth_path, "w");
if (fp) {
if (XauWriteAuth(fp, &x_auth) != 1)
@@ -150,18 +152,6 @@ void switch_to_user(void)
fclose(fp);
}
- /* redirect further IO to .xsession-errors */
- snprintf(fn, PATH_MAX, "%s/.xsession-errors", pass->pw_dir);
- fp = fopen(fn, "w");
- if (fp) {
- fclose(fp);
- /* xserver.c already truncates this file, so append */
- fp = freopen(fn, "a", stdout);
- fp = freopen(fn, "a", stderr);
- } else {
- lprintf("Unable to open \"%s\n\" for writing", fn);
- }
-
d_out();
}
diff --git a/src/xserver.c b/src/xserver.c
index 9ed7fc8..32b7fe5 100644
--- a/src/xserver.c
+++ b/src/xserver.c
@@ -304,17 +304,6 @@ void start_X_server(void)
}
lprintf("starting X server with: \"%s\"", all);
- /* redirect further IO to .xsession-errors */
- snprintf(fn, PATH_MAX, "%s/.xsession-errors", pass->pw_dir);
- fp = fopen(fn, "w");
- if (fp) {
- fclose(fp);
- fp = freopen(fn, "w", stdout);
- fp = freopen(fn, "w", stderr);
- } else {
- lprintf("Unable to open \"%s\n\" for writing", fn);
- }
-
execv(ptrs[0], ptrs);
d_out();