Commit 883d9163 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Ensure proper .ICEauthority permissions, this may fail on NFS, but who


Wed May 26 17:34:51 2004  George Lebl <jirka@5z.com>

	* daemon/slave.c: Ensure proper .ICEauthority permissions, this
	  may fail on NFS, but who cares, there if it breaks it's beyond
	  our fixage anyway.  Should alievate problems from #137345, though
	  that bug is really in libice usage and gnome-session.  libice is
	  incredibly evil.

	* utils/gdmtranslate.c: fix with the forte compiler, patch fromn
	  Brian Cameron, fixes #137600
parent 7727d7fb
Wed May 26 17:34:51 2004 George Lebl <jirka@5z.com>
* daemon/slave.c: Ensure proper .ICEauthority permissions, this
may fail on NFS, but who cares, there if it breaks it's beyond
our fixage anyway. Should alievate problems from #137345, though
that bug is really in libice usage and gnome-session. libice is
incredibly evil.
* utils/gdmtranslate.c: fix with the forte compiler, patch fromn
Brian Cameron, fixes #137600
Wed May 26 17:01:16 2004 George Lebl <jirka@5z.com>
* gui/gdmsetup.c, daemon/misc.c: use shell quoting more properly
......
......@@ -3529,6 +3529,32 @@ session_child_run (struct passwd *pwent,
VE_IGNORE_EINTR (chdir (home_dir));
if G_UNLIKELY (errno != 0) {
VE_IGNORE_EINTR (chdir ("/"));
} else if (pwent->pw_uid != 0) {
if (seteuid (pwent->pw_uid) == 0 &&
access (".ICEauthority", F_OK) == 0) {
/* sanitize .ICEauthority to be of the correct
* permissions, if it exists */
struct stat s;
if (stat (home_dir, &s) == 0 &&
s.st_uid == pwent->pw_uid &&
stat (".ICEauthority", &s) &&
S_ISREG (s.st_mode) &&
(s.st_uid != pwent->pw_uid ||
s.st_gid != pwent->pw_gid ||
(s.st_mode & (S_IRWXG|S_IRWXO)))) {
/* This may not work on NFS, but oh well, there
* this is beyond our help, but it's unlikely
* that it got screwed up when NFS was used
* in the first place */
seteuid (0);
/* only if we own the current directory */
chown (".ICEauthority",
pwent->pw_uid,
pwent->pw_gid);
chmod (".ICEauthority", S_IRUSR | S_IWUSR);
}
}
seteuid (0);
}
#ifdef HAVE_LOGINCAP
......
#include "config.h"
#include <libgnome/libgnome.h>
#include <stdio.h>
#include <locale.h>
#include <string.h>
#define gboolean char
#define FALSE 0
#define TRUE 1
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) gettext(String)
#else /* !ENABLE_NLS */
#define _(String) (String)
#endif
int
main (int argc, char *argv[])
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment