Debian Bug report logs - #529306
slim: insecure xauth secret

version graph

Package: slim; Maintainer for slim is Nobuhiro Iwamatsu <iwamatsu@debian.org>; Source for slim is src:slim.

Reported by: Nico Golde <nion@debian.org>

Date: Mon, 18 May 2009 14:57:01 UTC

Severity: grave

Tags: security

Found in version slim/1.3.0-2

Fixed in version slim/1.3.1-2

Done: Nobuhiro Iwamatsu <iwamatsu@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Mon, 18 May 2009 14:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nico Golde <nion@debian.org>:
New Bug report received and forwarded. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Mon, 18 May 2009 14:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Nico Golde <nion@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: slim: insecure xauth secret
Date: Mon, 18 May 2009 16:53:35 +0200
Package: slim
Version: 1.3.0-2
Severity: grave
Tags: security

Hi,
>From app.cpp:
1134 void App::CreateServerAuth() {
1135     /* create mit cookie */
1136     int i, r;
1137     int hexcount = 0;
1138         string authfile;
1139     string cmd;
1140     char *digits = "0123456789abcdef";
1141         srand( time(NULL) );
1142     for ( i = 0; i < 31; i++ ) {
1143         r = rand()%16;
1144                 mcookie[i] = digits[r];
1145                 if (r>9)
1146                         hexcount++;
1147     }
1148         /* MIT-COOKIE: even occurrences of digits and hex digits */
1149         if ((hexcount%2) == 0) {
1150                 r = rand()%10;
1151         } else {
1152                 r = rand()%5+10;
1153         }
1154         mcookie[31] = digits[r];
1155     /* reinitialize auth file */
1156     authfile = cfg->getOption("authfile");
1157     remove(authfile.c_str());
1158     putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
1159     cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
1160     system(cmd.c_str());
1161 }

This function is used to create the x authority file in /var/run which is
then copied into the users home directory on login. However this function somehow defeats the
purpose of xauth as the file itself is generated by executing xauth via system and includes
mcookie (the secret hex string) in the command line. So as an attacker I can watch the process
list, grab the mcookie string and generate my own x auth cookie to have fun with the victims
X session. The same problem exists in switchuser.cpp.

The easy fix would be to read this from stdin, xauth supports this. As small remark...
I think using the time as a source for random data is also suboptimal in this case.

Cheers
Nico




Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Wed, 20 May 2009 15:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eygene Ryabinkin <rea@codelabs.ru>:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Wed, 20 May 2009 15:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 529306@bugs.debian.org (full text, mbox):

From: Eygene Ryabinkin <rea@codelabs.ru>
To: 529306@bugs.debian.org
Subject: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Wed, 20 May 2009 19:24:10 +0400
Instead, open xauth as a pipe and feed commands via its stdin.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
---
 Makefile         |    3 ++-
 Makefile.freebsd |    3 ++-
 Makefile.netbsd  |    3 ++-
 Makefile.openbsd |    3 ++-
 app.cpp          |    8 +++++---
 switchuser.cpp   |    7 ++++---
 util.cpp         |   32 ++++++++++++++++++++++++++++++++
 util.h           |   19 +++++++++++++++++++
 8 files changed, 68 insertions(+), 10 deletions(-)
 create mode 100644 util.cpp
 create mode 100644 util.h

diff --git a/Makefile b/Makefile
index f7d3d2d..240669d 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 ifdef USE_PAM
 OBJECTS+=PAM.o
 endif
diff --git a/Makefile.freebsd b/Makefile.freebsd
index 3ff326e..c925a39 100644
--- a/Makefile.freebsd
+++ b/Makefile.freebsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.netbsd b/Makefile.netbsd
index ad8bb8b..45f33e6 100644
--- a/Makefile.netbsd
+++ b/Makefile.netbsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.openbsd b/Makefile.openbsd
index b1829f8..1205b84 100644
--- a/Makefile.openbsd
+++ b/Makefile.openbsd
@@ -20,7 +20,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	util.o panel.o
 
 .SUFFIXES: .c.o .cpp.o
 
diff --git a/app.cpp b/app.cpp
index 83ae947..2502b0b 100644
--- a/app.cpp
+++ b/app.cpp
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include "app.h"
 #include "numlock.h"
+#include "util.h"
 
 
 #ifdef HAVE_SHADOW
