summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2003-05-13 19:24:41 +0000
committerGeorge Lebl <jirka@src.gnome.org>2003-05-13 19:24:41 +0000
commit925d8c210cbd3cd050bc90d2ec35c35dbbd2f119 (patch)
treeaddb27e19ea1820d5211a316aaceefb432264f7a /utils
parent7a6db24a73eb0e7ff812457dd61209997daf1ceb (diff)
downloadgdm-925d8c210cbd3cd050bc90d2ec35c35dbbd2f119.tar.gz
when more then 50 users don't put them all in the combo boxes, this is a
Tue May 13 12:22:45 2003 George Lebl <jirka@5z.com> * gui/gdmsetup.c: when more then 50 users don't put them all in the combo boxes, this is a semi-solution to #111830 * daemon/verify-shadow.c: Apply patch from cschelcher@free.fr to fall back to standard password when shadow is not available. Apparently fixes NIS stuff, but I really think people should be using pam, but I digress. Fixes #109765 * daemon/auth.c, daemon/misc.c, daemon/server.c, daemon/slave.c: use strerror instead of g_strerror as that returns always UTF-8 and we want current locale. We already assume strerror is on the system so this is not a portability issue anyway. Fixes #106655 * utils/gdmopen.c: apply patch from Owen Taylor to fix #106656 by not deallocating the vt after we are done as apparently this is what open does and the kernel has a fit otherwise anyway. It's braindead, but oh well, this is the way it apparently works right. * daemon/gdm.c: apply patch from Owen Taylor to fix #106656 by setting TEXTDOMAIN to GETTEXT_PACKAGE rather then PACKAGE before running scripts * utils/gdmopen.c, daemon/misc.c: Apply patch from Owen Taylor to fix #106658, but fix it portably by adding the -l option to gdmopen as suggested by Owen. So all gdmopens we do are now using login shells which makes me wonder if we should just build that into gdmopen, since it's a special purpose utility anyhow.
Diffstat (limited to 'utils')
-rw-r--r--utils/gdmopen.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/utils/gdmopen.c b/utils/gdmopen.c
index 00f91b2a..fdc382d5 100644
--- a/utils/gdmopen.c
+++ b/utils/gdmopen.c
@@ -59,7 +59,7 @@ static pid_t child_pid = -1;
struct vt_stat vt;
static int vtno;
static int fd = 0;
-static int do_dealloc = FALSE;
+static int do_switchback = FALSE;
static void
sighandler (int sig)
@@ -69,14 +69,11 @@ sighandler (int sig)
waitpid (child_pid, NULL, 0);
}
- if (do_dealloc) {
+ if (do_switchback) {
/* Switch back... */
(void) ioctl(fd, VT_ACTIVATE, vt.v_active);
/* wait to be really sure we have switched */
(void) ioctl(fd, VT_WAITACTIVE, vt.v_active);
-
- /* Now deallocate our new one */
- (void) ioctl(fd, VT_DISALLOCATE, vtno);
}
/* Kill myself with this signal */
@@ -89,6 +86,8 @@ main (int argc, char *argv[])
{
char vtname[256];
int status;
+ int cmd_start = 1;
+ char *command = NULL;
if (getuid () != geteuid () ||
getuid () != 0) {
@@ -105,6 +104,21 @@ main (int argc, char *argv[])
return 66;
}
+ command = argv[1];
+
+ if (strcmp (argv[1], "-l") == 0) {
+ if (argc <= 2) {
+ fprintf (stderr, "gdmopen: must supply a command!\n");
+ return 66;
+ }
+ /* prepend '-' and start the command at
+ * argument 2 */
+ cmd_start = 2;
+ command = malloc (strlen (argv[2]) + 2);
+ strcpy (command+1, argv[2]);
+ command[0] = '-';
+ }
+
fd = open ("/dev/console", O_WRONLY, 0);
if (fd < 0) {
perror ("gdmopen: Failed to open /dev/console");
@@ -176,7 +190,7 @@ main (int argc, char *argv[])
write (0, "\033(K", 3);
#endif /* __linux__ */
- execvp (argv[1], &argv[1]);
+ execvp (command, &argv[1]);
_exit (66); /* failed */
}
@@ -186,21 +200,18 @@ main (int argc, char *argv[])
return 66;
}
- do_dealloc = TRUE;
+ do_switchback = TRUE;
waitpid (child_pid, &status, 0);
child_pid = -1;
- do_dealloc = FALSE;
+ do_switchback = FALSE;
/* Switch back... */
(void) ioctl(fd, VT_ACTIVATE, vt.v_active);
/* wait to be really sure we have switched */
(void) ioctl(fd, VT_WAITACTIVE, vt.v_active);
- /* Now deallocate our new one */
- (void) ioctl(fd, VT_DISALLOCATE, vtno);
-
close (fd);
if (WIFEXITED (status))