summaryrefslogtreecommitdiff
path: root/daemon/auth.c
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2003-10-17 17:47:04 +0000
committerGeorge Lebl <jirka@src.gnome.org>2003-10-17 17:47:04 +0000
commit70be6b2519791ced3daae526cf1c4e4b97a5c830 (patch)
tree5ac607c6677824a634f437ff0ed4d3eea77fcf5b /daemon/auth.c
parentf67e41aff62e56e997c0acf4297a3a0a41fe22cc (diff)
downloadgdm-70be6b2519791ced3daae526cf1c4e4b97a5c830.tar.gz
Apply patch from Frederic Crozat <fcrozat@mandrakesoft.com> to make gecos
Fri Oct 17 10:40:08 2003 George Lebl <jirka@5z.com> * gui/gdmlogin.c, gui/greeter/greeter_item_ulist.c: Apply patch from Frederic Crozat <fcrozat@mandrakesoft.com> to make gecos into utf8 before displaying it in the face browser. * daemon/auth.c: make sure that umask 077 before reopening the .Xauthority since apparently it can happen that the file doesn't exist then.
Diffstat (limited to 'daemon/auth.c')
-rw-r--r--daemon/auth.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/daemon/auth.c b/daemon/auth.c
index d7800259..8bdfeb35 100644
--- a/daemon/auth.c
+++ b/daemon/auth.c
@@ -725,6 +725,7 @@ gdm_auth_user_remove (GdmDisplay *d, uid_t user)
FILE *af;
gchar *authfile;
gchar *authdir;
+ mode_t oldmode;
if G_UNLIKELY (!d || !d->userauth)
return;
@@ -784,7 +785,9 @@ gdm_auth_user_remove (GdmDisplay *d, uid_t user)
return;
}
+ oldmode = umask (077);
af = gdm_safe_fopen_ap (d->userauth);
+ umask (oldmode);
if G_UNLIKELY (af == NULL) {
XauUnlockAuth (d->userauth);
@@ -858,6 +861,7 @@ gdm_auth_purge (GdmDisplay *d, FILE *af, gboolean remove_when_empty)
{
Xauth *xa;
GSList *keep = NULL, *li;
+ mode_t oldmode;
int cnt;
if G_UNLIKELY (!d || !af)
@@ -904,7 +908,9 @@ gdm_auth_purge (GdmDisplay *d, FILE *af, gboolean remove_when_empty)
return NULL;
}
+ oldmode = umask (077);
af = gdm_safe_fopen_w (d->userauth);
+ umask (oldmode);
/* Write out remaining entries */
for (li = keep; li != NULL; li = li->next) {