@@ -1162,7 +1163,8 @@ void App::replaceVariables(string& input,
 
 void App::CreateServerAuth() {
     /* create mit cookie */
-    int i, r;
+    bool r;
+    int i;
     int hexcount = 0;
         string authfile;
     string cmd;
@@ -1185,8 +1187,8 @@ void App::CreateServerAuth() {
     authfile = cfg->getOption("authfile");
     remove(authfile.c_str());
     putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
-    cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    system(cmd.c_str());
+    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
 
 char* App::StrConcat(const char* str1, const char* str2) {
diff --git a/switchuser.cpp b/switchuser.cpp
index e72a8fc..ec298e1 100644
--- a/switchuser.cpp
+++ b/switchuser.cpp
@@ -10,6 +10,7 @@
 */
 
 #include "switchuser.h"
+#include "util.h"
 
 using namespace std;
 
@@ -53,10 +54,10 @@ void SwitchUser::Execute(const char* cmd) {
 }
 
 void SwitchUser::SetClientAuth(const char* mcookie) {
-    int r;
+    bool r;
     string home = string(Pw->pw_dir);
     string authfile = home + "/.Xauthority";
     remove(authfile.c_str());
-    string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    r = system(cmd.c_str());
+    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
diff --git a/util.cpp b/util.cpp
new file mode 100644
index 0000000..050d83d
--- /dev/null
+++ b/util.cpp
@@ -0,0 +1,32 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+
+#include <stdio.h>
+#include "util.h"
+
+/*
+ * Adds the given cookie to the specified Xauthority file.
+ * Returns true on success, false on fault.
+ */
+bool Util::add_mcookie(const std::string &mcookie, const char *display,
+    const std::string &xauth_cmd, const std::string &authfile)
+{
+	FILE *fp;
+	std::string cmd = xauth_cmd + " -f " + authfile + " -q";
+
+	fp = popen(cmd.c_str(), "w");
+	if (!fp)
+		return false;
+	fprintf(fp, "remove %s\n", display);
+	fprintf(fp, "add %s %s %s\n", display, ".", mcookie.c_str());
+	fprintf(fp, "quit\n");
+
+	pclose(fp);
+	return true;
+}
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..8bd52be
--- /dev/null
+++ b/util.h
@@ -0,0 +1,19 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+#include <string>
+
+namespace Util {
+	bool add_mcookie(const std::string &mcookie, const char *display,
+	    const std::string &xauth_cmd, const std::string &authfile);
+};
+
+#endif /* __UTIL_H__ */
-- 
1.6.3.1




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#529306; Package slim. (Wed, 20 May 2009 15:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Massonnet <mmassonnet@gmail.com>:
Extra info received and forwarded to list. (Wed, 20 May 2009 15:42:04 GMT) Full text and rfc822 format available.

Message #15 received at 529306@bugs.debian.org (full text, mbox):

From: Mike Massonnet <mmassonnet@gmail.com>
To: Eygene Ryabinkin <rea@codelabs.ru>, 529306@bugs.debian.org
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Wed, 20 May 2009 17:39:08 +0200
Wow, nice! I didn't take time yet to investigate, thanks for a lot for
providing this patch. I will make a package for stable asap.

Mike

2009/5/20 Eygene Ryabinkin <rea@codelabs.ru>:
> Instead, open xauth as a pipe and feed commands via its stdin.
>
> Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
> ---
>  Makefile         |    3 ++-
>  Makefile.freebsd |    3 ++-
>  Makefile.netbsd  |    3 ++-
>  Makefile.openbsd |    3 ++-
>  app.cpp          |    8 +++++---
>  switchuser.cpp   |    7 ++++---
>  util.cpp         |   32 ++++++++++++++++++++++++++++++++
>  util.h           |   19 +++++++++++++++++++
>  8 files changed, 68 insertions(+), 10 deletions(-)
>  create mode 100644 util.cpp
>  create mode 100644 util.h
>
> diff --git a/Makefile b/Makefile
> index f7d3d2d..240669d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -25,7 +25,8 @@ VERSION=1.3.1
>  DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
>                -DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
>
> -OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
> +OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
> +       panel.o util.o
>  ifdef USE_PAM
>  OBJECTS+=PAM.o
>  endif
> diff --git a/Makefile.freebsd b/Makefile.freebsd
> index 3ff326e..c925a39 100644
> --- a/Makefile.freebsd
> +++ b/Makefile.freebsd
> @@ -24,7 +24,8 @@ VERSION=1.3.1
>  DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
>                -DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
>
> -OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
> +OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
> +       panel.o util.o
>  .ifdef USE_PAM
>   OBJECTS+=PAM.o
>  .endif
> diff --git a/Makefile.netbsd b/Makefile.netbsd
> index ad8bb8b..45f33e6 100644
> --- a/Makefile.netbsd
> +++ b/Makefile.netbsd
> @@ -24,7 +24,8 @@ VERSION=1.3.1
>  DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
>                -DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
>
> -OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
> +OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
> +       panel.o util.o
>  .ifdef USE_PAM
>   OBJECTS+=PAM.o
>  .endif
> diff --git a/Makefile.openbsd b/Makefile.openbsd
> index b1829f8..1205b84 100644
> --- a/Makefile.openbsd
> +++ b/Makefile.openbsd
> @@ -20,7 +20,8 @@ VERSION=1.3.1
>  DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
>                -DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
>
> -OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
> +OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
> +       util.o panel.o
>
>  .SUFFIXES: .c.o .cpp.o
>
> diff --git a/app.cpp b/app.cpp
> index 83ae947..2502b0b 100644
> --- a/app.cpp
> +++ b/app.cpp
> @@ -24,6 +24,7 @@
>  #include <algorithm>
>  #include "app.h"
>  #include "numlock.h"
> +#include "util.h"
>
>
>  #ifdef HAVE_SHADOW
> @@ -1162,7 +1163,8 @@ void App::replaceVariables(string& input,
>
>  void App::CreateServerAuth() {
>     /* create mit cookie */
> -    int i, r;
> +    bool r;
> +    int i;
>     int hexcount = 0;
>         string authfile;
>     string cmd;
> @@ -1185,8 +1187,8 @@ void App::CreateServerAuth() {
>     authfile = cfg->getOption("authfile");
>     remove(authfile.c_str());
>     putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
> -    cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
> -    system(cmd.c_str());
> +    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
> +      authfile);
>  }
>
>  char* App::StrConcat(const char* str1, const char* str2) {
> diff --git a/switchuser.cpp b/switchuser.cpp
> index e72a8fc..ec298e1 100644
> --- a/switchuser.cpp
> +++ b/switchuser.cpp
> @@ -10,6 +10,7 @@
>  */
>
>  #include "switchuser.h"
> +#include "util.h"
>
>  using namespace std;
>
> @@ -53,10 +54,10 @@ void SwitchUser::Execute(const char* cmd) {
>  }
>
>  void SwitchUser::SetClientAuth(const char* mcookie) {
> -    int r;
> +    bool r;
>     string home = string(Pw->pw_dir);
>     string authfile = home + "/.Xauthority";
>     remove(authfile.c_str());
> -    string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
> -    r = system(cmd.c_str());
> +    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
> +      authfile);
>  }
> diff --git a/util.cpp b/util.cpp
> new file mode 100644
> index 0000000..050d83d
> --- /dev/null
> +++ b/util.cpp
> @@ -0,0 +1,32 @@
> +/* SLiM - Simple Login Manager
> +   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 2 of the License, or
> +   (at your option) any later version.
> +*/
> +
> +#include <stdio.h>
> +#include "util.h"
> +
> +/*
> + * Adds the given cookie to the specified Xauthority file.
> + * Returns true on success, false on fault.
> + */
> +bool Util::add_mcookie(const std::string &mcookie, const char *display,
> +    const std::string &xauth_cmd, const std::string &authfile)
> +{
> +       FILE *fp;
> +       std::string cmd = xauth_cmd + " -f " + authfile + " -q";
> +
> +       fp = popen(cmd.c_str(), "w");
> +       if (!fp)
> +               return false;
> +       fprintf(fp, "remove %s\n", display);
> +       fprintf(fp, "add %s %s %s\n", display, ".", mcookie.c_str());
> +       fprintf(fp, "quit\n");
> +
> +       pclose(fp);
> +       return true;
> +}
> diff --git a/util.h b/util.h
> new file mode 100644
> index 0000000..8bd52be
> --- /dev/null
> +++ b/util.h
> @@ -0,0 +1,19 @@
> +/* SLiM - Simple Login Manager
> +   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 2 of the License, or
> +   (at your option) any later version.
> +*/
> +#ifndef __UTIL_H__
> +#define __UTIL_H__
> +
> +#include <string>
> +
> +namespace Util {
> +       bool add_mcookie(const std::string &mcookie, const char *display,
> +           const std::string &xauth_cmd, const std::string &authfile);
> +};
> +
> +#endif /* __UTIL_H__ */
> --
> 1.6.3.1
>
>
>




Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Thu, 21 May 2009 05:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to rea@codelabs.ru:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Thu, 21 May 2009 05:51:02 GMT) Full text and rfc822 format available.

Message #20 received at 529306@bugs.debian.org (full text, mbox):

From: Eygene Ryabinkin <rea@codelabs.ru>
To: Mike Massonnet <mmassonnet@gmail.com>
Cc: 529306@bugs.debian.org
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Thu, 21 May 2009 09:50:12 +0400
Wed, May 20, 2009 at 05:39:08PM +0200, Mike Massonnet wrote:
> Wow, nice! I didn't take time yet to investigate, thanks for a lot for
> providing this patch. I will make a package for stable asap.

Erm, sorry, sent old patch variant that doesn't produce .Xauthority:
'quit' should be replaced with 'exit'.  Sorry, wasn't updated the
patchfile.  Here is the proper one:

From 91a9c953723d602c3da0e375785a9c62401781c2 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea@codelabs.ru>
Date: Wed, 20 May 2009 18:44:57 +0400
Subject: [PATCH] Do not specify magic cookie for xauth in the xauth command line

Instead, open xauth as a pipe and feed commands via its stdin.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
---
 Makefile         |    3 ++-
 Makefile.freebsd |    3 ++-
 Makefile.netbsd  |    3 ++-
 Makefile.openbsd |    3 ++-
 app.cpp          |    8 +++++---
 switchuser.cpp   |    7 ++++---
 util.cpp         |   32 ++++++++++++++++++++++++++++++++
 util.h           |   19 +++++++++++++++++++
 8 files changed, 68 insertions(+), 10 deletions(-)
 create mode 100644 util.cpp
 create mode 100644 util.h

diff --git a/Makefile b/Makefile
index f7d3d2d..240669d 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 ifdef USE_PAM
 OBJECTS+=PAM.o
 endif
diff --git a/Makefile.freebsd b/Makefile.freebsd
index 3ff326e..c925a39 100644
--- a/Makefile.freebsd
+++ b/Makefile.freebsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.netbsd b/Makefile.netbsd
index ad8bb8b..45f33e6 100644
--- a/Makefile.netbsd
+++ b/Makefile.netbsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.openbsd b/Makefile.openbsd
index b1829f8..1205b84 100644
--- a/Makefile.openbsd
+++ b/Makefile.openbsd
@@ -20,7 +20,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	util.o panel.o
 
 .SUFFIXES: .c.o .cpp.o
 
diff --git a/app.cpp b/app.cpp
index 83ae947..2502b0b 100644
--- a/app.cpp
+++ b/app.cpp
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include "app.h"
 #include "numlock.h"
+#include "util.h"
 
 
 #ifdef HAVE_SHADOW
@@ -1162,7 +1163,8 @@ void App::replaceVariables(string& input,
 
 void App::CreateServerAuth() {
     /* create mit cookie */
-    int i, r;
+    bool r;
+    int i;
     int hexcount = 0;
         string authfile;
     string cmd;
@@ -1185,8 +1187,8 @@ void App::CreateServerAuth() {
     authfile = cfg->getOption("authfile");
     remove(authfile.c_str());
     putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
-    cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    system(cmd.c_str());
+    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
 
 char* App::StrConcat(const char* str1, const char* str2) {
diff --git a/switchuser.cpp b/switchuser.cpp
index e72a8fc..ec298e1 100644
--- a/switchuser.cpp
+++ b/switchuser.cpp
@@ -10,6 +10,7 @@
 */
 
 #include "switchuser.h"
+#include "util.h"
 
 using namespace std;
 
@@ -53,10 +54,10 @@ void SwitchUser::Execute(const char* cmd) {
 }
 
 void SwitchUser::SetClientAuth(const char* mcookie) {
-    int r;
+    bool r;
     string home = string(Pw->pw_dir);
     string authfile = home + "/.Xauthority";
     remove(authfile.c_str());
-    string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    r = system(cmd.c_str());
+    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
diff --git a/util.cpp b/util.cpp
new file mode 100644
index 0000000..309ce4f
--- /dev/null
+++ b/util.cpp
@@ -0,0 +1,32 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+
+#include <stdio.h>
+#include "util.h"
+
+/*
+ * Adds the given cookie to the specified Xauthority file.
+ * Returns true on success, false on fault.
+ */
+bool Util::add_mcookie(const std::string &mcookie, const char *display,
+    const std::string &xauth_cmd, const std::string &authfile)
+{
+	FILE *fp;
+	std::string cmd = xauth_cmd + " -f " + authfile + " -q";
+
+	fp = popen(cmd.c_str(), "w");
+	if (!fp)
+		return false;
+	fprintf(fp, "remove %s\n", display);
+	fprintf(fp, "add %s %s %s\n", display, ".", mcookie.c_str());
+	fprintf(fp, "exit\n");
+
+	pclose(fp);
+	return true;
+}
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..8bd52be
--- /dev/null
+++ b/util.h
@@ -0,0 +1,19 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+#include <string>
+
+namespace Util {
+	bool add_mcookie(const std::string &mcookie, const char *display,
+	    const std::string &xauth_cmd, const std::string &authfile);
+};
+
+#endif /* __UTIL_H__ */
-- 
1.6.3.1




Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Thu, 21 May 2009 06:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to rea@codelabs.ru:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Thu, 21 May 2009 06:42:02 GMT) Full text and rfc822 format available.

Message #25 received at 529306@bugs.debian.org (full text, mbox):

From: Eygene Ryabinkin <rea@codelabs.ru>
To: Mike Massonnet <mmassonnet@gmail.com>
Cc: 529306@bugs.debian.org
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Thu, 21 May 2009 10:39:36 +0400
Thu, May 21, 2009 at 09:50:12AM +0400, Eygene Ryabinkin wrote:
> Wed, May 20, 2009 at 05:39:08PM +0200, Mike Massonnet wrote:
> > Wow, nice! I didn't take time yet to investigate, thanks for a lot for
> > providing this patch. I will make a package for stable asap.
> 
> Erm, sorry, sent old patch variant that doesn't produce .Xauthority:
> 'quit' should be replaced with 'exit'.  Sorry, wasn't updated the
> patchfile.  Here is the proper one:

And found one more issue -- mcookie was weakened because I am blindly
substituted 'int r' for 'bool r'.  Fixed now.

From 72625a9dacfbd448ba7a84725d66bb2bfc9801f0 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea@codelabs.ru>
Date: Wed, 20 May 2009 18:44:57 +0400
Subject: [PATCH] Do not specify magic cookie for xauth in the xauth command line

Instead, open xauth as a pipe and feed commands via its stdin.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
---
 Makefile         |    3 ++-
 Makefile.freebsd |    3 ++-
 Makefile.netbsd  |    3 ++-
 Makefile.openbsd |    3 ++-
 app.cpp          |    5 +++--
 switchuser.cpp   |    7 ++++---
 util.cpp         |   32 ++++++++++++++++++++++++++++++++
 util.h           |   19 +++++++++++++++++++
 8 files changed, 66 insertions(+), 9 deletions(-)
 create mode 100644 util.cpp
 create mode 100644 util.h

diff --git a/Makefile b/Makefile
index f7d3d2d..240669d 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 ifdef USE_PAM
 OBJECTS+=PAM.o
 endif
diff --git a/Makefile.freebsd b/Makefile.freebsd
index 3ff326e..c925a39 100644
--- a/Makefile.freebsd
+++ b/Makefile.freebsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.netbsd b/Makefile.netbsd
index ad8bb8b..45f33e6 100644
--- a/Makefile.netbsd
+++ b/Makefile.netbsd
@@ -24,7 +24,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	panel.o util.o
 .ifdef USE_PAM
   OBJECTS+=PAM.o 
 .endif
diff --git a/Makefile.openbsd b/Makefile.openbsd
index b1829f8..1205b84 100644
--- a/Makefile.openbsd
+++ b/Makefile.openbsd
@@ -20,7 +20,8 @@ VERSION=1.3.1
 DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
 		-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
 
-OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
+OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o \
+	util.o panel.o
 
 .SUFFIXES: .c.o .cpp.o
 
diff --git a/app.cpp b/app.cpp
index 83ae947..04caaa1 100644
--- a/app.cpp
+++ b/app.cpp
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include "app.h"
 #include "numlock.h"
+#include "util.h"
 
 
 #ifdef HAVE_SHADOW
@@ -1185,8 +1186,8 @@ void App::CreateServerAuth() {
     authfile = cfg->getOption("authfile");
     remove(authfile.c_str());
     putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
-    cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    system(cmd.c_str());
+    Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
 
 char* App::StrConcat(const char* str1, const char* str2) {
diff --git a/switchuser.cpp b/switchuser.cpp
index e72a8fc..ec298e1 100644
--- a/switchuser.cpp
+++ b/switchuser.cpp
@@ -10,6 +10,7 @@
 */
 
 #include "switchuser.h"
+#include "util.h"
 
 using namespace std;
 
@@ -53,10 +54,10 @@ void SwitchUser::Execute(const char* cmd) {
 }
 
 void SwitchUser::SetClientAuth(const char* mcookie) {
-    int r;
+    bool r;
     string home = string(Pw->pw_dir);
     string authfile = home + "/.Xauthority";
     remove(authfile.c_str());
-    string cmd = cfg->getOption("xauth_path") + " -q -f " + authfile + " add :0 . " + mcookie;
-    r = system(cmd.c_str());
+    r = Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
+      authfile);
 }
diff --git a/util.cpp b/util.cpp
new file mode 100644
index 0000000..309ce4f
--- /dev/null
+++ b/util.cpp
@@ -0,0 +1,32 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+
+#include <stdio.h>
+#include "util.h"
+
+/*
+ * Adds the given cookie to the specified Xauthority file.
+ * Returns true on success, false on fault.
+ */
+bool Util::add_mcookie(const std::string &mcookie, const char *display,
+    const std::string &xauth_cmd, const std::string &authfile)
+{
+	FILE *fp;
+	std::string cmd = xauth_cmd + " -f " + authfile + " -q";
+
+	fp = popen(cmd.c_str(), "w");
+	if (!fp)
+		return false;
+	fprintf(fp, "remove %s\n", display);
+	fprintf(fp, "add %s %s %s\n", display, ".", mcookie.c_str());
+	fprintf(fp, "exit\n");
+
+	pclose(fp);
+	return true;
+}
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..8bd52be
--- /dev/null
+++ b/util.h
@@ -0,0 +1,19 @@
+/* SLiM - Simple Login Manager
+   Copyright (C) 2009 Eygene Ryabinkin <rea@codelabs.ru>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+*/
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+#include <string>
+
+namespace Util {
+	bool add_mcookie(const std::string &mcookie, const char *display,
+	    const std::string &xauth_cmd, const std::string &authfile);
+};
+
+#endif /* __UTIL_H__ */
-- 
1.6.3.1
-- 
rea




Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Thu, 21 May 2009 09:06:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nico Golde <nion@debian.org>:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Thu, 21 May 2009 09:06:05 GMT) Full text and rfc822 format available.

Message #30 received at 529306@bugs.debian.org (full text, mbox):

From: Nico Golde <nion@debian.org>
To: rea@codelabs.ru, 529306@bugs.debian.org
Cc: Mike Massonnet <mmassonnet@gmail.com>
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Thu, 21 May 2009 11:00:23 +0200
[Message part 1 (text/plain, inline)]
Hi,
* Eygene Ryabinkin <rea@codelabs.ru> [2009-05-21 10:24]:
> Thu, May 21, 2009 at 09:50:12AM +0400, Eygene Ryabinkin wrote:
> > Wed, May 20, 2009 at 05:39:08PM +0200, Mike Massonnet wrote:
> > > Wow, nice! I didn't take time yet to investigate, thanks for a lot for
> > > providing this patch. I will make a package for stable asap.
> > 
> > Erm, sorry, sent old patch variant that doesn't produce .Xauthority:
> > 'quit' should be replaced with 'exit'.  Sorry, wasn't updated the
> > patchfile.  Here is the proper one:
> 
> And found one more issue -- mcookie was weakened because I am blindly
> substituted 'int r' for 'bool r'.  Fixed now.

Thanks very much, the patch looks good! While you're at it, 
mind to fix the insecure "random" hexstring generation as 
well?

Cheers
Nico
-- 
Nico Golde - http://www.ngolde.de - nion@jabber.ccc.de - GPG: 0x73647CFF
For security reasons, all text in this mail is double-rot13 encrypted.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Thu, 21 May 2009 09:18:17 GMT) Full text and rfc822 format available.

Acknowledgement sent to rea@codelabs.ru:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Thu, 21 May 2009 09:18:17 GMT) Full text and rfc822 format available.

Message #35 received at 529306@bugs.debian.org (full text, mbox):

From: Eygene Ryabinkin <rea@codelabs.ru>
To: Nico Golde <nion@debian.org>
Cc: 529306@bugs.debian.org, Mike Massonnet <mmassonnet@gmail.com>
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Thu, 21 May 2009 13:16:00 +0400
Nico, good day.

Thu, May 21, 2009 at 11:00:23AM +0200, Nico Golde wrote:
> * Eygene Ryabinkin <rea@codelabs.ru> [2009-05-21 10:24]:
> > Thu, May 21, 2009 at 09:50:12AM +0400, Eygene Ryabinkin wrote:
> > > Wed, May 20, 2009 at 05:39:08PM +0200, Mike Massonnet wrote:
> > > > Wow, nice! I didn't take time yet to investigate, thanks for a lot for
> > > > providing this patch. I will make a package for stable asap.
> > > 
> > > Erm, sorry, sent old patch variant that doesn't produce .Xauthority:
> > > 'quit' should be replaced with 'exit'.  Sorry, wasn't updated the
> > > patchfile.  Here is the proper one:
> > 
> > And found one more issue -- mcookie was weakened because I am blindly
> > substituted 'int r' for 'bool r'.  Fixed now.
> 

> Thanks very much, the patch looks good! While you're at it, mind to
> fix the insecure "random" hexstring generation as well?

Sure, did it already, tested and just wanted to send it out.

From 5beb217296e3074cadc5bcb3e40355f54ee705f0 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea@shadow.codelabs.ru>
Date: Thu, 21 May 2009 11:56:27 +0400
Subject: [PATCH] Create interface for random number generator and use it everywhere

Don't use rand()/srand() at all -- they are very weak.  Provide our
wrappers for random()/srandom() and make utility function that will
generate seed for srandom.

Rework MIT magic cookie generation: consume 4 bytes of input in one
pass -- random() should produce values that are usable for this purpose.

Signed-off-by: Eygene Ryabinkin <rea@shadow.codelabs.ru>
---
 app.cpp  |   49 ++++++++++++++++++++++++++-----------------------
 app.h    |    2 ++
 util.cpp |   37 +++++++++++++++++++++++++++++++++++++
 util.h   |    5 +++++
 4 files changed, 70 insertions(+), 23 deletions(-)

diff --git a/app.cpp b/app.cpp
index 04caaa1..0ac8c3a 100644
--- a/app.cpp
+++ b/app.cpp
@@ -129,15 +129,18 @@ void User1Signal(int sig) {
 
 
 #ifdef USE_PAM
-App::App(int argc, char** argv):
-    pam(conv, static_cast<void*>(&LoginPanel)){
+App::App(int argc, char** argv)
+  : pam(conv, static_cast<void*>(&LoginPanel)),
 #else
-App::App(int argc, char** argv){
+App::App(int argc, char** argv)
+  :
 #endif
+    mcookiesize(32)		// Must be divisible by 4
+{
     int tmp;
     ServerPID = -1;
     testing = false;
-    mcookie = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
+    mcookie = string(App::mcookiesize, 'a');
     daemonmode = false;
     force_nodaemon = false;
     firstlogin = true;
@@ -1128,13 +1131,13 @@ string App::findValidRandomTheme(const string& set)
         name = name.substr(0, name.length() - 1);
     }
 
-    srandom(getpid()+time(NULL));
+    Util::srandom(Util::makeseed());
 
     vector<string> themes;
     string themefile;
     Cfg::split(themes, name, ',');
     do {
-        int sel = random() % themes.size();
+        int sel = Util::random() % themes.size();
 
         name = Cfg::Trim(themes[sel]);
         themefile = string(THEMESDIR) +"/" + name + THEMESFILE;
@@ -1161,27 +1164,27 @@ void App::replaceVariables(string& input,
 }
 
 
+/*
+ * We rely on the fact that all bits generated by Util::random()
+ * are usable, so we are taking full words from its output.
+ */
 void App::CreateServerAuth() {
     /* create mit cookie */
-    int i, r;
-    int hexcount = 0;
-        string authfile;
-    string cmd;
+    uint16_t word;
+    uint8_t hi, lo;
+    int i;
+    string authfile;
     const char *digits = "0123456789abcdef";
-        srand( time(NULL) );
-    for ( i = 0; i < 31; i++ ) {
-        r = rand()%16;
-                mcookie[i] = digits[r];
-                if (r>9)
-                        hexcount++;
+    Util::srandom(Util::makeseed());
+    for (i = 0; i < App::mcookiesize; i+=4) {
+        word = Util::random() & 0xffff;
+        lo = word & 0xff;
+        hi = word >> 8;
+        mcookie[i] = digits[lo & 0x0f];
+        mcookie[i+1] = digits[lo >> 4];
+        mcookie[i+2] = digits[hi & 0x0f];
+        mcookie[i+3] = digits[hi >> 4];
     }
-        /* MIT-COOKIE: even occurrences of digits and hex digits */
-        if ((hexcount%2) == 0) {
-                r = rand()%10;
-        } else {
-                r = rand()%5+10;
-        }
-        mcookie[31] = digits[r];
     /* reinitialize auth file */
     authfile = cfg->getOption("authfile");
     remove(authfile.c_str());
diff --git a/app.h b/app.h
index 7b4bd10..9a44269 100644
--- a/app.h
+++ b/app.h
@@ -101,6 +101,8 @@ private:
     
     std::string themeName;
     std::string mcookie;
+
+    const int mcookiesize;
 };
 
 
diff --git a/util.cpp b/util.cpp
index 309ce4f..5ed972f 100644
--- a/util.cpp
+++ b/util.cpp
@@ -7,7 +7,13 @@
    (at your option) any later version.
 */
 
+#include <sys/types.h>
+
 #include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
 #include "util.h"
 
 /*
@@ -30,3 +36,34 @@ bool Util::add_mcookie(const std::string &mcookie, const char *display,
 	pclose(fp);
 	return true;
 }
+
+/*
+ * Interface for random number generator.  Just now it uses ordinary
+ * random/srandom routines and serves as a wrapper for them.
+ */
+void Util::srandom(unsigned long seed)
+{
+	::srandom(seed);
+}
+
+long Util::random(void)
+{
+	return ::random();
+}
+
+/*
+ * Makes seed for the srandom() using "random" values obtained from
+ * getpid(), time(NULL) and others.
+ */
+long Util::makeseed(void)
+{
+	struct timespec ts;
+	long pid = getpid();
+	long tm = time(NULL);
+
+	if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
+		ts.tv_sec = ts.tv_nsec = 0;
+	}
+
+	return pid + tm + (ts.tv_sec ^ ts.tv_nsec);
+}
diff --git a/util.h b/util.h
index 8bd52be..b8d2993 100644
--- a/util.h
+++ b/util.h
@@ -14,6 +14,11 @@
 namespace Util {
 	bool add_mcookie(const std::string &mcookie, const char *display,
 	    const std::string &xauth_cmd, const std::string &authfile);
+
+	void srandom(unsigned long seed);
+	long random(void);
+
+	long makeseed(void);
 };
 
 #endif /* __UTIL_H__ */
-- 
1.6.3.1
-- 
rea




Information forwarded to debian-bugs-dist@lists.debian.org, Mike Massonnet <mmassonnet@gmail.com>:
Bug#529306; Package slim. (Tue, 02 Jun 2009 21:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Moritz Muehlenhoff <jmm@inutil.org>:
Extra info received and forwarded to list. Copy sent to Mike Massonnet <mmassonnet@gmail.com>. (Tue, 02 Jun 2009 21:27:02 GMT) Full text and rfc822 format available.

Message #40 received at 529306@bugs.debian.org (full text, mbox):

From: Moritz Muehlenhoff <jmm@inutil.org>
To: Mike Massonnet <mmassonnet@gmail.com>
Cc: Eygene Ryabinkin <rea@codelabs.ru>, 529306@bugs.debian.org
Subject: Re: Bug#529306: [PATCH] Do not specify magic cookie for xauth in the xauth command line
Date: Tue, 2 Jun 2009 23:21:10 +0200
On Wed, May 20, 2009 at 05:39:08PM +0200, Mike Massonnet wrote:
> Wow, nice! I didn't take time yet to investigate, thanks for a lot for
> providing this patch. I will make a package for stable asap.

Hi Mike,
this issue doesn't warrant a stable-security update through a DSA.
However, you could fix this through a stable point update. If you want to do
that please send a proposed debdiff to debian-release@lists.debian.org
so that the stable release managers can review it.

Cheers,
        Moritz




Tags added: pending Request was from Mike Massonnet <mmassonnet@gmail.com> to control@bugs.debian.org. (Mon, 08 Jun 2009 21:06:09 GMT) Full text and rfc822 format available.

Reply sent to Marco Rodrigues <gothicx@sapo.pt>:
You have taken responsibility. (Tue, 18 Aug 2009 21:46:10 GMT) Full text and rfc822 format available.

Notification sent to Nico Golde <nion@debian.org>:
Bug acknowledged by developer. (Tue, 18 Aug 2009 21:46:10 GMT) Full text and rfc822 format available.

Message #47 received at 529306-done@bugs.debian.org (full text, mbox):

From: Marco Rodrigues <gothicx@sapo.pt>
To: 529306-done@bugs.debian.org
Subject: Package slim has been removed from Debian
Date: Tue, 18 Aug 2009 22:41:18 +0100
Version: 1.3.0-2+rm

You filled the bug http://bugs.debian.org/529306 in Debian BTS
against the package slim. I'm closing it as fixed in *unstable*,
but it will remain open for older distributions.

For more information about this package's removal, read
http://bugs.debian.org/538921. That bug might give the reasons why
this package was removed and suggestions of possible replacements.

Don't hesitate to reply to this mail if you have any question.

Thank you for your contribution to Debian.

--
Marco Rodrigues




Bug No longer marked as fixed in versions 1.3.0-2+rm. Request was from Piotr Engelking <inkerman42@gmail.com> to control@bugs.debian.org. (Tue, 08 Sep 2009 06:57:31 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 08 Sep 2009 16:45:35 GMT) Full text and rfc822 format available.

Reply sent to Nobuhiro Iwamatsu <iwamatsu@debian.org>:
You have taken responsibility. (Fri, 16 Oct 2009 04:39:11 GMT) Full text and rfc822 format available.

Notification sent to Nico Golde <nion@debian.org>:
Bug acknowledged by developer. (Fri, 16 Oct 2009 04:39:11 GMT) Full text and rfc822 format available.

Message #56 received at 529306-close@bugs.debian.org (full text, mbox):

From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
To: 529306-close@bugs.debian.org
Subject: Bug#529306: fixed in slim 1.3.1-2
Date: Fri, 16 Oct 2009 04:17:48 +0000
Source: slim
Source-Version: 1.3.1-2

We believe that the bug you reported is fixed in the latest version of
slim, which is due to be installed in the Debian FTP archive:

slim_1.3.1-2.diff.gz
  to pool/main/s/slim/slim_1.3.1-2.diff.gz
slim_1.3.1-2.dsc
  to pool/main/s/slim/slim_1.3.1-2.dsc
slim_1.3.1-2_i386.deb
  to pool/main/s/slim/slim_1.3.1-2_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 529306@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nobuhiro Iwamatsu <iwamatsu@debian.org> (supplier of updated slim package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 21 Sep 2009 15:52:33 +0900
Source: slim
Binary: slim
Architecture: source i386
Version: 1.3.1-2
Distribution: unstable
Urgency: low
Maintainer: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Changed-By: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Description: 
 slim       - desktop-independent graphical login manager for X11
Closes: 505332 510469 529306 536542
Changes: 
 slim (1.3.1-2) unstable; urgency=low
 .
   * Add Jens Peter Secher to Uploaders list.
   * Update es.po (Closes: #510469)
   * Fix FTBFS with GCC 4.4. (Closes: #505332)
   * Fix insecure xauth secret. (Closes: #529306)
   * Fix allows login as root without password. (Closes: #536542)
      - Wrote explanation about this problem to README.Debian.
Checksums-Sha1: 
 5119604aacafbdaa7262c6354ea393c2ac9e0d74 1116 slim_1.3.1-2.dsc
 ed59be2979a66da6991f6845f5a3139428423ca3 661700 slim_1.3.1-2.diff.gz
 cd3bccc47f109c65e5b8332c968949be73328a45 817378 slim_1.3.1-2_i386.deb
Checksums-Sha256: 
 05bc56c6e0b8b1f7885528db5c95ce1eaf8a126a2d3ab64b82c0e0619124bf89 1116 slim_1.3.1-2.dsc
 dec450826bf00393f7a4e5ddab0266c33bdec1b4340c886e1d6cd6b44d74d6a5 661700 slim_1.3.1-2.diff.gz
 731d0ec9702594dd51154957b542a38896c4ee92cf36c8f98260751557b8edbf 817378 slim_1.3.1-2_i386.deb
Files: 
 6a2e27f370abb242163e3c2b10ddc266 1116 x11 optional slim_1.3.1-2.dsc
 1feb39759d74b09e4823008f549573a6 661700 x11 optional slim_1.3.1-2.diff.gz
 38f1310801713ba27b9cf03dce0385ea 817378 x11 optional slim_1.3.1-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkrX7qUACgkQQSHHQzFw6+npRQCfeL+5qMhjIkD/J0lG0cNoLpzc
yDgAnigOADGH0YOhAkGVfylIGGcmWET8
=RjkV
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 17 Nov 2009 07:28:50 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 13:17:44 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.