diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | daemon/gdm.c | 55 | ||||
-rw-r--r-- | docs/C/gdm.xml | 22 | ||||
-rw-r--r-- | docs/es/gdm.xml | 24 | ||||
-rw-r--r-- | docs/uk/gdm.xml | 24 | ||||
-rw-r--r-- | gui/gdmXnestchooser.c | 51 | ||||
-rw-r--r-- | gui/gdmchooser.c | 48 | ||||
-rw-r--r-- | gui/gdmconfig.c | 2 | ||||
-rw-r--r-- | gui/gdmflexiserver.c | 44 |
9 files changed, 143 insertions, 140 deletions
@@ -1,3 +1,16 @@ +2006-05-12 Christian Kirbach <Christian.Kirbach@siemens.com> + + * daemon/gdm.c, gui/gdmXnestchosser.c, gui/gdmchooser.c, + gui/gdmflexiserver.c: stop using popt in favour of glib's GOption + command line parsing. + * docs/C/gdm.xml: -nodaemon command line option has become --nodaemon. + GDM User Commands section has been rewritten accordingly. Also the + interface stability sections reflects the new changes. + * daemon/gdm.c (gdm_handle_user_message): Fix compiler warning (too + few arguments). + * gui/gdmconfig.c (gdm_config_get_xservers): Remove two obsolete + variable declarations. + 2006-05-12 Brian Cameron <brian.cameron@sun.com> * Release 2.15.2: diff --git a/daemon/gdm.c b/daemon/gdm.c index 99674193..471cc3ac 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -21,7 +21,6 @@ #include <signal.h> #include <limits.h> #include <stdlib.h> -#include <popt.h> #include <unistd.h> #if defined (_POSIX_PRIORITY_SCHEDULING) && defined (HAVE_SCHED_YIELD) #include <sched.h> @@ -1231,23 +1230,22 @@ calc_sqrt2 (void) } } -struct poptOption options [] = { - { "nodaemon", '\0', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, - &no_daemon, 0, N_("Do not fork into the background"), NULL }, - { "no-console", '\0', POPT_ARG_NONE, - &no_console, 0, N_("No console (static) servers to be run"), NULL }, - { "config", '\0', POPT_ARG_STRING, - &config_file, 0, N_("Alternative defaults configuration file"), N_("CONFIGFILE") }, - { "preserve-ld-vars", '\0', POPT_ARG_NONE, - &preserve_ld_vars, 0, N_("Preserve LD_* variables"), NULL }, - { "version", '\0', POPT_ARG_NONE, - &print_version, 0, N_("Print GDM version"), NULL }, - { "wait-for-go", '\0', POPT_ARG_NONE, - &gdm_wait_for_go, 0, N_("Start the first X server but then halt until we get a GO in the fifo"), NULL }, - { "monte-carlo-sqrt2", 0, POPT_ARG_NONE, - &monte_carlo_sqrt2, 0, NULL, NULL }, - POPT_AUTOHELP - { NULL, 0, 0, NULL, 0} +GOptionEntry options [] = { + { "nodaemon", '\0', 0, G_OPTION_ARG_NONE, + &no_daemon, N_("Do not fork into the background"), NULL }, + { "no-console", '\0', 0, G_OPTION_ARG_NONE, + &no_console, N_("No console (static) servers to be run"), NULL }, + { "config", '\0', 0, G_OPTION_ARG_STRING, + &config_file, N_("Alternative defaults configuration file"), N_("CONFIGFILE") }, + { "preserve-ld-vars", '\0', 0, G_OPTION_ARG_NONE, + &preserve_ld_vars, N_("Preserve LD_* variables"), NULL }, + { "version", '\0', 0, G_OPTION_ARG_NONE, + &print_version, N_("Print GDM version"), NULL }, + { "wait-for-go", '\0', 0, G_OPTION_ARG_NONE, + &gdm_wait_for_go, N_("Start the first X server but then halt until we get a GO in the fifo"), NULL }, + { "monte-carlo-sqrt2", 0, 0, G_OPTION_ARG_NONE, + &monte_carlo_sqrt2, NULL, NULL }, + { NULL } }; static gboolean @@ -1374,9 +1372,8 @@ main (int argc, char *argv[]) FILE *pf; sigset_t mask; struct sigaction sig, child, abrt; - poptContext ctx; + GOptionContext *ctx; gchar *pidfile; - int nextopt; const char *charset; /* semi init pseudorandomness */ @@ -1401,20 +1398,10 @@ main (int argc, char *argv[]) /* Initialize runtime environment */ umask (022); - ctx = poptGetContext ("gdm", argc, (const char **) argv, - options, 0); - while ((nextopt = poptGetNextOpt (ctx)) > 0 || nextopt == POPT_ERROR_BADOPT) - /* do nothing */ ; - - if G_UNLIKELY (nextopt != -1) { - fprintf (stderr, - _("Error on option %s: %s.\nRun '%s --help' to see a full list of available command line options.\n"), - poptBadOption (ctx, 0), - poptStrerror (nextopt), - argv[0]); - fflush (stderr); - exit (1); - } + ctx = g_option_context_new (_("- The GNOME login manager")); + g_option_context_add_main_entries (ctx, options, _("main options")); + g_option_context_parse (ctx, &argc, &argv, NULL); + g_option_context_free (ctx); if (monte_carlo_sqrt2) { calc_sqrt2 (); diff --git a/docs/C/gdm.xml b/docs/C/gdm.xml index d82d0fde..43d0c3fc 100644 --- a/docs/C/gdm.xml +++ b/docs/C/gdm.xml @@ -184,6 +184,18 @@ </para> <para> + As of the GDM 2.15 development series one-dash arguments are no + longer supported. This includes the "-nodaemon" argument + used by <command>gdm</command> and <command>gdm-binary</command>. It + also includes the "-xdmaddress", "-clientaddress", + and "-connectionType" arguments used by + <command>gdmchooser</command>. These arguments have been changed to + now use two dashes. GDM previously supported the one-dash arguments to + be more similar with the XDM login manager, but one-dash command line + arguments is deprecated in the GNOME stack. + </para> + + <para> If issues are discovered that break compatibility, please file a bug with an "urgent" priority. </para> @@ -5315,12 +5327,12 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-nodaemon</term> + <term>--nodaemon</term> <listitem> <para> If this option is specified, then GDM does not fork into the - background when run. You can use just a single dash with this - option to preserve compatibility with XDM. + background when run. Note that you cannot use the single-dash + option any more that e.g. XDM understands. </para> </listitem> </varlistentry> @@ -5469,7 +5481,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. <title><command>gdmchooser</command> Command Line Options</title> <varlistentry> - <term>-xdmaddress=SOCKET</term> + <term>--xdmaddress=SOCKET</term> <listitem> <para> Socket for XDM communication. @@ -5488,7 +5500,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-connectionType=TYPE</term> + <term>--connectionType=TYPE</term> <listitem> <para> Connection type to return in response to XDM. This option is for diff --git a/docs/es/gdm.xml b/docs/es/gdm.xml index 0a0e4d0c..f689ae4c 100644 --- a/docs/es/gdm.xml +++ b/docs/es/gdm.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ <!ENTITY legal SYSTEM "legal.xml"> -<!ENTITY version "2.15.0"> -<!ENTITY date "03/20/2006"> +<!ENTITY version "2.15.1"> +<!ENTITY date "05/12/2006"> ]> <article id="index" lang="es"> <articleinfo> @@ -64,13 +64,13 @@ - <releaseinfo>This manual describes version 2.15.0 of the GNOME Display Manager. It was last updated on 03/20/2006.</releaseinfo> + <releaseinfo>This manual describes version 2.15.1 of the GNOME Display Manager. It was last updated on 05/12/2006.</releaseinfo> </articleinfo> <sect1 id="preface"> <title>Términos y convenciones usados en este manual</title> - <para>This manual describes version 2.15.0 of the GNOME Display Manager. It was last updated on 03/20/2006.</para> + <para>This manual describes version 2.15.1 of the GNOME Display Manager. It was last updated on 05/12/2006.</para> <para>Selector - Un programa que se usa para seleccionar un equipo remoto para gestionar una pantalla remotamente en la pantalla local (<command>gdmchooser</command>).</para> @@ -111,6 +111,8 @@ <para>Nota: las distribuciones a menudo cambian los valores predeterminados de las claves para soportar su plataforma. Los interfaces de línea de comandos para los programas GDM instalados en <filename><bin></filename> y <filename><sbin></filename> se consideran estables. Refiérase a su documentación de la distribución para ver si hay cualquier cambio específico de la distribución a estos interfaces de GDM y qué soporte existe para ellos.</para> + <para>As of the GDM 2.15 development series one-dash arguments are no longer supported. This includes the "-nodaemon" argument used by <command>gdm</command> and <command>gdm-binary</command>. It also includes the "-xdmaddress", "-clientaddress", and "-connectionType" arguments used by <command>gdmchooser</command>. These arguments have been changed to now use two dashes. GDM previously supported the one-dash arguments to be more similar with the XDM login manager, but one-dash command line arguments is deprecated in the GNOME stack.</para> + <para>Si se descubrieran problemas que rompiesen la compatibilidad, por favor envíe un error con una prioridad «urgente».</para> </sect2> @@ -405,7 +407,7 @@ gdm: .su.dominio <sect1 id="configuration"> <title>Configuración</title> - <para>GDM has powerful configuration management. System configuration is stored in <filename><share>/gdm/defaults.conf</filename> and the intention is that this file can be stored on a shared filesystem so that sysadmins can have a single file to modify to control configuration for multiple machines. Also GDM distributions may patch this file on update to improve usability, improve security, etc. Configuration may be customized for a specific machine by editing the <filename><etc>/gdm/custom.conf</filename> file to include an override for a specific key. Those parameters in the "gui", "greeter" sections, and the security/PamStack key may be customized per-display by specifying them in a file named <filename><etc>/gdm/custom.conf<display num></filename>. For example, configuration overrides for display ":103" would be stored in the file <filename><etc>/gdm/custom.conf:0</filename>.</para> + <para>GDM has powerful configuration management. System configuration is stored in <filename><share>/gdm/defaults.conf</filename> and the intention is that this file can be stored on a shared filesystem so that sysadmins can have a single file to modify to control configuration for multiple machines. Also GDM distributions may patch this file on update to improve usability, improve security, etc. Configuration may be customized for a specific machine by editing the <filename><etc>/gdm/custom.conf</filename> file to include an override for a specific key. Those parameters in the "gui", "greeter" sections, and the security/PamStack key may be customized per-display by specifying them in a file named <filename><etc>/gdm/custom.conf<display num></filename>. For example, configuration overrides for display ":103" would be stored in the file <filename><etc>/gdm/custom.conf:0</filename>. Per-display configuration is supported in GDM 2.14.6 and later.</para> <para>The <command>gdmsetup</command> is a GUI program you can use to edit the GDM configuration. This program may also be launched directly from the login screen if the greeter/ConfigAvailable key is set to "true" Not all keys in the GDM configuration file are supported in the GUI, so you may need to edit the configuration files by hand to edit these keys. If you believe running root-owned GUI's causes security risk, then you would want to always edit the files by hand. This program does not support setting per-display configuration, so per-display configuration files must be set up by hand.</para> @@ -2771,9 +2773,9 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-nodaemon</term> + <term>--nodaemon</term> <listitem> - <para>Si se especifica esta opción, entonces GDM no se bifurca a un segundo plano cuando se ejecuta. Puede usar tan sólo un simple guión con esta opción para preservar compatibilidad con XDM.</para> + <para>If this option is specified, then GDM does not fork into the background when run. Note that you cannot use the single-dash option any more that e.g. XDM understands.</para> </listitem> </varlistentry> @@ -2859,7 +2861,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. <title>Opciones de línea de comandos de <command>gdmchooser</command></title> <varlistentry> - <term>-xdmaddress=SOCKET</term> + <term>--xdmaddress=SOCKET</term> <listitem> <para>Socket para comunicación XDM.</para> </listitem> @@ -2873,7 +2875,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-connectionType=TIPO</term> + <term>--connectionType=TYPE</term> <listitem> <para>Connection type to return in response to XDM. This option is for running gdmchooser with XDM, and is not used within GDM.</para> </listitem> @@ -2980,7 +2982,7 @@ homogeneous="bool"> <varlistentry> <term>button</term> <listitem> - <para>A button field. This field uses a GTK+ button. It is also possible to make a "rect" item act like a button by setting its button element to true. However it is better to use GTK+ buttons in GDM themes since these are accessible to users with disabilities. Also, GTK+ buttons can be themed.</para> + <para>A button field. This field uses a GTK+ button. It is also possible to make a "rect" item act like a button by setting its button element to true. However it is better to use GTK+ buttons in GDM themes since these are accessible to users with disabilities. Also, GTK+ buttons can be themed. This feature is supported in GDM 2.14.6 and later.</para> </listitem> </varlistentry> @@ -3083,7 +3085,7 @@ homogeneous="bool"> <varlistentry> <term>pam-error-logo</term> <listitem> - <para>An image that will be displayed only when a pam-error message is being displayed. This is useful for displaying an "Attention" icon, for example.</para> + <para>An image that will be displayed only when a pam-error message is being displayed. This is useful for displaying an "Attention" icon, for example. This feature is supported in GDM 2.14.6 and later.</para> </listitem> </varlistentry> diff --git a/docs/uk/gdm.xml b/docs/uk/gdm.xml index e4c57733..152cc415 100644 --- a/docs/uk/gdm.xml +++ b/docs/uk/gdm.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ <!ENTITY legal SYSTEM "legal.xml"> -<!ENTITY version "2.15.0"> -<!ENTITY date "03/20/2006"> +<!ENTITY version "2.15.1"> +<!ENTITY date "05/12/2006"> ]> <article id="index" lang="uk"> <articleinfo> @@ -64,13 +64,13 @@ - <releaseinfo>This manual describes version 2.15.0 of the GNOME Display Manager. It was last updated on 03/20/2006.</releaseinfo> + <releaseinfo>This manual describes version 2.15.1 of the GNOME Display Manager. It was last updated on 05/12/2006.</releaseinfo> </articleinfo> <sect1 id="preface"> <title>Терміни та домовленості використані у цьому посібнику</title> - <para>This manual describes version 2.15.0 of the GNOME Display Manager. It was last updated on 03/20/2006.</para> + <para>This manual describes version 2.15.1 of the GNOME Display Manager. It was last updated on 05/12/2006.</para> <para>Селектор - програма, що використовується для керування дисплеєм віддаленого вузла з локального дисплея (<command>gdmchooser</command>).</para> @@ -111,6 +111,8 @@ <para>Note: distributions often change the default values of keys to support their platform. Command-line interfaces for GDM programs installed to <filename><bin></filename> and <filename><sbin></filename> are considered stable. Refer to your distribution documentation to see if there are any distribution-specific changes to these GDM interfaces and what support exists for them.</para> + <para>As of the GDM 2.15 development series one-dash arguments are no longer supported. This includes the "-nodaemon" argument used by <command>gdm</command> and <command>gdm-binary</command>. It also includes the "-xdmaddress", "-clientaddress", and "-connectionType" arguments used by <command>gdmchooser</command>. These arguments have been changed to now use two dashes. GDM previously supported the one-dash arguments to be more similar with the XDM login manager, but one-dash command line arguments is deprecated in the GNOME stack.</para> + <para>If issues are discovered that break compatibility, please file a bug with an "urgent" priority.</para> </sect2> @@ -405,7 +407,7 @@ gdm: .your.domain <sect1 id="configuration"> <title>Налаштовування</title> - <para>GDM has powerful configuration management. System configuration is stored in <filename><share>/gdm/defaults.conf</filename> and the intention is that this file can be stored on a shared filesystem so that sysadmins can have a single file to modify to control configuration for multiple machines. Also GDM distributions may patch this file on update to improve usability, improve security, etc. Configuration may be customized for a specific machine by editing the <filename><etc>/gdm/custom.conf</filename> file to include an override for a specific key. Those parameters in the "gui", "greeter" sections, and the security/PamStack key may be customized per-display by specifying them in a file named <filename><etc>/gdm/custom.conf<display num></filename>. For example, configuration overrides for display ":103" would be stored in the file <filename><etc>/gdm/custom.conf:0</filename>.</para> + <para>GDM has powerful configuration management. System configuration is stored in <filename><share>/gdm/defaults.conf</filename> and the intention is that this file can be stored on a shared filesystem so that sysadmins can have a single file to modify to control configuration for multiple machines. Also GDM distributions may patch this file on update to improve usability, improve security, etc. Configuration may be customized for a specific machine by editing the <filename><etc>/gdm/custom.conf</filename> file to include an override for a specific key. Those parameters in the "gui", "greeter" sections, and the security/PamStack key may be customized per-display by specifying them in a file named <filename><etc>/gdm/custom.conf<display num></filename>. For example, configuration overrides for display ":103" would be stored in the file <filename><etc>/gdm/custom.conf:0</filename>. Per-display configuration is supported in GDM 2.14.6 and later.</para> <para>The <command>gdmsetup</command> is a GUI program you can use to edit the GDM configuration. This program may also be launched directly from the login screen if the greeter/ConfigAvailable key is set to "true" Not all keys in the GDM configuration file are supported in the GUI, so you may need to edit the configuration files by hand to edit these keys. If you believe running root-owned GUI's causes security risk, then you would want to always edit the files by hand. This program does not support setting per-display configuration, so per-display configuration files must be set up by hand.</para> @@ -2769,9 +2771,9 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-nodaemon</term> + <term>--nodaemon</term> <listitem> - <para>Якщо вказано цей параметр, тоді після старту GDM не буде створюватись дочірній процес у фоновому режимі. У цьому параметрі можна просто використовувати дефіс, щоб зберегти сумісність XDM.</para> + <para>If this option is specified, then GDM does not fork into the background when run. Note that you cannot use the single-dash option any more that e.g. XDM understands.</para> </listitem> </varlistentry> @@ -2857,7 +2859,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. <title><command>gdmchooser</command> Command Line Options</title> <varlistentry> - <term>-xdmaddress=СОКЕТ</term> + <term>--xdmaddress=SOCKET</term> <listitem> <para>Сокет для зв'язку з XDM.</para> </listitem> @@ -2871,7 +2873,7 @@ remote-flexi - In remote (XDMCP) & flexi mode. </varlistentry> <varlistentry> - <term>-connectionType=ТИП</term> + <term>--connectionType=TYPE</term> <listitem> <para>Тип з'єднання для повернення на запит XDM. Цей параметр використовується для запуску gdmchooser з XDM, та не використовується з GDM.</para> </listitem> @@ -2978,7 +2980,7 @@ homogeneous="bool"> <varlistentry> <term>button</term> <listitem> - <para>A button field. This field uses a GTK+ button. It is also possible to make a "rect" item act like a button by setting its button element to true. However it is better to use GTK+ buttons in GDM themes since these are accessible to users with disabilities. Also, GTK+ buttons can be themed.</para> + <para>A button field. This field uses a GTK+ button. It is also possible to make a "rect" item act like a button by setting its button element to true. However it is better to use GTK+ buttons in GDM themes since these are accessible to users with disabilities. Also, GTK+ buttons can be themed. This feature is supported in GDM 2.14.6 and later.</para> </listitem> </varlistentry> @@ -3081,7 +3083,7 @@ homogeneous="bool"> <varlistentry> <term>pam-error-logo</term> <listitem> - <para>An image that will be displayed only when a pam-error message is being displayed. This is useful for displaying an "Attention" icon, for example.</para> + <para>An image that will be displayed only when a pam-error message is being displayed. This is useful for displaying an "Attention" icon, for example. This feature is supported in GDM 2.14.6 and later.</para> </listitem> </varlistentry> diff --git a/gui/gdmXnestchooser.c b/gui/gdmXnestchooser.c index 2380daf4..092eea9d 100644 --- a/gui/gdmXnestchooser.c +++ b/gui/gdmXnestchooser.c @@ -24,7 +24,6 @@ #include <stdlib.h> #include <unistd.h> #include <stdio.h> -#include <popt.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> @@ -41,6 +40,7 @@ #include "gdmcommon.h" #include "gdmconfig.h" +static gchar **args_remaining; static pid_t xnest_pid = 0; #ifdef ENABLE_IPV6 @@ -164,21 +164,23 @@ static char display_num[BUFSIZ] = ""; static char indirect_host[BUFSIZ] = ""; /* options for Xnest only mode */ -static const struct poptOption xnest_only_options[] = { - { "xnest", 'x', POPT_ARG_STRING, &xnest_binary, 0, N_("Xnest command line"), N_("STRING") }, - { "xnest-extra-options", 'o', POPT_ARG_STRING, &xnest_options, 0, N_("Extra options for Xnest"), N_("OPTIONS") }, - { "background", 'b', POPT_ARG_NONE, &background, 0, N_("Run in background"), NULL }, +static const GOptionEntry xnest_only_options[] = { + { "xnest", 'x', 0, G_OPTION_ARG_STRING, &xnest_binary, N_("Xnest command line"), N_("STRING") }, + { "xnest-extra-options", 'o', 0, G_OPTION_ARG_STRING, &xnest_options, N_("Extra options for Xnest"), N_("OPTIONS") }, + { "background", 'b', 0, G_OPTION_ARG_NONE, &background, N_("Run in background"), NULL }, + { G_OPTION_REMAINING, NULL, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL }, { NULL } }; -static const struct poptOption options[] = { - { "xnest", 'x', POPT_ARG_STRING, &xnest_binary, 0, N_("Xnest command line"), N_("STRING") }, - { "xnest-extra-options", 'o', POPT_ARG_STRING, &xnest_options, 0, N_("Extra options for Xnest"), N_("OPTIONS") }, - { "no-query", 'n', POPT_ARG_NONE, &no_query, 0, N_("Just run Xnest, no query (no chooser)"), NULL }, - { "direct", 'd', POPT_ARG_NONE, &do_direct, 0, N_("Do direct query instead of indirect (chooser)"), NULL }, - { "broadcast", 'B', POPT_ARG_NONE, &do_broadcast, 0, N_("Run broadcast instead of indirect (chooser)"), NULL }, - { "background", 'b', POPT_ARG_NONE, &background, 0, N_("Run in background"), NULL }, - { "no-gdm-check", '\0', POPT_ARG_NONE, &no_gdm_check, 0, N_("Don't check for running GDM"), NULL }, +static const GOptionEntry options[] = { + { "xnest", 'x', 0, G_OPTION_ARG_STRING, &xnest_binary, N_("Xnest command line"), N_("STRING") }, + { "xnest-extra-options", 'o', 0, G_OPTION_ARG_STRING, &xnest_options, N_("Extra options for Xnest"), N_("OPTIONS") }, + { "no-query", 'n', 0, G_OPTION_ARG_NONE, &no_query, N_("Just run Xnest, no query (no chooser)"), NULL }, + { "direct", 'd', 0, G_OPTION_ARG_NONE, &do_direct, N_("Do direct query instead of indirect (chooser)"), NULL }, + { "broadcast", 'B', 0, G_OPTION_ARG_NONE, &do_broadcast, N_("Run broadcast instead of indirect (chooser)"), NULL }, + { "background", 'b', 0, G_OPTION_ARG_NONE, &background, N_("Run in background"), NULL }, + { "no-gdm-check", '\0', 0, G_OPTION_ARG_NONE, &no_gdm_check, N_("Don't check for running GDM"), NULL }, + { G_OPTION_REMAINING, NULL, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL }, { NULL } }; @@ -465,12 +467,10 @@ main (int argc, char *argv[]) int display; char *socket; char *pidfile; - poptContext ctx; - const char **args; + GOptionContext *ctx; char *xnest; char **execvec; struct sigaction term; - int nextopt; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -478,20 +478,23 @@ main (int argc, char *argv[]) if (strcmp (base (argv[0]), "gdmXnest") == 0) { gtk_init(&argc, &argv); - ctx = poptGetContext(NULL, argc, (const char**)argv, xnest_only_options, 0); - while ((nextopt = poptGetNextOpt(ctx)) > 0 || nextopt == POPT_ERROR_BADOPT); + ctx = g_option_context_new (_("- Nested gdm login chooser")); + g_option_context_add_main_entries (ctx, xnest_only_options, _("main options")); + g_option_context_parse (ctx, &argc, &argv, NULL); + g_option_context_free (ctx); no_query = TRUE; no_gdm_check = TRUE; } else { gtk_init(&argc, &argv); - ctx = poptGetContext(NULL, argc, (const char**)argv, options, 0); - while ((nextopt = poptGetNextOpt(ctx)) > 0 || nextopt == POPT_ERROR_BADOPT); + ctx = g_option_context_new (_("- Nested gdm login")); + g_option_context_add_main_entries (ctx, options, _("main options")); + g_option_context_parse (ctx, &argc, &argv, NULL); + g_option_context_free (ctx); } - args = poptGetArgs (ctx); - if (args != NULL && args[0] != NULL) - host = args[0]; - + if (args_remaining != NULL && args_remaining[0] != NULL) + host = args_remaining[0]; + g_strfreev (args_remaining); /* Read config data in bulk */ gdmcomm_comm_bulk_start (); diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c index 01416e48..cd5ced77 100644 --- a/gui/gdmchooser.c +++ b/gui/gdmchooser.c @@ -28,7 +28,6 @@ #include <string.h> #include <unistd.h> #include <syslog.h> -#include <popt.h> #include <ctype.h> #include <fcntl.h> #include <signal.h> @@ -926,7 +925,6 @@ gdm_chooser_xdmcp_discover (void) } g_list_free (chooser_hosts); - chooser_hosts = NULL; do_ping (TRUE); @@ -1900,19 +1898,17 @@ gdm_chooser_signals_init (void) gdm_common_fail_exit ("Could not set signal mask!"); } -struct poptOption xdm_options [] = { - { "xdmaddress", '\0', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, - &xdm_address, 0, - N_("Socket for xdm communication"), N_("SOCKET") }, - { "clientaddress", '\0', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, - &client_address, 0, - N_("Client address to return in response to xdm"), N_("ADDRESS") }, - { "connectionType", '\0', POPT_ARG_INT|POPT_ARGFLAG_ONEDASH, - &connection_type, 0, - N_("Connection type to return in response to xdm"), N_("TYPE") }, - POPT_AUTOHELP - { NULL, 0, 0, NULL, 0} -}; +GOptionEntry chooser_options [] = { + { "xdmaddress", '\0', 0, G_OPTION_ARG_STRING, &xdm_address, + N_("Socket for xdm communication"), N_("SOCKET") }, + { "clientaddress", '\0', 0, G_OPTION_ARG_STRING, &client_address, + N_("Client address to return in response to xdm"), N_("ADDRESS") }, + { "connectionType", '\0', 0, G_OPTION_ARG_INT, &connection_type, + N_("Connection type to return in response to xdm"), N_("TYPE") }, + { G_OPTION_REMAINING, NULL, 0, G_OPTION_ARG_STRING_ARRAY, &chooser_hosts, + NULL, NULL }, + { NULL } + }; static gboolean gdm_event (GSignalInvocationHint *ihint, @@ -1946,8 +1942,7 @@ main (int argc, char *argv[]) { gchar *GdmHosts; gchar **hosts_opt; - poptContext ctx; - int nextopt; + GOptionContext *ctx; const char *gdm_version; int i; guint sid; @@ -1969,18 +1964,10 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); - ctx = poptGetContext ("gdm", argc, (const char **) argv, - xdm_options, 0); - while ((nextopt = poptGetNextOpt (ctx)) > 0 || nextopt == POPT_ERROR_BADOPT) - /* do nothing */ ; - - if (nextopt != -1) { - g_print (_("Error on option %s: %s.\nRun '%s --help' to see a full list of available command line options.\n"), - poptBadOption (ctx, 0), - poptStrerror (nextopt), - argv[0]); - exit (1); - } + ctx = g_option_context_new (_("- gdm login chooser")); + g_option_context_add_main_entries(ctx, chooser_options, _("main options")); + g_option_context_parse(ctx, &argc, &argv, NULL); + g_option_context_free(ctx); glade_init (); @@ -2068,7 +2055,6 @@ main (int argc, char *argv[]) gdm_chooser_gui_init (); gdm_chooser_signals_init (); - hosts_opt = (char **)poptGetArgs (ctx); /* when no hosts on the command line, take them from the config */ if (hosts_opt == NULL || hosts_opt[0] == NULL) { @@ -2079,7 +2065,7 @@ main (int argc, char *argv[]) } } gdm_chooser_xdmcp_init (hosts_opt); - poptFreeContext (ctx); + g_strfreev (chooser_hosts); sid = g_signal_lookup ("event", GTK_TYPE_WIDGET); diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c index 4966501f..6493221b 100644 --- a/gui/gdmconfig.c +++ b/gui/gdmconfig.c @@ -191,7 +191,6 @@ GSList * gdm_config_get_xservers (gboolean flexible) { GSList *xservers = NULL; - gchar *p; gchar **splitstr, **sec; gchar *command = NULL; gchar *result = NULL; @@ -220,7 +219,6 @@ gdm_config_get_xservers (gboolean flexible) while (*sec != NULL) { GdmXserver *svr = g_new0 (GdmXserver, 1); - gchar *temp; temp = gdm_config_get_xserver_details (*sec, "ID"); if (temp == NULL) { diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c index df450f24..99f4e7c1 100644 --- a/gui/gdmflexiserver.c +++ b/gui/gdmflexiserver.c @@ -25,7 +25,6 @@ #include <stdio.h> #include <unistd.h> #include <stdio.h> -#include <popt.h> #include <sys/types.h> #include <signal.h> #include <sys/socket.h> @@ -56,6 +55,19 @@ static gboolean authenticate = FALSE; static gboolean no_lock = FALSE; static gboolean monte_carlo_pi = FALSE; static gboolean startnew = FALSE; +static gchar **args_remaining = NULL; + +GOptionEntry options [] = { + { "command", 'c', 0, G_OPTION_ARG_STRING, &send_command, N_("Send the specified protocol command to GDM"), N_("COMMAND") }, + { "xnest", 'n', 0, G_OPTION_ARG_NONE, &use_xnest, N_("Xnest mode"), NULL }, + { "no-lock", 'l', 0, G_OPTION_ARG_NONE, &no_lock, N_("Do not lock current screen"), NULL }, + { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug_in, N_("Debugging output"), NULL }, + { "authenticate", 'a', 0, G_OPTION_ARG_NONE, &authenticate, N_("Authenticate before running --command"), NULL }, + { "startnew", 's', 0, G_OPTION_ARG_NONE, &startnew, N_("Start new flexible session; do not show popup"), NULL }, + { "monte-carlo-pi", 0, 0, G_OPTION_ARG_NONE, &monte_carlo_pi, NULL, NULL }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL }, + { NULL } +}; static int get_cur_vt (void) @@ -684,18 +696,6 @@ calc_pi (void) } } -struct poptOption options [] = { - { "command", 'c', POPT_ARG_STRING, &send_command, 0, N_("Send the specified protocol command to GDM"), N_("COMMAND") }, - { "xnest", 'n', POPT_ARG_NONE, &use_xnest, 0, N_("Xnest mode"), NULL }, - { "no-lock", 'l', POPT_ARG_NONE, &no_lock, 0, N_("Do not lock current screen"), NULL }, - { "debug", 'd', POPT_ARG_NONE, &debug_in, 0, N_("Debugging output"), NULL }, - { "authenticate", 'a', POPT_ARG_NONE, &authenticate, 0, N_("Authenticate before running --command"), NULL }, - { "startnew", 's', POPT_ARG_NONE, &startnew, 0, N_("Start new flexible session; do not show popup"), NULL }, - { "monte-carlo-pi", 0, POPT_ARG_NONE, &monte_carlo_pi, 0, NULL, NULL }, - POPT_AUTOHELP - { NULL, 0, 0, NULL, 0} -}; - int main (int argc, char *argv[]) @@ -705,18 +705,17 @@ main (int argc, char *argv[]) char *version; char *ret; const char *message; - poptContext ctx; - const char **args; - int nextopt; + GOptionContext *ctx; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); /* Option parsing */ - - ctx = poptGetContext(NULL, argc, (const char**)argv, options, 0); - while ((nextopt = poptGetNextOpt(ctx)) > 0 || nextopt == POPT_ERROR_BADOPT); + ctx = g_option_context_new("- New gdm login"); + g_option_context_add_main_entries(ctx, options, _("main options")); + g_option_context_parse(ctx, &argc, &argv, NULL); + g_option_context_free(ctx); if (monte_carlo_pi) { calc_pi (); @@ -725,9 +724,8 @@ main (int argc, char *argv[]) gdmcomm_set_debug (debug_in); - args = poptGetArgs (ctx); - if (args != NULL && args[0] != NULL) - server = args[0]; + if (args_remaining != NULL && args_remaining[0] != NULL) + server = args_remaining[0]; if ( ! gdmcomm_check (TRUE)) { return 1; @@ -888,6 +886,8 @@ main (int argc, char *argv[]) ret = gdmcomm_call_gdm (command, auth_cookie, version, 5); g_free (command); + g_strfreev (args_remaining); + /* At this point we are done using the socket, so close it */ gdmcomm_comm_bulk_stop (); |