├── .gitignore ├── .gitlab-ci.yml ├── AUTHORS ├── COPYING ├── HACKING ├── MAINTAINERS ├── NEWS ├── README.md ├── build-aux └── find-x-server.sh ├── chooser ├── chooser-main.c ├── gdm-chooser-host.c ├── gdm-chooser-host.h ├── gdm-chooser-session.c ├── gdm-chooser-session.h ├── gdm-host-chooser-dialog.c ├── gdm-host-chooser-dialog.h ├── gdm-host-chooser-widget.c ├── gdm-host-chooser-widget.h ├── gdm-host-chooser.c └── meson.build ├── common ├── gdb-cmd ├── gdm-address.c ├── gdm-address.h ├── gdm-common.c ├── gdm-common.h ├── gdm-log.c ├── gdm-log.h ├── gdm-profile.c ├── gdm-profile.h ├── gdm-settings-backend.c ├── gdm-settings-backend.h ├── gdm-settings-desktop-backend.c ├── gdm-settings-desktop-backend.h ├── gdm-settings-direct.c ├── gdm-settings-direct.h ├── gdm-settings-keys.h ├── gdm-settings-utils.c ├── gdm-settings-utils.h ├── gdm-settings.c ├── gdm-settings.h ├── meson.build └── test-log.c ├── daemon ├── gdm-dbus-util.c ├── gdm-dbus-util.h ├── gdm-display-access-file.c ├── gdm-display-access-file.h ├── gdm-display-factory.c ├── gdm-display-factory.h ├── gdm-display-store.c ├── gdm-display-store.h ├── gdm-display.c ├── gdm-display.h ├── gdm-display.xml ├── gdm-launch-environment.c ├── gdm-launch-environment.h ├── gdm-legacy-display.c ├── gdm-legacy-display.h ├── gdm-local-display-factory.c ├── gdm-local-display-factory.h ├── gdm-local-display-factory.xml ├── gdm-local-display.c ├── gdm-local-display.h ├── gdm-local-display.xml ├── gdm-manager.c ├── gdm-manager.h ├── gdm-manager.xml ├── gdm-remote-display-factory.c ├── gdm-remote-display-factory.h ├── gdm-remote-display-factory.xml ├── gdm-remote-display.c ├── gdm-remote-display.h ├── gdm-remote-display.xml ├── gdm-server.c ├── gdm-server.h ├── gdm-session-auditor.c ├── gdm-session-auditor.h ├── gdm-session-enum-types.c.in ├── gdm-session-enum-types.h.in ├── gdm-session-linux-auditor.c ├── gdm-session-linux-auditor.h ├── gdm-session-record.c ├── gdm-session-record.h ├── gdm-session-settings.c ├── gdm-session-settings.h ├── gdm-session-solaris-auditor.c ├── gdm-session-solaris-auditor.h ├── gdm-session-worker-common.c ├── gdm-session-worker-common.h ├── gdm-session-worker-enum-types.c.in ├── gdm-session-worker-enum-types.h.in ├── gdm-session-worker-job.c ├── gdm-session-worker-job.h ├── gdm-session-worker.c ├── gdm-session-worker.h ├── gdm-session-worker.xml ├── gdm-session.c ├── gdm-session.h ├── gdm-session.xml ├── gdm-wayland-session.c ├── gdm-x-session.c ├── gdm-xdmcp-chooser-display.c ├── gdm-xdmcp-chooser-display.h ├── gdm-xdmcp-display-factory.c ├── gdm-xdmcp-display-factory.h ├── gdm-xdmcp-display.c ├── gdm-xdmcp-display.h ├── main.c ├── meson.build ├── org.freedesktop.DBus.xml ├── session-worker-main.c └── test-session-client.c ├── data ├── .gitignore ├── 61-gdm.rules.in ├── Init.in ├── PostLogin ├── PostSession.in ├── PreSession.in ├── Xsession.in ├── applications │ ├── meson.build │ ├── mime-dummy-handler.desktop │ └── mimeapps.list ├── autostart │ ├── meson.build │ └── orca-autostart.desktop ├── dconf │ ├── .gitignore │ ├── defaults │ │ ├── 00-upstream-settings │ │ └── locks │ │ │ └── 00-upstream-settings-locks │ ├── gdm.in │ └── meson.build ├── gdm.conf-custom.in ├── gdm.conf.in ├── gdm.schemas.in ├── gdm.service.in ├── gnome-login.session.in ├── locale.alias ├── meson.build ├── org.gnome.login-screen.gschema.xml ├── pam-arch │ ├── gdm-autologin.pam │ ├── gdm-fingerprint.pam │ ├── gdm-launch-environment.pam │ ├── gdm-password.pam │ └── gdm-smartcard.pam ├── pam-exherbo │ ├── gdm-autologin.pam │ ├── gdm-fingerprint.pam │ ├── gdm-launch-environment.pam │ ├── gdm-password.pam │ └── gdm-smartcard.pam ├── pam-lfs │ ├── gdm-autologin.pam │ ├── gdm-fingerprint.pam │ ├── gdm-launch-environment.pam │ ├── gdm-password.pam │ └── gdm-smartcard.pam ├── pam-openembedded │ ├── gdm-autologin.pam │ ├── gdm-launch-environment.pam │ └── gdm-password.pam ├── pam-redhat │ ├── gdm-autologin.pam │ ├── gdm-fingerprint.pam │ ├── gdm-launch-environment.pam │ ├── gdm-password.pam │ └── gdm-smartcard.pam ├── polkit-gdm.rules.in └── session.conf.in ├── docs ├── C │ ├── index.docbook │ └── legal.xml ├── LINGUAS ├── ca │ └── ca.po ├── cs │ └── cs.po ├── de │ └── de.po ├── el │ └── el.po ├── en_GB │ └── en_GB.po ├── es │ └── es.po ├── eu │ └── eu.po ├── fr │ └── fr.po ├── gl │ └── gl.po ├── hr │ └── hr.po ├── hu │ └── hu.po ├── id │ └── id.po ├── it │ └── it.po ├── ka │ └── ka.po ├── ko │ └── ko.po ├── meson.build ├── nl │ └── nl.po ├── oc │ └── oc.po ├── pt_BR │ └── pt_BR.po ├── ro │ └── ro.po ├── ru │ └── ru.po ├── sl │ └── sl.po ├── sv │ └── sv.po ├── te │ └── te.po ├── tr │ └── tr.po ├── uk │ └── uk.po └── zh_CN │ └── zh_CN.po ├── gdm.doap ├── libgdm ├── gdm-client.c ├── gdm-client.h ├── gdm-sessions.c ├── gdm-sessions.h ├── gdm-user-switching.c ├── gdm-user-switching.h ├── gdm.pc.in ├── libgdm.map └── meson.build ├── logo.png ├── meson.build ├── meson_options.txt ├── pam-extensions ├── gdm-choice-list-pam-extension.h ├── gdm-custom-json-pam-extension.h ├── gdm-pam-extensions-common.h ├── gdm-pam-extensions.h ├── gdm-pam-extensions.pc.in └── meson.build ├── pam_gdm ├── meson.build └── pam_gdm.c ├── po ├── ChangeLog ├── LINGUAS ├── Makevars ├── POTFILES.in ├── POTFILES.skip ├── ab.po ├── af.po ├── am.po ├── an.po ├── ar.po ├── as.po ├── ast.po ├── az.po ├── be.po ├── be@latin.po ├── bg.po ├── bn.po ├── bn_IN.po ├── br.po ├── bs.po ├── ca.po ├── ca@valencia.po ├── ckb.po ├── crh.po ├── cs.po ├── csb.po ├── cy.po ├── da.po ├── de.po ├── dz.po ├── el.po ├── en@shaw.po ├── en_CA.po ├── en_GB.po ├── eo.po ├── es.po ├── et.po ├── eu.po ├── fa.po ├── fi.po ├── fr.po ├── fur.po ├── fy.po ├── ga.po ├── gd.po ├── gl.po ├── gu.po ├── gv.po ├── he.po ├── hi.po ├── hr.po ├── hu.po ├── hy.po ├── id.po ├── is.po ├── it.po ├── ja.po ├── ka.po ├── kab.po ├── kk.po ├── km.po ├── kn.po ├── ko.po ├── ku.po ├── ky.po ├── lt.po ├── lv.po ├── mai.po ├── meson.build ├── mg.po ├── mi.po ├── mjw.po ├── mk.po ├── ml.po ├── mn.po ├── mr.po ├── ms.po ├── nb.po ├── nds.po ├── ne.po ├── nl.po ├── nn.po ├── nso.po ├── oc.po ├── or.po ├── pa.po ├── pl.po ├── ps.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── rw.po ├── si.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sr@latin.po ├── sv.po ├── sw.po ├── ta.po ├── te.po ├── tg.po ├── th.po ├── tr.po ├── ug.po ├── uk.po ├── uz.po ├── uz@cyrillic.po ├── vi.po ├── wa.po ├── xh.po ├── zh_CN.po ├── zh_HK.po ├── zh_TW.po └── zu.po ├── tests ├── m-common.c ├── meson.build ├── s-common-address.c ├── s-common-address.h ├── s-common.c └── s-common.h └── utils ├── gdm-auth-config-generic ├── gdm-auth-config-redhat ├── gdm-config.c ├── gdm-runtime-config.c ├── gdmflexiserver.c └── meson.build /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.cat 3 | *.cat.m 4 | *.gmo 5 | *.lo 6 | *.mo 7 | .*.*.mo 8 | *.msg 9 | *.o 10 | *.old.po 11 | *.pox 12 | *.tab.c 13 | .*.swp 14 | ABOUT-NLS 15 | at-spi-registryd-wrapper.desktop.in 16 | ./autom4te.cache 17 | .deps 18 | _libs 19 | .libs 20 | cat-id-tbl.tmp 21 | config.cache 22 | config.h 23 | config.log 24 | config.lt 25 | config.rpath 26 | config.status 27 | config.status.lineno 28 | configure.lineno 29 | gdm.conf 30 | gdm.conf-custom 31 | gdm-display-glue.h 32 | gdm-display-glue.c 33 | gdm-local-display-glue.h 34 | gdm-local-display-glue.c 35 | gdm-local-display-factory-glue.h 36 | gdm-local-display-factory-glue.c 37 | gdm-manager-glue.c 38 | gdm-manager-glue.h 39 | gdm.pot 40 | gdm-restart 41 | gdm-safe-restart 42 | gdm.schemas 43 | gdm-session-glue.h 44 | gdm-session-glue.c 45 | gdm-session-worker-glue.h 46 | gdm-session-worker-glue.c 47 | gdm-static-display-glue.h 48 | gdm-static-display-glue.c 49 | gdm-static-factory-display-glue.h 50 | gdm-stop 51 | gdm-transient-display-glue.h 52 | gdm-transient-display-glue.c 53 | gdm-xdmcp-display-glue.h 54 | gdm-xdmcp-display-glue.c 55 | gdm-xdmcp-chooser-display-glue.h 56 | gdm-xdmcp-greeter-display-glue.h 57 | gdm-greeter-glue.h 58 | gdm-greeter-glue.c 59 | GNOME_FastUserSwitchApplet.server 60 | GNOME_FastUserSwitchApplet.server.in 61 | gnome-power-manager.desktop.in 62 | gnome-settings-daemon.desktop.in 63 | GPATH 64 | GRTAGS 65 | GSYMS 66 | GTAGS 67 | in 68 | Init 69 | .intltool-merge-cache 70 | libgdmcommon.la 71 | libgdmuser.la 72 | libnotificationarea.la 73 | libtool 74 | Makefile 75 | Makefile.in 76 | Makefile.in.in 77 | na-marshal.c 78 | na-marshal.h 79 | PostSession 80 | POTFILES 81 | PreSession 82 | so_locations 83 | stamp-h1 84 | stamp-it 85 | tags 86 | TAGS 87 | Xsession 88 | INSTALL 89 | aclocal.m4 90 | autom4te.cache/ 91 | common/test-log 92 | compile 93 | config.guess 94 | config.h.in 95 | config.sub 96 | configure 97 | daemon/gdm 98 | daemon/gdm-session-worker 99 | daemon/gdm-wayland-session 100 | daemon/gdm-x-session 101 | daemon/test-session-client 102 | daemon/test-external-greeter 103 | daemon/gdm-session-enum-types.c 104 | daemon/gdm-session-enum-types.h 105 | data/applications/gnome-mag.desktop 106 | data/applications/gnome-shell.desktop 107 | data/applications/gnome-shell-wayland.desktop 108 | data/applications/gok.desktop 109 | data/applications/orca-screen-reader.desktop 110 | data/autostart/caribou-autostart.desktop 111 | depcomp 112 | libgdm/gdm-client-glue.h 113 | libgdm/gdm-client-glue.c 114 | libgdm/gdm-manager-glue.h 115 | libgdm/gdm-manager-glue.c 116 | gui/simple-chooser/gdm-host-chooser 117 | gui/simple-chooser/gdm-simple-chooser 118 | install-sh 119 | intltool-extract.in 120 | intltool-merge.in 121 | intltool-update.in 122 | ltmain.sh 123 | m4/*.m4 124 | missing 125 | mkinstalldirs 126 | tests/m-common 127 | utils/gdmflexiserver 128 | *.gschema.valid 129 | *.gschema.xml 130 | *.la 131 | *.pc 132 | *.gir 133 | *.typelib 134 | *.tar.* 135 | gdm-smartcard-worker 136 | dconf-override-db 137 | 138 | docs/*/*.stamp 139 | docs/*/legal.xml 140 | docs/*/index.docbook 141 | 142 | po/*.gmo 143 | po/*.header 144 | po/*.sed 145 | po/*.sin 146 | po/.intltool-merge-cache 147 | po/Makefile.in.in 148 | po/Makevars.template 149 | po/POTFILES 150 | po/Rules-quot 151 | po/stamp-it 152 | 153 | test-driver 154 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - project: "GNOME/citemplates" 3 | file: "templates/default-rules.yml" 4 | - project: "Infrastructure/freedesktop-ci-templates" 5 | file: "templates/fedora.yml" 6 | ref: "c6aeb16f86e32525fa630fb99c66c4f3e62fc3cb" 7 | - component: "gitlab.gnome.org/GNOME/citemplates/release-service@master" 8 | inputs: 9 | job-stage: "release" 10 | dist-job-name: "build-fedora" 11 | 12 | variables: 13 | COMMON_BUILD_OPTIONS: --prefix=/usr --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --libdir=/usr/lib64 -Dpam-prefix=/etc -Drun-dir=/run/gdm -Dudev-dir=/lib/udev/rules.d -Ddefault-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin -Dprofiling=true -Dplymouth=enabled -Dselinux=enabled 14 | MESON_BUILD_DIR: build 15 | 16 | stages: 17 | - prepare 18 | - build 19 | - release 20 | 21 | .gdm.fedora: 22 | variables: 23 | FDO_DISTRIBUTION_VERSION: 42 24 | FDO_DISTRIBUTION_TAG: "2025-06-01.0" 25 | FDO_DISTRIBUTION_PACKAGES: >- 26 | accountsservice-devel 27 | audit-libs-devel 28 | check-devel 29 | dconf 30 | desktop-file-utils 31 | gettext-devel 32 | git 33 | gobject-introspection-devel 34 | iso-codes-devel 35 | itstool 36 | json-glib-devel 37 | keyutils-libs-devel 38 | libattr-devel 39 | libgudev-devel 40 | libdmx-devel 41 | libselinux-devel 42 | libtool 43 | meson 44 | nss-devel 45 | pam-devel 46 | plymouth-devel 47 | redhat-rpm-config 48 | systemd 49 | systemd-devel 50 | which 51 | yelp-devel 52 | gtk3-devel 53 | libXau-devel 54 | libXdmcp-devel 55 | xorg-x11-server-Xorg 56 | xorg-x11-server-devel 57 | 58 | build-fedora-container: 59 | extends: 60 | - .fdo.container-build@fedora@x86_64 61 | - .gdm.fedora 62 | stage: prepare 63 | rules: 64 | - when: always 65 | 66 | build-fedora: 67 | extends: 68 | - .fdo.distribution-image@fedora 69 | - .gdm.fedora 70 | stage: build 71 | script: 72 | - meson setup ${MESON_BUILD_DIR} ${COMMON_BUILD_OPTIONS} -Dx11-support=true 73 | - meson compile -C ${MESON_BUILD_DIR} 74 | - meson install -C ${MESON_BUILD_DIR} 75 | - meson dist -C ${MESON_BUILD_DIR} 76 | - meson test -C ${MESON_BUILD_DIR} 77 | - cp -r "${MESON_BUILD_DIR}/meson-dist/" "${CI_PROJECT_DIR}/public-dist/" 78 | rules: 79 | - when: always 80 | artifacts: 81 | name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" 82 | when: always 83 | paths: 84 | - ${MESON_BUILD_DIR}/meson-logs 85 | - "public-dist" 86 | 87 | build-fedora-wayland: 88 | extends: 89 | - .fdo.distribution-image@fedora 90 | - .gdm.fedora 91 | stage: build 92 | script: 93 | - meson setup ${MESON_BUILD_DIR} ${COMMON_BUILD_OPTIONS} 94 | - meson compile -C ${MESON_BUILD_DIR} 95 | - meson install -C ${MESON_BUILD_DIR} 96 | - meson dist -C ${MESON_BUILD_DIR} 97 | - meson test -C ${MESON_BUILD_DIR} 98 | rules: 99 | - if: $CI_COMMIT_TAG == null 100 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | William Jon McCann 2 | Ray Strode 3 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | Coding Style 2 | ============ 3 | 4 | * Follow the coding style already used. 5 | * Trailing whitespace is not allowed. 6 | * Use spaces (not tabs) for indentation. 7 | * Brace on same line as block statement. 8 | * Use braces on all blocks (even single line blocks). 9 | * Code must conform to C89/C90 (ANSI/ISO C) (ie. no C99). 10 | * Spaces between functions and arguments, or macros and arguments. 11 | * Spaces before and after most binary operators. 12 | * Spaces after most unary operators (including a comma). 13 | * Return value on line before function definition. 14 | * Brace on line after function definition. 15 | * Do not initialize local variables in their declarations. 16 | * Line up function arguments in declarations. 17 | * One variable declaration per line. 18 | * Line up variable names in declarations. 19 | * Limit the use of function prototypes by defining functions 20 | in the file before they are used. 21 | * Whenever possible conditional expressions should not have side 22 | effects (eg. don't set a value or call a function in an if 23 | statement). 24 | * '*' goes with variable not type, when declaring a pointer. 25 | * Function arguments follow the function call on the same line, and if 26 | lengthy are (where possible) wrapped to the column of the first brace. 27 | * Always compare pointers with NULL instead of using "!". 28 | * If you make a non-trivial and copyrightable change to a file 29 | be sure to add your name to the copyright information at the 30 | beginning of the file. 31 | * Use gtk-doc style comments on public functions whenever possible. 32 | * In most cases, don't abbreviate words in function and variable names. 33 | * Function names are lowercase, words separated by underscores. 34 | * Macros and enums are all uppercase, words seperated by 35 | underscores. 36 | * Types are all words capitalized, no separators between words. 37 | 38 | * Don't use gchar. "char" is just fine. 39 | * Public functions should check input using g_return_if_fail. 40 | * Private functions should check input using g_assert. 41 | * Handle the default case in switch statements with 42 | a warning or g_assert_not_reached. 43 | * Prefer glib functions over native ones when available. 44 | * Use glib string handling functions when possible. 45 | 46 | * When in doubt copy the style of the rest of the file. 47 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Ray Strode 2 | E-mail: rstrode@redhat.com 3 | Userid: halfline 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GDM - GNOME Display Manager 2 | =========================== 3 | http://wiki.gnome.org/Projects/GDM/ 4 | 5 | The GNOME Display Manager is a system service that is responsible for 6 | providing graphical log-ins and managing local and remote displays. 7 | 8 | ## Building and installing 9 | To build and install GDM from source, just execute the following commands: 10 | 11 | ``` 12 | $ meson _build 13 | $ ninja -C _build 14 | $ sudo ninja -C _build install 15 | ``` 16 | 17 | ## Contributing 18 | You can browse the code, issues and more at GDM's [GitLab repository]. 19 | 20 | If you find a bug in GDM, please file an issue on the [issue tracker]. Please 21 | try to add reproducible steps and the relevant version of GDM. 22 | 23 | If you want to contribute functionality or bug fixes, please open a Merge 24 | Request (MR). For more info on how to do this, see GitLab's [help pages on 25 | MR's]. Please also follow the GDM coding style, which is documented in 26 | `HACKING`. 27 | 28 | If GDM is not translated in your language or you believe that the 29 | current translation has errors, you can join one of the various translation 30 | teams in GNOME. Translators do not commit directly to Git, but are advised to 31 | use our separate translation infrastructure instead. More info can be found at 32 | the [translation project wiki page]. 33 | 34 | ## Licensing 35 | GDM is licensed under the GNU General Public License v2.0. For more info, see 36 | the `COPYING` file. 37 | 38 | 39 | [help pages on MR's]: https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html 40 | [GitLab repository]: https://gitlab.gnome.org/GNOME/gdm 41 | [issue tracker]: https://gitlab.gnome.org/GNOME/gdm/issues 42 | [translation project wiki page]: https://wiki.gnome.org/TranslationProject/ 43 | -------------------------------------------------------------------------------- /build-aux/find-x-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # First check with "! -h" for /usr/X11R6 and /usr/X11 since they often 4 | # symlink to each other, and configure should use the more stable 5 | # location (the real directory) if possible. 6 | # 7 | # On Solaris, the /usr/bin/Xserver script is used to decide whether to 8 | # use Xsun or Xorg, so this is used on Solaris. 9 | # 10 | # When testing for /usr/X11R6, first check with "! -h" for /usr/X11R6 11 | # and /usr/X11 since they often symlink to each other, and configure 12 | # should use the more stable location (the real directory) if possible. 13 | # 14 | if test -x /usr/bin/X; then 15 | echo "/usr/bin/X" 16 | elif test -x /usr/X11/bin/Xserver; then 17 | echo "/usr/X11/bin/Xserver" 18 | elif test ! -h /usr/X11R6 -a -x /usr/X11R6/bin/X; then 19 | echo "/usr/X11R6/bin/X" 20 | elif test ! -h /usr/X11 -a -x /usr/X11/bin/X; then 21 | echo "/usr/X11/bin/X" 22 | elif test -x /usr/X11R6/bin/X; then 23 | echo "/usr/X11R6/bin/X" 24 | elif test -x /usr/bin/Xorg; then 25 | echo "/usr/bin/Xorg" 26 | elif test -x /usr/X11/bin/X; then 27 | echo "/usr/X11/bin/X" 28 | elif test -x /usr/openwin/bin/Xsun; then 29 | echo "/usr/openwin/bin/Xsun" 30 | elif test -x /opt/X11R6/bin/X; then 31 | echo "/opt/X11R6/bin/X" 32 | else 33 | echo "" 34 | fi 35 | -------------------------------------------------------------------------------- /chooser/gdm-chooser-host.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __GDM_CHOOSER_HOST__ 21 | #define __GDM_CHOOSER_HOST__ 22 | 23 | #include 24 | #include "gdm-address.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GDM_TYPE_CHOOSER_HOST (gdm_chooser_host_get_type ()) 29 | G_DECLARE_FINAL_TYPE (GdmChooserHost, gdm_chooser_host, GDM, CHOOSER_HOST, GObject) 30 | 31 | typedef enum { 32 | GDM_CHOOSER_HOST_KIND_XDMCP = 1 << 0, 33 | } GdmChooserHostKind; 34 | 35 | #define GDM_CHOOSER_HOST_KIND_MASK_ALL (GDM_CHOOSER_HOST_KIND_XDMCP) 36 | 37 | const char *gdm_chooser_host_get_description (GdmChooserHost *chooser_host); 38 | GdmAddress * gdm_chooser_host_get_address (GdmChooserHost *chooser_host); 39 | gboolean gdm_chooser_host_get_willing (GdmChooserHost *chooser_host); 40 | GdmChooserHostKind gdm_chooser_host_get_kind (GdmChooserHost *chooser_host); 41 | 42 | G_END_DECLS 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /chooser/gdm-chooser-session.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __GDM_CHOOSER_SESSION_H 22 | #define __GDM_CHOOSER_SESSION_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GDM_TYPE_CHOOSER_SESSION (gdm_chooser_session_get_type ()) 29 | G_DECLARE_FINAL_TYPE (GdmChooserSession, gdm_chooser_session, GDM, CHOOSER_SESSION, GObject) 30 | 31 | GdmChooserSession * gdm_chooser_session_new (void); 32 | 33 | gboolean gdm_chooser_session_start (GdmChooserSession *session, 34 | GError **error); 35 | void gdm_chooser_session_stop (GdmChooserSession *session); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GDM_CHOOSER_SESSION_H */ 40 | -------------------------------------------------------------------------------- /chooser/gdm-host-chooser-dialog.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __GDM_HOST_CHOOSER_DIALOG_H 22 | #define __GDM_HOST_CHOOSER_DIALOG_H 23 | 24 | #include 25 | #include 26 | #include "gdm-chooser-host.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_HOST_CHOOSER_DIALOG (gdm_host_chooser_dialog_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmHostChooserDialog, gdm_host_chooser_dialog, GDM, HOST_CHOOSER_DIALOG, GtkDialog) 32 | 33 | GtkWidget * gdm_host_chooser_dialog_new (int kind_mask); 34 | 35 | GdmChooserHost * gdm_host_chooser_dialog_get_host (GdmHostChooserDialog *dialog); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GDM_HOST_CHOOSER_DIALOG_H */ 40 | -------------------------------------------------------------------------------- /chooser/gdm-host-chooser-widget.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __GDM_HOST_CHOOSER_WIDGET_H 22 | #define __GDM_HOST_CHOOSER_WIDGET_H 23 | 24 | #include 25 | #include 26 | #include "gdm-chooser-host.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_HOST_CHOOSER_WIDGET (gdm_host_chooser_widget_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmHostChooserWidget, gdm_host_chooser_widget, GDM, HOST_CHOOSER_WIDGET, GtkBox) 32 | 33 | GtkWidget * gdm_host_chooser_widget_new (int kind_mask); 34 | 35 | void gdm_host_chooser_widget_refresh (GdmHostChooserWidget *widget); 36 | 37 | GdmChooserHost * gdm_host_chooser_widget_get_host (GdmHostChooserWidget *widget); 38 | 39 | G_END_DECLS 40 | 41 | #endif /* __GDM_HOST_CHOOSER_WIDGET_H */ 42 | -------------------------------------------------------------------------------- /chooser/meson.build: -------------------------------------------------------------------------------- 1 | # Simple chooser 2 | gdm_simple_chooser_src = [ 3 | 'chooser-main.c', 4 | 'gdm-chooser-host.c', 5 | 'gdm-chooser-session.c', 6 | 'gdm-host-chooser-dialog.c', 7 | 'gdm-host-chooser-widget.c', 8 | ] 9 | 10 | gdm_simple_chooser_deps = [ 11 | glib_dep, 12 | gtk_dep, 13 | libgdmcommon_dep, 14 | libgdm_dep, 15 | x_deps, 16 | xdmcp_dep, 17 | ] 18 | 19 | gdm_simple_chooser = executable('gdm-simple-chooser', 20 | gdm_simple_chooser_src, 21 | dependencies: gdm_simple_chooser_deps, 22 | include_directories: config_h_dir, 23 | install: true, 24 | install_dir: get_option('libexecdir'), 25 | ) 26 | 27 | # Host chooser 28 | gdm_host_chooser_src = [ 29 | 'gdm-host-chooser.c', 30 | 'gdm-chooser-host.c', 31 | 'gdm-host-chooser-dialog.c', 32 | 'gdm-host-chooser-widget.c', 33 | ] 34 | 35 | gdm_host_chooser_deps = [ 36 | glib_dep, 37 | gtk_dep, 38 | libgdmcommon_dep, 39 | libgdm_dep, 40 | x_deps, 41 | xdmcp_dep, 42 | ] 43 | 44 | gdm_host_chooser = executable('gdm-host-chooser', 45 | gdm_host_chooser_src, 46 | dependencies: gdm_host_chooser_deps, 47 | include_directories: config_h_dir, 48 | install: true, 49 | install_dir: get_option('libexecdir'), 50 | ) 51 | -------------------------------------------------------------------------------- /common/gdb-cmd: -------------------------------------------------------------------------------- 1 | bt 2 | thread apply all bt full 3 | q 4 | -------------------------------------------------------------------------------- /common/gdm-address.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_ADDRESS_H 23 | #define __GDM_ADDRESS_H 24 | 25 | #include 26 | #ifndef G_OS_WIN32 27 | #include 28 | #include 29 | #include 30 | #else 31 | #include 32 | #undef interface 33 | #endif 34 | 35 | G_BEGIN_DECLS 36 | 37 | #define GDM_TYPE_ADDRESS (gdm_address_get_type ()) 38 | #define gdm_sockaddr_len(sa) ((sa)->ss_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)) 39 | 40 | typedef struct _GdmAddress GdmAddress; 41 | 42 | GType gdm_address_get_type (void); 43 | 44 | GdmAddress * gdm_address_new_from_sockaddr (struct sockaddr *sa, 45 | size_t size); 46 | 47 | int gdm_address_get_family_type (GdmAddress *address); 48 | struct sockaddr_storage *gdm_address_get_sockaddr_storage (GdmAddress *address); 49 | struct sockaddr_storage *gdm_address_peek_sockaddr_storage (GdmAddress *address); 50 | 51 | gboolean gdm_address_get_hostname (GdmAddress *address, 52 | char **hostname); 53 | gboolean gdm_address_get_numeric_info (GdmAddress *address, 54 | char **numeric_hostname, 55 | char **service); 56 | gboolean gdm_address_is_local (GdmAddress *address); 57 | gboolean gdm_address_is_loopback (GdmAddress *address); 58 | 59 | gboolean gdm_address_equal (GdmAddress *a, 60 | GdmAddress *b); 61 | 62 | GdmAddress * gdm_address_copy (GdmAddress *address); 63 | void gdm_address_free (GdmAddress *address); 64 | 65 | 66 | void gdm_address_debug (GdmAddress *address); 67 | 68 | const GList * gdm_address_peek_local_list (void); 69 | 70 | 71 | G_END_DECLS 72 | 73 | #endif /* __GDM_ADDRESS_H */ 74 | -------------------------------------------------------------------------------- /common/gdm-log.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include "gdm-log.h" 39 | 40 | static gboolean initialized = FALSE; 41 | static gboolean is_sd_booted = FALSE; 42 | static gboolean debug_enabled = FALSE; 43 | 44 | static gint 45 | get_syslog_priority_from_log_level (GLogLevelFlags log_level) 46 | { 47 | switch (log_level & G_LOG_LEVEL_MASK) { 48 | case G_LOG_FLAG_FATAL: 49 | return LOG_EMERG; 50 | case G_LOG_LEVEL_ERROR: 51 | /* fatal error - a critical error, in the syslog world */ 52 | return LOG_CRIT; 53 | case G_LOG_LEVEL_CRITICAL: 54 | /* critical warning - an error, in the syslog world */ 55 | return LOG_ERR; 56 | case G_LOG_LEVEL_WARNING: 57 | case G_LOG_LEVEL_MESSAGE: 58 | return LOG_NOTICE; 59 | case G_LOG_LEVEL_INFO: 60 | return LOG_INFO; 61 | case G_LOG_LEVEL_DEBUG: 62 | default: 63 | return LOG_DEBUG; 64 | } 65 | } 66 | 67 | static void 68 | gdm_log_default_handler (const gchar *log_domain, 69 | GLogLevelFlags log_level, 70 | const gchar *message, 71 | gpointer unused_data) 72 | { 73 | int priority; 74 | 75 | gdm_log_init (); 76 | 77 | if ((log_level & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_DEBUG && 78 | !debug_enabled) { 79 | return; 80 | } 81 | 82 | /* Process the message prefix and priority */ 83 | priority = get_syslog_priority_from_log_level (log_level); 84 | 85 | if (is_sd_booted) { 86 | fprintf (stderr, 87 | "<%d>%s%s%s\n", 88 | priority, 89 | log_domain != NULL? log_domain : "", 90 | log_domain != NULL? ": " : "", 91 | message); 92 | fflush (stderr); 93 | } else { 94 | syslog (priority, 95 | "%s%s%s\n", 96 | log_domain != NULL? log_domain : "", 97 | log_domain != NULL? ": " : "", 98 | message); 99 | } 100 | } 101 | 102 | void 103 | gdm_log_toggle_debug (void) 104 | { 105 | gdm_log_set_debug (!debug_enabled); 106 | } 107 | 108 | void 109 | gdm_log_set_debug (gboolean debug) 110 | { 111 | g_assert (initialized); 112 | if (debug_enabled == debug) { 113 | return; 114 | } 115 | 116 | if (debug) { 117 | debug_enabled = debug; 118 | g_debug ("Enabling debugging"); 119 | } else { 120 | g_debug ("Disabling debugging"); 121 | debug_enabled = debug; 122 | } 123 | } 124 | 125 | void 126 | gdm_log_init (void) 127 | { 128 | if (initialized) 129 | return; 130 | 131 | initialized = TRUE; 132 | 133 | g_log_set_default_handler (gdm_log_default_handler, NULL); 134 | } 135 | 136 | void 137 | gdm_log_shutdown (void) 138 | { 139 | if (!initialized) 140 | return; 141 | if (!is_sd_booted) 142 | closelog (); 143 | initialized = FALSE; 144 | } 145 | 146 | -------------------------------------------------------------------------------- /common/gdm-log.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GDM_LOG_H 24 | #define __GDM_LOG_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | void gdm_log_set_debug (gboolean debug); 32 | void gdm_log_toggle_debug (void); 33 | void gdm_log_init (void); 34 | void gdm_log_shutdown (void); 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __GDM_LOG_H */ 39 | -------------------------------------------------------------------------------- /common/gdm-profile.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | #include "gdm-profile.h" 36 | 37 | void 38 | _gdm_profile_log (const char *func, 39 | const char *note, 40 | const char *format, 41 | ...) 42 | { 43 | va_list args; 44 | g_autofree char *str = NULL; 45 | g_autofree char *formatted = NULL; 46 | const char *prgname; 47 | 48 | if (format == NULL) { 49 | formatted = g_strdup (""); 50 | } else { 51 | va_start (args, format); 52 | formatted = g_strdup_vprintf (format, args); 53 | va_end (args); 54 | } 55 | 56 | prgname = g_get_prgname(); 57 | 58 | if (func != NULL) { 59 | str = g_strdup_printf ("MARK: %s %s: %s %s", 60 | prgname ? prgname : "(null)", 61 | func, 62 | note ? note : "", 63 | formatted); 64 | } else { 65 | str = g_strdup_printf ("MARK: %s: %s %s", 66 | prgname ? prgname : "(null)", 67 | note ? note : "", 68 | formatted); 69 | } 70 | 71 | g_access (str, F_OK); 72 | } 73 | -------------------------------------------------------------------------------- /common/gdm-profile.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: William Jon McCann 20 | * 21 | */ 22 | 23 | #ifndef __GDM_PROFILE_H 24 | #define __GDM_PROFILE_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #ifdef ENABLE_PROFILING 31 | #ifdef G_HAVE_ISO_VARARGS 32 | #define gdm_profile_start(...) _gdm_profile_log (G_STRFUNC, "start", __VA_ARGS__) 33 | #define gdm_profile_end(...) _gdm_profile_log (G_STRFUNC, "end", __VA_ARGS__) 34 | #define gdm_profile_msg(...) _gdm_profile_log (NULL, NULL, __VA_ARGS__) 35 | #elif defined(G_HAVE_GNUC_VARARGS) 36 | #define gdm_profile_start(format...) _gdm_profile_log (G_STRFUNC, "start", format) 37 | #define gdm_profile_end(format...) _gdm_profile_log (G_STRFUNC, "end", format) 38 | #define gdm_profile_msg(format...) _gdm_profile_log (NULL, NULL, format) 39 | #endif 40 | #else 41 | #define gdm_profile_start(...) 42 | #define gdm_profile_end(...) 43 | #define gdm_profile_msg(...) 44 | #endif 45 | 46 | void _gdm_profile_log (const char *func, 47 | const char *note, 48 | const char *format, 49 | ...) G_GNUC_PRINTF (3, 4); 50 | 51 | G_END_DECLS 52 | 53 | #endif /* __GDM_PROFILE_H */ 54 | -------------------------------------------------------------------------------- /common/gdm-settings-backend.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SETTINGS_BACKEND_H 23 | #define __GDM_SETTINGS_BACKEND_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GDM_TYPE_SETTINGS_BACKEND (gdm_settings_backend_get_type ()) 30 | G_DECLARE_DERIVABLE_TYPE (GdmSettingsBackend, gdm_settings_backend, GDM, SETTINGS_BACKEND, GObject) 31 | 32 | struct _GdmSettingsBackendClass 33 | { 34 | GObjectClass parent_class; 35 | 36 | /* methods */ 37 | gboolean (*get_value) (GdmSettingsBackend *settings_backend, 38 | const char *key, 39 | char **value, 40 | GError **error); 41 | gboolean (*set_value) (GdmSettingsBackend *settings_backend, 42 | const char *key, 43 | const char *value, 44 | GError **error); 45 | 46 | /* signals */ 47 | void (* value_changed) (GdmSettingsBackend *settings_backend, 48 | const char *key, 49 | const char *old_value, 50 | const char **new_value); 51 | }; 52 | 53 | typedef enum 54 | { 55 | GDM_SETTINGS_BACKEND_ERROR_GENERAL, 56 | GDM_SETTINGS_BACKEND_ERROR_KEY_NOT_FOUND 57 | } GdmSettingsBackendError; 58 | 59 | #define GDM_SETTINGS_BACKEND_ERROR gdm_settings_backend_error_quark () 60 | 61 | GQuark gdm_settings_backend_error_quark (void); 62 | 63 | gboolean gdm_settings_backend_get_value (GdmSettingsBackend *settings_backend, 64 | const char *key, 65 | char **value, 66 | GError **error); 67 | gboolean gdm_settings_backend_set_value (GdmSettingsBackend *settings_backend, 68 | const char *key, 69 | const char *value, 70 | GError **error); 71 | 72 | void gdm_settings_backend_value_changed (GdmSettingsBackend *settings_backend, 73 | const char *key, 74 | const char *old_value, 75 | const char *new_value); 76 | 77 | G_END_DECLS 78 | 79 | #endif /* __GDM_SETTINGS_BACKEND_H */ 80 | -------------------------------------------------------------------------------- /common/gdm-settings-desktop-backend.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SETTINGS_DESKTOP_BACKEND_H 23 | #define __GDM_SETTINGS_DESKTOP_BACKEND_H 24 | 25 | #include 26 | #include "gdm-settings-backend.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_SETTINGS_DESKTOP_BACKEND (gdm_settings_desktop_backend_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmSettingsDesktopBackend, gdm_settings_desktop_backend, GDM, SETTINGS_DESKTOP_BACKEND, GdmSettingsBackend) 32 | 33 | GdmSettingsBackend *gdm_settings_desktop_backend_new (const char* filename); 34 | 35 | G_END_DECLS 36 | 37 | #endif /* __GDM_SETTINGS_DESKTOP_BACKEND_H */ 38 | -------------------------------------------------------------------------------- /common/gdm-settings-direct.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SETTINGS_DIRECT_H 23 | #define __GDM_SETTINGS_DIRECT_H 24 | 25 | #include 26 | #include "gdm-settings.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | gboolean gdm_settings_direct_init (GdmSettings *settings, 31 | const char *schemas_file, 32 | const char *root); 33 | 34 | void gdm_settings_direct_reload (void); 35 | void gdm_settings_direct_shutdown (void); 36 | 37 | gboolean gdm_settings_direct_get_int (const char *key, 38 | int *value); 39 | gboolean gdm_settings_direct_get_uint (const char *key, 40 | uint *value); 41 | gboolean gdm_settings_direct_get_boolean (const char *key, 42 | gboolean *value); 43 | gboolean gdm_settings_direct_get_string (const char *key, 44 | char **value); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* __GDM_SETTINGS_DIRECT_H */ 49 | -------------------------------------------------------------------------------- /common/gdm-settings-keys.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef _GDM_SETTINGS_KEYS_H 22 | #define _GDM_SETTINGS_KEYS_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GDM_KEY_USER "daemon/User" 29 | #define GDM_KEY_GROUP "daemon/Group" 30 | #define GDM_KEY_AUTO_LOGIN_ENABLE "daemon/AutomaticLoginEnable" 31 | #define GDM_KEY_AUTO_LOGIN_USER "daemon/AutomaticLogin" 32 | #define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable" 33 | #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin" 34 | #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay" 35 | #define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable" 36 | #define GDM_KEY_PREFERRED_DISPLAY_SERVER "daemon/PreferredDisplayServer" 37 | #ifdef ENABLE_WAYLAND_SUPPORT 38 | #define GDM_KEY_WAYLAND_ENABLE "daemon/WaylandEnable" 39 | #endif 40 | #ifdef ENABLE_X11_SUPPORT 41 | #define GDM_KEY_XORG_ENABLE "daemon/XorgEnable" 42 | #endif 43 | #define GDM_KEY_REMOTE_LOGIN_ENABLE "daemon/RemoteLoginEnable" 44 | 45 | #define GDM_KEY_DEBUG "debug/Enable" 46 | 47 | #define GDM_KEY_DISALLOW_TCP "security/DisallowTCP" 48 | #define GDM_KEY_ALLOW_REMOTE_AUTOLOGIN "security/AllowRemoteAutoLogin" 49 | 50 | #define GDM_KEY_XDMCP_ENABLE "xdmcp/Enable" 51 | #define GDM_KEY_SHOW_LOCAL_GREETER "xdmcp/ShowLocalGreeter" 52 | #define GDM_KEY_MAX_PENDING "xdmcp/MaxPending" 53 | #define GDM_KEY_MAX_SESSIONS "xdmcp/MaxSessions" 54 | #define GDM_KEY_MAX_WAIT "xdmcp/MaxWait" 55 | #define GDM_KEY_DISPLAYS_PER_HOST "xdmcp/DisplaysPerHost" 56 | #define GDM_KEY_UDP_PORT "xdmcp/Port" 57 | #define GDM_KEY_INDIRECT "xdmcp/HonorIndirect" 58 | #define GDM_KEY_MAX_WAIT_INDIRECT "xdmcp/MaxWaitIndirect" 59 | #define GDM_KEY_WILLING "xdmcp/Willing" 60 | 61 | #define GDM_KEY_MULTICAST "chooser/Multicast" 62 | #define GDM_KEY_MULTICAST_ADDR "chooser/MulticastAddr" 63 | 64 | G_END_DECLS 65 | 66 | #endif /* _GDM_SETTINGS_KEYS_H */ 67 | -------------------------------------------------------------------------------- /common/gdm-settings-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SETTINGS_UTILS_H 23 | #define __GDM_SETTINGS_UTILS_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | typedef struct _GdmSettingsEntry GdmSettingsEntry; 30 | 31 | GdmSettingsEntry * gdm_settings_entry_new (void); 32 | void gdm_settings_entry_free (GdmSettingsEntry *entry); 33 | 34 | const char * gdm_settings_entry_get_key (GdmSettingsEntry *entry); 35 | const char * gdm_settings_entry_get_signature (GdmSettingsEntry *entry); 36 | const char * gdm_settings_entry_get_default_value (GdmSettingsEntry *entry); 37 | const char * gdm_settings_entry_get_value (GdmSettingsEntry *entry); 38 | 39 | void gdm_settings_entry_set_value (GdmSettingsEntry *entry, 40 | const char *value); 41 | 42 | gboolean gdm_settings_parse_schemas (const char *file, 43 | const char *root, 44 | GSList **list); 45 | 46 | gboolean gdm_settings_parse_value_as_boolean (const char *value, 47 | gboolean *boolval); 48 | gboolean gdm_settings_parse_value_as_integer (const char *value, 49 | int *intval); 50 | gboolean gdm_settings_parse_value_as_double (const char *value, 51 | gdouble *doubleval); 52 | 53 | char * gdm_settings_parse_boolean_as_value (gboolean boolval); 54 | char * gdm_settings_parse_integer_as_value (int intval); 55 | char * gdm_settings_parse_double_as_value (gdouble doubleval); 56 | 57 | 58 | G_END_DECLS 59 | 60 | #endif /* __GDM_SETTINGS_UTILS_H */ 61 | -------------------------------------------------------------------------------- /common/gdm-settings.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SETTINGS_H 23 | #define __GDM_SETTINGS_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GDM_TYPE_SETTINGS (gdm_settings_get_type ()) 30 | G_DECLARE_FINAL_TYPE (GdmSettings, gdm_settings, GDM, SETTINGS, GObject) 31 | 32 | typedef enum 33 | { 34 | GDM_SETTINGS_ERROR_GENERAL, 35 | GDM_SETTINGS_ERROR_KEY_NOT_FOUND 36 | } GdmSettingsError; 37 | 38 | #define GDM_SETTINGS_ERROR gdm_settings_error_quark () 39 | 40 | GQuark gdm_settings_error_quark (void); 41 | 42 | GdmSettings * gdm_settings_new (void); 43 | void gdm_settings_reload (GdmSettings *settings); 44 | 45 | /* exported */ 46 | 47 | gboolean gdm_settings_get_value (GdmSettings *settings, 48 | const char *key, 49 | char **value, 50 | GError **error); 51 | gboolean gdm_settings_set_value (GdmSettings *settings, 52 | const char *key, 53 | const char *value, 54 | GError **error); 55 | 56 | G_END_DECLS 57 | 58 | #endif /* __GDM_SETTINGS_H */ 59 | -------------------------------------------------------------------------------- /common/meson.build: -------------------------------------------------------------------------------- 1 | libgdmcommon_src = files( 2 | 'gdm-address.c', 3 | 'gdm-common.c', 4 | 'gdm-log.c', 5 | 'gdm-profile.c', 6 | 'gdm-settings-backend.c', 7 | 'gdm-settings-desktop-backend.c', 8 | 'gdm-settings-direct.c', 9 | 'gdm-settings-utils.c', 10 | 'gdm-settings.c', 11 | ) 12 | 13 | libgdmcommon_deps = [ 14 | logind_dep, 15 | gobject_dep, 16 | gio_dep, 17 | gio_unix_dep, 18 | ] 19 | 20 | if libselinux_dep.found() 21 | libgdmcommon_deps += libselinux_dep 22 | endif 23 | 24 | libgdmcommon_lib = static_library('gdmcommon', 25 | libgdmcommon_src, 26 | dependencies: libgdmcommon_deps, 27 | include_directories: config_h_dir, 28 | ) 29 | 30 | libgdmcommon_dep = declare_dependency( 31 | link_with: libgdmcommon_lib, 32 | dependencies: libgdmcommon_deps, 33 | include_directories: include_directories('.'), 34 | ) 35 | 36 | install_data('gdb-cmd') 37 | 38 | # test-log exectuable 39 | test_log = executable('test-log', 40 | 'test-log.c', 41 | dependencies: libgdmcommon_dep, 42 | include_directories: config_h_dir, 43 | ) 44 | -------------------------------------------------------------------------------- /common/test-log.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include "gdm-common.h" 36 | #include "gdm-log.h" 37 | 38 | static void 39 | test_log (void) 40 | { 41 | gdm_log_init (); 42 | 43 | g_debug ("Test debug 1"); 44 | gdm_log_set_debug (TRUE); 45 | g_debug ("Test debug 2"); 46 | 47 | g_message ("Test message"); 48 | g_warning ("Test warning"); 49 | g_critical ("Test critical"); 50 | g_error ("Test error"); 51 | } 52 | 53 | int 54 | main (int argc, char **argv) 55 | { 56 | 57 | test_log (); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /daemon/gdm-dbus-util.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Giovanni Campagna 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __GDM_DBUS_UTIL_H 22 | #define __GDM_DBUS_UTIL_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | GDBusServer *gdm_dbus_setup_private_server (GDBusAuthObserver *observer, 29 | GError **error); 30 | 31 | gboolean gdm_dbus_get_pid_for_name (const char *system_bus_name, 32 | pid_t *out_pid, 33 | GError **error); 34 | 35 | gboolean gdm_dbus_get_uid_for_name (const char *system_bus_name, 36 | uid_t *out_uid, 37 | GError **error); 38 | 39 | void gdm_dbus_error_ensure (GQuark domain); 40 | #endif 41 | -------------------------------------------------------------------------------- /daemon/gdm-display-access-file.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * gdm-display-access-file.h - Abstraction around xauth cookies 4 | * 5 | * Copyright (C) 2007 Ray Strode 6 | * 7 | * Written by Ray Strode 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 | * 02110-1301, USA. 23 | */ 24 | #ifndef __GDM_DISPLAY_ACCESS_FILE_H__ 25 | #define __GDM_DISPLAY_ACCESS_FILE_H__ 26 | 27 | #include 28 | #include 29 | 30 | #include "gdm-display.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GDM_TYPE_DISPLAY_ACCESS_FILE (gdm_display_access_file_get_type ()) 35 | G_DECLARE_FINAL_TYPE (GdmDisplayAccessFile, gdm_display_access_file, GDM, DISPLAY_ACCESS_FILE, GObject) 36 | 37 | #define GDM_DISPLAY_ACCESS_FILE_ERROR (gdm_display_access_file_error_quark ()) 38 | 39 | typedef enum _GdmDisplayAccessFileError GdmDisplayAccessFileError; 40 | 41 | enum _GdmDisplayAccessFileError 42 | { 43 | GDM_DISPLAY_ACCESS_FILE_ERROR_GENERAL = 0, 44 | GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY 45 | }; 46 | 47 | GQuark gdm_display_access_file_error_quark (void); 48 | 49 | GdmDisplayAccessFile *gdm_display_access_file_new (const char *username); 50 | gboolean gdm_display_access_file_open (GdmDisplayAccessFile *file, 51 | GError **error); 52 | gboolean gdm_display_access_file_add_display (GdmDisplayAccessFile *file, 53 | GdmDisplay *display, 54 | char **cookie, 55 | gsize *cookie_size, 56 | GError **error); 57 | gboolean gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile *file, 58 | GdmDisplay *display, 59 | const char *cookie, 60 | gsize cookie_size, 61 | GError **error); 62 | 63 | void gdm_display_access_file_close (GdmDisplayAccessFile *file); 64 | char *gdm_display_access_file_get_path (GdmDisplayAccessFile *file); 65 | 66 | G_END_DECLS 67 | #endif /* __GDM_DISPLAY_ACCESS_FILE_H__ */ 68 | -------------------------------------------------------------------------------- /daemon/gdm-display-factory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_DISPLAY_FACTORY_H 23 | #define __GDM_DISPLAY_FACTORY_H 24 | 25 | #include 26 | 27 | #include "gdm-display-store.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GDM_TYPE_DISPLAY_FACTORY (gdm_display_factory_get_type ()) 32 | G_DECLARE_DERIVABLE_TYPE (GdmDisplayFactory, gdm_display_factory, GDM, DISPLAY_FACTORY, GObject) 33 | 34 | struct _GdmDisplayFactoryClass 35 | { 36 | GObjectClass parent_class; 37 | 38 | gboolean (*start) (GdmDisplayFactory *factory); 39 | gboolean (*stop) (GdmDisplayFactory *factory); 40 | }; 41 | 42 | typedef enum 43 | { 44 | GDM_DISPLAY_FACTORY_ERROR_GENERAL 45 | } GdmDisplayFactoryError; 46 | 47 | #define GDM_DISPLAY_FACTORY_ERROR gdm_display_factory_error_quark () 48 | 49 | GQuark gdm_display_factory_error_quark (void); 50 | GType gdm_display_factory_get_type (void); 51 | 52 | gboolean gdm_display_factory_start (GdmDisplayFactory *manager); 53 | gboolean gdm_display_factory_stop (GdmDisplayFactory *manager); 54 | GdmDisplayStore * gdm_display_factory_get_display_store (GdmDisplayFactory *manager); 55 | void gdm_display_factory_queue_purge_displays (GdmDisplayFactory *manager); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* __GDM_DISPLAY_FACTORY_H */ 60 | -------------------------------------------------------------------------------- /daemon/gdm-display-store.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_DISPLAY_STORE_H 23 | #define __GDM_DISPLAY_STORE_H 24 | 25 | #include 26 | #include "gdm-display.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_DISPLAY_STORE (gdm_display_store_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmDisplayStore, gdm_display_store, GDM, DISPLAY_STORE, GObject) 32 | 33 | typedef enum 34 | { 35 | GDM_DISPLAY_STORE_ERROR_GENERAL 36 | } GdmDisplayStoreError; 37 | 38 | #define GDM_DISPLAY_STORE_ERROR gdm_display_store_error_quark () 39 | 40 | typedef gboolean (*GdmDisplayStoreFunc) (const char *id, 41 | GdmDisplay *display, 42 | gpointer user_data); 43 | 44 | GQuark gdm_display_store_error_quark (void); 45 | 46 | GdmDisplayStore * gdm_display_store_new (void); 47 | 48 | void gdm_display_store_add (GdmDisplayStore *store, 49 | GdmDisplay *display); 50 | void gdm_display_store_clear (GdmDisplayStore *store); 51 | gboolean gdm_display_store_remove (GdmDisplayStore *store, 52 | GdmDisplay *display); 53 | void gdm_display_store_foreach (GdmDisplayStore *store, 54 | GdmDisplayStoreFunc func, 55 | gpointer user_data); 56 | guint gdm_display_store_foreach_remove (GdmDisplayStore *store, 57 | GdmDisplayStoreFunc func, 58 | gpointer user_data); 59 | GdmDisplay * gdm_display_store_lookup (GdmDisplayStore *store, 60 | const char *id); 61 | 62 | GdmDisplay * gdm_display_store_find (GdmDisplayStore *store, 63 | GdmDisplayStoreFunc predicate, 64 | gpointer user_data); 65 | 66 | 67 | G_END_DECLS 68 | 69 | #endif /* __GDM_DISPLAY_STORE_H */ 70 | -------------------------------------------------------------------------------- /daemon/gdm-display.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /daemon/gdm-launch-environment.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_LAUNCH_ENVIRONMENT_H 23 | #define __GDM_LAUNCH_ENVIRONMENT_H 24 | 25 | #include 26 | #include "gdm-session.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_LAUNCH_ENVIRONMENT (gdm_launch_environment_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmLaunchEnvironment, gdm_launch_environment, GDM, LAUNCH_ENVIRONMENT, GObject) 32 | 33 | gboolean gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment); 34 | gboolean gdm_launch_environment_stop (GdmLaunchEnvironment *launch_environment); 35 | GdmSession * gdm_launch_environment_get_session (GdmLaunchEnvironment *launch_environment); 36 | char * gdm_launch_environment_get_session_id (GdmLaunchEnvironment *launch_environment); 37 | 38 | GdmLaunchEnvironment *gdm_create_greeter_launch_environment (const char *display_name, 39 | const char *seat_id, 40 | const char *session_type, 41 | const char *display_hostname, 42 | gboolean display_is_local); 43 | GdmLaunchEnvironment *gdm_create_initial_setup_launch_environment (const char *display_name, 44 | const char *seat_id, 45 | const char *session_type, 46 | const char *display_hostname, 47 | gboolean display_is_local); 48 | GdmLaunchEnvironment *gdm_create_chooser_launch_environment (const char *display_name, 49 | const char *seat_id, 50 | const char *display_hostname); 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __GDM_LAUNCH_ENVIRONMENT_H */ 55 | -------------------------------------------------------------------------------- /daemon/gdm-legacy-display.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_LEGACY_DISPLAY_H 23 | #define __GDM_LEGACY_DISPLAY_H 24 | 25 | #include 26 | #include "gdm-display.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_LEGACY_DISPLAY (gdm_legacy_display_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmLegacyDisplay, gdm_legacy_display, GDM, LEGACY_DISPLAY, GdmDisplay) 32 | 33 | GdmDisplay * gdm_legacy_display_new (int display_number); 34 | 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __GDM_LEGACY_DISPLAY_H */ 39 | -------------------------------------------------------------------------------- /daemon/gdm-local-display-factory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_LOCAL_DISPLAY_FACTORY_H 23 | #define __GDM_LOCAL_DISPLAY_FACTORY_H 24 | 25 | #include 26 | 27 | #include "gdm-display-factory.h" 28 | #include "gdm-display-store.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_LOCAL_DISPLAY_FACTORY (gdm_local_display_factory_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM, LOCAL_DISPLAY_FACTORY, GdmDisplayFactory) 34 | 35 | typedef enum 36 | { 37 | GDM_LOCAL_DISPLAY_FACTORY_ERROR_GENERAL 38 | } GdmLocalDisplayFactoryError; 39 | 40 | #define GDM_LOCAL_DISPLAY_FACTORY_ERROR gdm_local_display_factory_error_quark () 41 | 42 | GQuark gdm_local_display_factory_error_quark (void); 43 | 44 | GdmLocalDisplayFactory * gdm_local_display_factory_new (GdmDisplayStore *display_store); 45 | 46 | gboolean gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *factory, 47 | char **id, 48 | GError **error); 49 | G_END_DECLS 50 | 51 | #endif /* __GDM_LOCAL_DISPLAY_FACTORY_H */ 52 | -------------------------------------------------------------------------------- /daemon/gdm-local-display-factory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /daemon/gdm-local-display.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_LOCAL_DISPLAY_H 23 | #define __GDM_LOCAL_DISPLAY_H 24 | 25 | #include 26 | #include "gdm-display.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_LOCAL_DISPLAY (gdm_local_display_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmLocalDisplay, gdm_local_display, GDM, LOCAL_DISPLAY, GdmDisplay) 32 | 33 | GdmDisplay * gdm_local_display_new (void); 34 | 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __GDM_LOCAL_DISPLAY_H */ 39 | -------------------------------------------------------------------------------- /daemon/gdm-local-display.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /daemon/gdm-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2006 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_MANAGER_H 23 | #define __GDM_MANAGER_H 24 | 25 | #include 26 | 27 | #include "gdm-display.h" 28 | #include "gdm-manager-glue.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_MANAGER (gdm_manager_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmManager, gdm_manager, GDM, MANAGER, GdmDBusManagerSkeleton) 34 | 35 | typedef enum 36 | { 37 | GDM_MANAGER_ERROR_GENERAL 38 | } GdmManagerError; 39 | 40 | #define GDM_MANAGER_ERROR gdm_manager_error_quark () 41 | 42 | GQuark gdm_manager_error_quark (void); 43 | 44 | GdmManager * gdm_manager_new (void); 45 | void gdm_manager_start (GdmManager *manager); 46 | void gdm_manager_stop (GdmManager *manager); 47 | 48 | void gdm_manager_set_xdmcp_enabled (GdmManager *manager, 49 | gboolean enabled); 50 | void gdm_manager_set_show_local_greeter (GdmManager *manager, 51 | gboolean show_local_greeter); 52 | void gdm_manager_set_remote_login_enabled (GdmManager *manager, 53 | gboolean enabled); 54 | gboolean gdm_manager_get_displays (GdmManager *manager, 55 | GPtrArray **displays, 56 | GError **error); 57 | 58 | 59 | G_END_DECLS 60 | 61 | #endif /* __GDM_MANAGER_H */ 62 | -------------------------------------------------------------------------------- /daemon/gdm-manager.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /daemon/gdm-remote-display-factory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2022 Joan Torres 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_REMOTE_DISPLAY_FACTORY_H 23 | #define __GDM_REMOTE_DISPLAY_FACTORY_H 24 | 25 | #include 26 | 27 | #include "gdm-display-factory.h" 28 | #include "gdm-display-store.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_REMOTE_DISPLAY_FACTORY (gdm_remote_display_factory_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmRemoteDisplayFactory, gdm_remote_display_factory, GDM, REMOTE_DISPLAY_FACTORY, GdmDisplayFactory) 34 | 35 | GdmRemoteDisplayFactory * gdm_remote_display_factory_new (GdmDisplayStore *display_store); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GDM_REMOTE_DISPLAY_FACTORY_H */ 40 | -------------------------------------------------------------------------------- /daemon/gdm-remote-display-factory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /daemon/gdm-remote-display.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2022 Joan Torres 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_REMOTE_DISPLAY_H 23 | #define __GDM_REMOTE_DISPLAY_H 24 | 25 | #include 26 | #include 27 | 28 | #include "gdm-display.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_REMOTE_DISPLAY (gdm_remote_display_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmRemoteDisplay, gdm_remote_display, GDM, REMOTE_DISPLAY, GdmDisplay) 34 | 35 | GdmDisplay * gdm_remote_display_new (const char *remote_id); 36 | 37 | char * gdm_remote_display_get_remote_id (GdmRemoteDisplay *self); 38 | 39 | void gdm_remote_display_set_remote_id (GdmRemoteDisplay *self, 40 | const char *remote_id); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* __GDM_REMOTE_DISPLAY_H */ 45 | 46 | -------------------------------------------------------------------------------- /daemon/gdm-remote-display.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /daemon/gdm-server.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SERVER_H 23 | #define __GDM_SERVER_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GDM_TYPE_SERVER (gdm_server_get_type ()) 30 | G_DECLARE_FINAL_TYPE (GdmServer, gdm_server, GDM, SERVER, GObject); 31 | 32 | GdmServer * gdm_server_new (const char *display_id, 33 | const char *seat_id, 34 | const char *auth_file, 35 | gboolean initial); 36 | gboolean gdm_server_start (GdmServer *server); 37 | gboolean gdm_server_stop (GdmServer *server); 38 | char * gdm_server_get_display_device (GdmServer *server); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __GDM_SERVER_H */ 43 | -------------------------------------------------------------------------------- /daemon/gdm-session-auditor.h: -------------------------------------------------------------------------------- 1 | /* gdm-session-auditor.h - Object for auditing session login/logout 2 | * 3 | * Copyright (C) 2004, 2008 Sun Microsystems, Inc. 4 | * Copyright (C) 2005, 2008 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | * Written by: Brian A. Cameron 22 | * Gary Winiger 23 | * Ray Strode 24 | * Steve Grubb 25 | */ 26 | #ifndef GDM_SESSION_AUDITOR_H 27 | #define GDM_SESSION_AUDITOR_H 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GDM_TYPE_SESSION_AUDITOR (gdm_session_auditor_get_type ()) 35 | G_DECLARE_DERIVABLE_TYPE (GdmSessionAuditor, gdm_session_auditor, GDM, SESSION_AUDITOR, GObject) 36 | 37 | struct _GdmSessionAuditorClass 38 | { 39 | GObjectClass parent_class; 40 | 41 | void (* report_password_changed) (GdmSessionAuditor *auditor); 42 | void (* report_password_change_failure) (GdmSessionAuditor *auditor); 43 | void (* report_user_accredited) (GdmSessionAuditor *auditor); 44 | void (* report_login) (GdmSessionAuditor *auditor); 45 | void (* report_login_failure) (GdmSessionAuditor *auditor, 46 | int error_code, 47 | const char *error_message); 48 | void (* report_logout) (GdmSessionAuditor *auditor); 49 | }; 50 | 51 | GdmSessionAuditor *gdm_session_auditor_new (const char *hostname, 52 | const char *display_device); 53 | void gdm_session_auditor_set_username (GdmSessionAuditor *auditor, 54 | const char *username); 55 | void gdm_session_auditor_report_password_changed (GdmSessionAuditor *auditor); 56 | void gdm_session_auditor_report_password_change_failure (GdmSessionAuditor *auditor); 57 | void gdm_session_auditor_report_user_accredited (GdmSessionAuditor *auditor); 58 | void gdm_session_auditor_report_login (GdmSessionAuditor *auditor); 59 | void gdm_session_auditor_report_login_failure (GdmSessionAuditor *auditor, 60 | int error_code, 61 | const char *error_message); 62 | void gdm_session_auditor_report_logout (GdmSessionAuditor *auditor); 63 | 64 | G_END_DECLS 65 | #endif /* GDM_SESSION_AUDITOR_H */ 66 | -------------------------------------------------------------------------------- /daemon/gdm-session-enum-types.c.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | /*** END file-header ***/ 6 | 7 | /*** BEGIN file-production ***/ 8 | #include "@filename@" 9 | /* enumerations from "@filename@" */ 10 | /*** END file-production ***/ 11 | 12 | /*** BEGIN value-header ***/ 13 | GType @enum_name@_get_type (void) G_GNUC_CONST; 14 | 15 | GType 16 | @enum_name@_get_type (void) 17 | { 18 | static GType etype = 0; 19 | 20 | if (G_UNLIKELY(etype == 0)) { 21 | static const G@Type@Value values[] = { 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN value-production ***/ 25 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 26 | /*** END value-production ***/ 27 | 28 | /*** BEGIN value-tail ***/ 29 | { 0, NULL, NULL } 30 | }; 31 | 32 | etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 33 | } 34 | 35 | return etype; 36 | } 37 | 38 | /*** END value-tail ***/ 39 | 40 | /*** BEGIN file-tail ***/ 41 | /**/ 42 | /*** END file-tail ***/ 43 | -------------------------------------------------------------------------------- /daemon/gdm-session-enum-types.h.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #ifndef GDM_SESSION_ENUM_TYPES_H 3 | #define GDM_SESSION_ENUM_TYPES_H 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | /*** END file-header ***/ 9 | 10 | /*** BEGIN file-production ***/ 11 | 12 | /* enumerations from "@filename@" */ 13 | /*** END file-production ***/ 14 | 15 | /*** BEGIN value-header ***/ 16 | GType @enum_name@_get_type (void) G_GNUC_CONST; 17 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 18 | /*** END value-header ***/ 19 | 20 | /*** BEGIN file-tail ***/ 21 | G_END_DECLS 22 | 23 | #endif /* GDM_SESSION_ENUM_TYPES_H */ 24 | /*** END file-tail ***/ 25 | -------------------------------------------------------------------------------- /daemon/gdm-session-linux-auditor.h: -------------------------------------------------------------------------------- 1 | /* gdm-linux-session-auditor.h - Object for linux auditing of session login/logout 2 | * 3 | * Copyright (C) 2004, 2008 Sun Microsystems, Inc. 4 | * Copyright (C) 2005, 2008 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | * Written by: Brian A. Cameron 22 | * Gary Winiger 23 | * Ray Strode 24 | * Steve Grubb 25 | */ 26 | #ifndef GDM_SESSION_LINUX_AUDITOR_H 27 | #define GDM_SESSION_LINUX_AUDITOR_H 28 | 29 | #include 30 | #include 31 | 32 | #include "gdm-session-auditor.h" 33 | 34 | G_BEGIN_DECLS 35 | 36 | #define GDM_TYPE_SESSION_LINUX_AUDITOR (gdm_session_linux_auditor_get_type ()) 37 | G_DECLARE_FINAL_TYPE (GdmSessionLinuxAuditor, gdm_session_linux_auditor, GDM, SESSION_LINUX_AUDITOR, GdmSessionAuditor) 38 | 39 | GdmSessionAuditor *gdm_session_linux_auditor_new (const char *hostname, 40 | const char *display_device); 41 | 42 | G_END_DECLS 43 | #endif /* GDM_SESSION_LINUX_AUDITOR_H */ 44 | -------------------------------------------------------------------------------- /daemon/gdm-session-record.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2006 Ray Strode 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __GDM_SESSION_RECORD_H 22 | #define __GDM_SESSION_RECORD_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | void 29 | gdm_session_record_login (GPid session_pid, 30 | const char *user_name, 31 | const char *host_name, 32 | const char *x11_display_name, 33 | const char *display_device); 34 | void 35 | gdm_session_record_logout (GPid session_pid, 36 | const char *user_name, 37 | const char *host_name, 38 | const char *x11_display_name, 39 | const char *display_device); 40 | void 41 | gdm_session_record_failed (GPid session_pid, 42 | const char *user_name, 43 | const char *host_name, 44 | const char *x11_display_name, 45 | const char *display_device); 46 | 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GDM_SESSION_RECORD_H */ 51 | -------------------------------------------------------------------------------- /daemon/gdm-session-settings.h: -------------------------------------------------------------------------------- 1 | /* gdm-session-settings.h - Object for auditing session login/logout 2 | * 3 | * Copyright (C) 2008 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | * 20 | * Written by: Ray Strode 21 | */ 22 | #ifndef GDM_SESSION_SETTINGS_H 23 | #define GDM_SESSION_SETTINGS_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GDM_TYPE_SESSION_SETTINGS (gdm_session_settings_get_type ()) 31 | G_DECLARE_FINAL_TYPE (GdmSessionSettings, gdm_session_settings, GDM, SESSION_SETTINGS, GObject) 32 | 33 | GdmSessionSettings *gdm_session_settings_new (void); 34 | 35 | gboolean gdm_session_settings_load (GdmSessionSettings *settings, 36 | const char *username); 37 | gboolean gdm_session_settings_save (GdmSessionSettings *settings, 38 | const char *username); 39 | gboolean gdm_session_settings_is_loaded (GdmSessionSettings *settings); 40 | char *gdm_session_settings_get_language_name (GdmSessionSettings *settings); 41 | char *gdm_session_settings_get_session_name (GdmSessionSettings *settings); 42 | char *gdm_session_settings_get_session_type (GdmSessionSettings *settings); 43 | void gdm_session_settings_set_language_name (GdmSessionSettings *settings, 44 | const char *language_name); 45 | void gdm_session_settings_set_session_name (GdmSessionSettings *settings, 46 | const char *session_name); 47 | void gdm_session_settings_set_session_type (GdmSessionSettings *settings, 48 | const char *session_type); 49 | 50 | G_END_DECLS 51 | #endif /* GDM_SESSION_SETTINGS_H */ 52 | -------------------------------------------------------------------------------- /daemon/gdm-session-solaris-auditor.h: -------------------------------------------------------------------------------- 1 | /* gdm-solaris-session-auditor.h - Object for solaris auditing of session login/logout 2 | * 3 | * Copyright (C) 2004, 2008 Sun Microsystems, Inc. 4 | * Copyright (C) 2005, 2008 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | * 21 | * Written by: Brian A. Cameron 22 | * Gary Winiger 23 | * Ray Strode 24 | * Steve Grubb 25 | */ 26 | #ifndef GDM_SESSION_SOLARIS_AUDITOR_H 27 | #define GDM_SESSION_SOLARIS_AUDITOR_H 28 | 29 | #include 30 | #include 31 | 32 | #include "gdm-session-auditor.h" 33 | 34 | G_BEGIN_DECLS 35 | 36 | #define GDM_TYPE_SESSION_SOLARIS_AUDITOR (gdm_session_solaris_auditor_get_type ()) 37 | G_DECLARE_FINAL_TYPE (GdmSessionSolarisAuditor, gdm_session_solaris_auditor, GDM, SESSION_SOLARIS_AUDITOR, GdmSessionAuditor) 38 | 39 | GdmSessionAuditor *gdm_session_solaris_auditor_new (const char *hostname, 40 | const char *display_device); 41 | G_END_DECLS 42 | #endif /* GDM_SESSION_SOLARIS_AUDITOR_H */ 43 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker-common.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2006 Ray Strode 4 | * Copyright (C) 2012 Jasper St. Pierre 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | 26 | #include "gdm-session-worker-common.h" 27 | 28 | static const GDBusErrorEntry gdm_session_worker_error_entries[] = { 29 | { GDM_SESSION_WORKER_ERROR_GENERIC , "org.gnome.DisplayManager.SessionWorker.Error.Generic", }, 30 | { GDM_SESSION_WORKER_ERROR_WITH_SESSION_COMMAND , "org.gnome.DisplayManager.SessionWorker.Error.WithSessionCommand" }, 31 | { GDM_SESSION_WORKER_ERROR_FORKING , "org.gnome.DisplayManager.SessionWorker.Error.Forking" }, 32 | { GDM_SESSION_WORKER_ERROR_OPENING_MESSAGE_PIPE , "org.gnome.DisplayManager.SessionWorker.Error.OpeningMessagePipe" }, 33 | { GDM_SESSION_WORKER_ERROR_COMMUNICATING , "org.gnome.DisplayManager.SessionWorker.Error.Communicating" }, 34 | { GDM_SESSION_WORKER_ERROR_WORKER_DIED , "org.gnome.DisplayManager.SessionWorker.Error.WorkerDied" }, 35 | { GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE , "org.gnome.DisplayManager.SessionWorker.Error.ServiceUnavailable" }, 36 | { GDM_SESSION_WORKER_ERROR_AUTHENTICATING , "org.gnome.DisplayManager.SessionWorker.Error.Authenticating" }, 37 | { GDM_SESSION_WORKER_ERROR_AUTHORIZING , "org.gnome.DisplayManager.SessionWorker.Error.Authorizing" }, 38 | { GDM_SESSION_WORKER_ERROR_OPENING_LOG_FILE , "org.gnome.DisplayManager.SessionWorker.Error.OpeningLogFile" }, 39 | { GDM_SESSION_WORKER_ERROR_OPENING_SESSION , "org.gnome.DisplayManager.SessionWorker.Error.OpeningSession" }, 40 | { GDM_SESSION_WORKER_ERROR_GIVING_CREDENTIALS , "org.gnome.DisplayManager.SessionWorker.Error.GivingCredentials" }, 41 | { GDM_SESSION_WORKER_ERROR_WRONG_STATE , "org.gnome.DisplayManager.SessionWorker.Error.WrongState" }, 42 | { GDM_SESSION_WORKER_ERROR_OUTSTANDING_REQUEST , "org.gnome.DisplayManager.SessionWorker.Error.OutstandingRequest" }, 43 | { GDM_SESSION_WORKER_ERROR_IN_REAUTH_SESSION , "org.gnome.DisplayManager.SessionWorker.Error.InReauthSession" } 44 | }; 45 | 46 | GQuark 47 | gdm_session_worker_error_quark (void) 48 | { 49 | static volatile gsize error_quark = 0; 50 | 51 | g_dbus_error_register_error_domain ("gdm-session-worker-error-quark", 52 | &error_quark, 53 | gdm_session_worker_error_entries, 54 | G_N_ELEMENTS (gdm_session_worker_error_entries)); 55 | 56 | return (GQuark) error_quark; 57 | } 58 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker-common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2006 Ray Strode 4 | * Copyright (C) 2012 Jasper St. Pierre 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __GDM_SESSION_WORKER_COMMON_H 23 | #define __GDM_SESSION_WORKER_COMMON_H 24 | 25 | #include 26 | 27 | #define GDM_SESSION_WORKER_ERROR (gdm_session_worker_error_quark ()) 28 | 29 | GQuark gdm_session_worker_error_quark (void); 30 | 31 | typedef enum _GdmSessionWorkerError { 32 | GDM_SESSION_WORKER_ERROR_GENERIC = 0, 33 | GDM_SESSION_WORKER_ERROR_WITH_SESSION_COMMAND, 34 | GDM_SESSION_WORKER_ERROR_FORKING, 35 | GDM_SESSION_WORKER_ERROR_OPENING_MESSAGE_PIPE, 36 | GDM_SESSION_WORKER_ERROR_COMMUNICATING, 37 | GDM_SESSION_WORKER_ERROR_WORKER_DIED, 38 | GDM_SESSION_WORKER_ERROR_SERVICE_UNAVAILABLE, 39 | GDM_SESSION_WORKER_ERROR_TOO_MANY_RETRIES, 40 | GDM_SESSION_WORKER_ERROR_AUTHENTICATING, 41 | GDM_SESSION_WORKER_ERROR_AUTHORIZING, 42 | GDM_SESSION_WORKER_ERROR_OPENING_LOG_FILE, 43 | GDM_SESSION_WORKER_ERROR_OPENING_SESSION, 44 | GDM_SESSION_WORKER_ERROR_GIVING_CREDENTIALS, 45 | GDM_SESSION_WORKER_ERROR_WRONG_STATE, 46 | GDM_SESSION_WORKER_ERROR_OUTSTANDING_REQUEST, 47 | GDM_SESSION_WORKER_ERROR_IN_REAUTH_SESSION, 48 | } GdmSessionWorkerError; 49 | 50 | #endif /* GDM_SESSION_WORKER_COMMON_H */ 51 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker-enum-types.c.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | /*** END file-header ***/ 6 | 7 | /*** BEGIN file-production ***/ 8 | #include "@filename@" 9 | /* enumerations from "@filename@" */ 10 | /*** END file-production ***/ 11 | 12 | /*** BEGIN value-header ***/ 13 | GType @enum_name@_get_type (void) G_GNUC_CONST; 14 | 15 | GType 16 | @enum_name@_get_type (void) 17 | { 18 | static GType etype = 0; 19 | 20 | if (G_UNLIKELY(etype == 0)) { 21 | static const G@Type@Value values[] = { 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN value-production ***/ 25 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 26 | /*** END value-production ***/ 27 | 28 | /*** BEGIN value-tail ***/ 29 | { 0, NULL, NULL } 30 | }; 31 | 32 | etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 33 | } 34 | 35 | return etype; 36 | } 37 | 38 | /*** END value-tail ***/ 39 | 40 | /*** BEGIN file-tail ***/ 41 | /**/ 42 | /*** END file-tail ***/ 43 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker-enum-types.h.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #ifndef GDM_SESSION_WORKER_ENUM_TYPES_H 3 | #define GDM_SESSION_WORKER_ENUM_TYPES_H 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | /*** END file-header ***/ 9 | 10 | /*** BEGIN file-production ***/ 11 | 12 | /* enumerations from "@filename@" */ 13 | /*** END file-production ***/ 14 | 15 | /*** BEGIN value-header ***/ 16 | GType @enum_name@_get_type (void) G_GNUC_CONST; 17 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 18 | /*** END value-header ***/ 19 | 20 | /*** BEGIN file-tail ***/ 21 | G_END_DECLS 22 | 23 | #endif /* GDM_SESSION_WORKER_ENUM_TYPES_H */ 24 | /*** END file-tail ***/ 25 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker-job.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_SESSION_WORKER_JOB_H 23 | #define __GDM_SESSION_WORKER_JOB_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GDM_TYPE_SESSION_WORKER_JOB (gdm_session_worker_job_get_type ()) 30 | G_DECLARE_FINAL_TYPE (GdmSessionWorkerJob, gdm_session_worker_job, GDM, SESSION_WORKER_JOB, GObject) 31 | 32 | GdmSessionWorkerJob * gdm_session_worker_job_new (void); 33 | void gdm_session_worker_job_set_server_address (GdmSessionWorkerJob *session_worker_job, 34 | const char *server_address); 35 | void gdm_session_worker_job_set_for_reauth (GdmSessionWorkerJob *session_worker_job, 36 | gboolean for_reauth); 37 | void gdm_session_worker_job_set_environment (GdmSessionWorkerJob *session_worker_job, 38 | const char * const *environment); 39 | gboolean gdm_session_worker_job_start (GdmSessionWorkerJob *session_worker_job, 40 | const char *name); 41 | void gdm_session_worker_job_stop (GdmSessionWorkerJob *session_worker_job); 42 | void gdm_session_worker_job_stop_now (GdmSessionWorkerJob *session_worker_job); 43 | 44 | GPid gdm_session_worker_job_get_pid (GdmSessionWorkerJob *session_worker_job); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* __GDM_SESSION_WORKER_JOB_H */ 49 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2006 Ray Strode 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __GDM_SESSION_WORKER_H 22 | #define __GDM_SESSION_WORKER_H 23 | 24 | #include 25 | 26 | #include "gdm-session-worker-glue.h" 27 | #include "gdm-session-worker-common.h" 28 | #include "gdm-session-worker-enum-types.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_SESSION_WORKER (gdm_session_worker_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmSessionWorker, gdm_session_worker, GDM, SESSION_WORKER, GdmDBusWorkerSkeleton) 34 | 35 | typedef enum { 36 | GDM_SESSION_WORKER_STATE_NONE = 0, 37 | GDM_SESSION_WORKER_STATE_SETUP_COMPLETE, 38 | GDM_SESSION_WORKER_STATE_AUTHENTICATED, 39 | GDM_SESSION_WORKER_STATE_AUTHORIZED, 40 | GDM_SESSION_WORKER_STATE_ACCREDITED, 41 | GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED, 42 | GDM_SESSION_WORKER_STATE_SESSION_OPENED, 43 | GDM_SESSION_WORKER_STATE_SESSION_STARTED 44 | } GdmSessionWorkerState; 45 | 46 | GdmSessionWorker * gdm_session_worker_new (const char *server_address, 47 | gboolean is_for_reauth) G_GNUC_MALLOC; 48 | G_END_DECLS 49 | #endif /* GDM_SESSION_WORKER_H */ 50 | -------------------------------------------------------------------------------- /daemon/gdm-session-worker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /daemon/gdm-xdmcp-chooser-display.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_XDMCP_CHOOSER_DISPLAY_H 23 | #define __GDM_XDMCP_CHOOSER_DISPLAY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "gdm-xdmcp-display.h" 30 | #include "gdm-address.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GDM_TYPE_XDMCP_CHOOSER_DISPLAY (gdm_xdmcp_chooser_display_get_type ()) 35 | G_DECLARE_FINAL_TYPE (GdmXdmcpChooserDisplay, gdm_xdmcp_chooser_display, GDM, XDMCP_CHOOSER_DISPLAY, GdmXdmcpDisplay) 36 | 37 | GdmDisplay * gdm_xdmcp_chooser_display_new (const char *hostname, 38 | int number, 39 | GdmAddress *addr, 40 | gint32 serial_number); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* __GDM_XDMCP_CHOOSER_DISPLAY_H */ 45 | -------------------------------------------------------------------------------- /daemon/gdm-xdmcp-display-factory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_XDMCP_DISPLAY_FACTORY_H 23 | #define __GDM_XDMCP_DISPLAY_FACTORY_H 24 | 25 | #include 26 | 27 | #include "gdm-display-factory.h" 28 | #include "gdm-display-store.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GDM_TYPE_XDMCP_DISPLAY_FACTORY (gdm_xdmcp_display_factory_get_type ()) 33 | G_DECLARE_FINAL_TYPE (GdmXdmcpDisplayFactory, gdm_xdmcp_display_factory, GDM, XDMCP_DISPLAY_FACTORY, GdmDisplayFactory) 34 | 35 | typedef enum 36 | { 37 | GDM_XDMCP_DISPLAY_FACTORY_ERROR_GENERAL 38 | } GdmXdmcpDisplayFactoryError; 39 | 40 | #define GDM_XDMCP_DISPLAY_FACTORY_ERROR gdm_xdmcp_display_factory_error_quark () 41 | 42 | GQuark gdm_xdmcp_display_factory_error_quark (void); 43 | 44 | GdmXdmcpDisplayFactory * gdm_xdmcp_display_factory_new (GdmDisplayStore *display_store); 45 | 46 | void gdm_xdmcp_display_factory_set_port (GdmXdmcpDisplayFactory *manager, 47 | guint port); 48 | 49 | G_END_DECLS 50 | 51 | #endif /* __GDM_XDMCP_DISPLAY_FACTORY_H */ 52 | -------------------------------------------------------------------------------- /daemon/gdm-xdmcp-display.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #ifndef __GDM_XDMCP_DISPLAY_H 23 | #define __GDM_XDMCP_DISPLAY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "gdm-display.h" 30 | #include "gdm-address.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GDM_TYPE_XDMCP_DISPLAY (gdm_xdmcp_display_get_type ()) 35 | G_DECLARE_DERIVABLE_TYPE (GdmXdmcpDisplay, gdm_xdmcp_display, GDM, XDMCP_DISPLAY, GdmDisplay) 36 | 37 | struct _GdmXdmcpDisplayClass 38 | { 39 | GdmDisplayClass parent_class; 40 | }; 41 | 42 | gint32 gdm_xdmcp_display_get_session_number (GdmXdmcpDisplay *display); 43 | GdmAddress * gdm_xdmcp_display_get_remote_address (GdmXdmcpDisplay *display); 44 | 45 | GdmDisplay * gdm_xdmcp_display_new (const char *hostname, 46 | int number, 47 | GdmAddress *address, 48 | gint32 session_number); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* __GDM_XDMCP_DISPLAY_H */ 53 | -------------------------------------------------------------------------------- /daemon/org.freedesktop.DBus.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /data/.gitignore: -------------------------------------------------------------------------------- 1 | /gdm.service 2 | /greeter-dconf-defaults 3 | -------------------------------------------------------------------------------- /data/61-gdm.rules.in: -------------------------------------------------------------------------------- 1 | SUBSYSTEM!="pci", GOTO="gdm_pci_device_end" 2 | ACTION!="bind", ACTION!="add", GOTO="gdm_pci_device_end" 3 | 4 | # cirrus 5 | ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end" 6 | # virtio 7 | ATTR{vendor}=="0x1af4", ATTR{device}=="0x1050", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end" 8 | # qxl 9 | ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end" 10 | # vga 11 | ATTR{vendor}=="0x1234", ATTR{device}=="0x1111", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end" 12 | 13 | LABEL="gdm_pci_device_end" 14 | 15 | # If this machine has a hardware GPU, take note 16 | KERNEL!="card[0-9]*", GOTO="gdm_hardware_gpu_end" 17 | KERNEL=="card[0-9]-*", GOTO="gdm_hardware_gpu_end" 18 | SUBSYSTEM!="drm", GOTO="gdm_hardware_gpu_end" 19 | DRIVERS=="simple-framebuffer", GOTO="gdm_hardware_gpu_end" 20 | IMPORT{parent}="GDM_MACHINE_HAS_VIRTUAL_GPU" 21 | ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}!="1", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hardware-gpu" 22 | LABEL="gdm_hardware_gpu_end" 23 | 24 | # The vendor nvidia driver has multiple modules that need to be loaded before GDM can make an 25 | # informed choice on which way to proceed, so force GDM to wait until NVidia's modules are 26 | # loaded before starting up. 27 | KERNEL!="nvidia", GOTO="gdm_nvidia_end" 28 | SUBSYSTEM!="module", GOTO="gdm_nvidia_end" 29 | ACTION!="add", GOTO="gdm_nvidia_end" 30 | RUN+="/usr/bin/touch /run/udev/gdm-machine-has-vendor-nvidia-driver" 31 | 32 | # Import nvidia kernel parameters 33 | IMPORT{program}="/bin/sh -c \"sed -e 's/: /=/g' -e 's/\([^[:upper:]]\)\([[:upper:]]\)/\1_\2/g' -e 's/[[:lower:]]/\U&/g' -e 's/^/NVIDIA_/' /proc/driver/nvidia/params\"" 34 | 35 | # Check if S0ix-based power management is available 36 | # If it is, there's no need to check for the suspend/resume services 37 | ENV{NVIDIA_ENABLE_S0IX_POWER_MANAGEMENT}=="1", GOTO="gdm_nvidia_suspend_end" 38 | 39 | LABEL="gdm_nvidia_suspend_end" 40 | LABEL="gdm_nvidia_end" 41 | 42 | # If this is a hybrid graphics setup, take note 43 | KERNEL!="card[1-9]*", GOTO="gdm_hybrid_graphics_check_end" 44 | KERNEL=="card[1-9]-*", GOTO="gdm_hybrid_graphics_check_end" 45 | SUBSYSTEM!="drm", GOTO="gdm_hybrid_graphics_check_end" 46 | ACTION!="add", GOTO="gdm_hybrid_graphics_check_end" 47 | IMPORT{program}="/bin/sh -c \"echo GDM_NUMBER_OF_GRAPHICS_CARDS=`ls -1d /sys/class/drm/card[0-9] | wc -l`\"" 48 | ENV{GDM_NUMBER_OF_GRAPHICS_CARDS}=="1", RUN+="/usr/bin/rm -f /run/udev/gdm-machine-has-hybrid-graphics" 49 | ENV{GDM_NUMBER_OF_GRAPHICS_CARDS}!="1", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-hybrid-graphics" 50 | LABEL="gdm_hybrid_graphics_check_end" 51 | 52 | GOTO="gdm_end" 53 | 54 | 55 | LABEL="gdm_end" 56 | 57 | -------------------------------------------------------------------------------- /data/Init.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Stolen from the debian kdm setup, aren't I sneaky 3 | # Plus a lot of fun stuff added 4 | # -George 5 | 6 | PATH="@X_PATH@:$PATH" 7 | OLD_IFS=$IFS 8 | 9 | gdmwhich () { 10 | COMMAND="$1" 11 | OUTPUT= 12 | IFS=: 13 | for dir in $PATH 14 | do 15 | if test -x "$dir/$COMMAND" ; then 16 | if test "x$OUTPUT" = "x" ; then 17 | OUTPUT="$dir/$COMMAND" 18 | fi 19 | fi 20 | done 21 | IFS=$OLD_IFS 22 | echo "$OUTPUT" 23 | } 24 | 25 | if [ -f /etc/X11/Xresources ]; then 26 | sysresources=/etc/X11/Xresources 27 | else 28 | sysresources=/usr/etc/X11/Xresources 29 | fi 30 | 31 | # merge in defaults 32 | if [ -f "$sysresources" ]; then 33 | xrdb -nocpp -merge "$sysresources" 34 | fi 35 | 36 | if [ -f /etc/X11/Xmodmap ]; then 37 | sysmodmap=/etc/X11/Xmodmap 38 | else 39 | sysmodmap=/usr/etc/X11/Xmodmap 40 | fi 41 | 42 | XMODMAP=`gdmwhich xmodmap` 43 | if [ "x$XMODMAP" != "x" ] ; then 44 | if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then 45 | if [ -f $sysmodmap ]; then 46 | $XMODMAP $sysmodmap 47 | fi 48 | else 49 | ( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP - 50 | fi 51 | 52 | # 53 | # Switch Sun's Alt and Meta mod mappings 54 | # 55 | 56 | UNAME=`gdmwhich uname` 57 | PROCESSOR=`$UNAME -p` 58 | if [ "x$PROCESSOR" = "xsparc" ]; then 59 | if $XMODMAP | grep mod4 | grep Alt > /dev/null 2>/dev/null 60 | then 61 | $XMODMAP -e "clear Mod1" \ 62 | -e "clear Mod4" \ 63 | -e "add Mod1 = Alt_L" \ 64 | -e "add Mod1 = Alt_R" \ 65 | -e "add Mod4 = Meta_L" \ 66 | -e "add Mod4 = Meta_R" 67 | fi 68 | fi 69 | fi 70 | 71 | SETXKBMAP=`gdmwhich setxkbmap` 72 | if [ "x$SETXKBMAP" != "x" ] ; then 73 | # FIXME: is this all right? Is this completely on crack? 74 | # What this does is move the xkb configuration from the GDM_PARENT_DISPLAY 75 | # FIXME: This should be done in code. Or there must be an easier way ... 76 | if [ -n "$GDM_PARENT_DISPLAY" ]; then 77 | XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )` 78 | if [ -n "$XKBSETUP" ]; then 79 | XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'` 80 | XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'` 81 | XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'` 82 | XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'` 83 | XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'` 84 | if [ -n "$XKBKEYMAP" ]; then 85 | $SETXKBMAP -keymap "$XKBKEYMAP" 86 | elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then 87 | $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY" 88 | elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then 89 | $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" 90 | elif [ -n "$XKBSYMBOLS" ]; then 91 | $SETXKBMAP -symbols "$XKBSYMBOLS" 92 | fi 93 | fi 94 | fi 95 | fi 96 | 97 | exit 0 98 | -------------------------------------------------------------------------------- /data/PostLogin: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Note: this is a sample and will not be run as is. Change the name of this 4 | # file to /PostLogin/Default for this script to be run. This 5 | # script will be run before any setup is run on behalf of the user and is 6 | # useful if you for example need to do some setup to create a home directory 7 | # for the user or something like that. $HOME, $LOGIN and such will all be 8 | # set appropriately and this script is run as root. 9 | -------------------------------------------------------------------------------- /data/PostSession.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exit 0 4 | -------------------------------------------------------------------------------- /data/PreSession.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Note that any setup should come before the sessreg command as 4 | # that must be 'exec'ed for the pid to be correct (sessreg uses the parent 5 | # pid) 6 | # 7 | # Note that output goes into the .xsession-errors file for easy debugging 8 | # 9 | PATH="@X_PATH@:$PATH" 10 | -------------------------------------------------------------------------------- /data/applications/meson.build: -------------------------------------------------------------------------------- 1 | desktop_conf = { 2 | 'LIBDIR': gdm_prefix / get_option('libdir'), 3 | 'LIBEXECDIR': gdm_prefix / get_option('libexecdir'), 4 | 'LOCALSTATEDIR': gdm_prefix / get_option('localstatedir'), 5 | 'SBINDIR': gdm_prefix / get_option('sbindir'), 6 | 'SYSCONFDIR': gdm_prefix / get_option('sysconfdir'), 7 | } 8 | 9 | foreach desktop_file : [ 'mime-dummy-handler.desktop', 'mimeapps.list' ] 10 | configure_file( 11 | input: desktop_file, 12 | output: desktop_file, 13 | configuration: desktop_conf, 14 | install_dir: gdm_datadir / 'greeter' / 'applications', 15 | ) 16 | endforeach 17 | -------------------------------------------------------------------------------- /data/applications/mime-dummy-handler.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Dummy URI Handler 4 | Exec=true %U 5 | Terminal=false 6 | StartupNotify=false 7 | -------------------------------------------------------------------------------- /data/applications/mimeapps.list: -------------------------------------------------------------------------------- 1 | [Default Applications] 2 | x-scheme-handler/file=mime-dummy-handler.desktop 3 | x-scheme-handler/ftp=mime-dummy-handler.desktop 4 | x-scheme-handler/ghelp=mime-dummy-handler.desktop 5 | x-scheme-handler/help=mime-dummy-handler.desktop 6 | x-scheme-handler/http=mime-dummy-handler.desktop 7 | x-scheme-handler/https=mime-dummy-handler.desktop 8 | x-scheme-handler/info=mime-dummy-handler.desktop 9 | x-scheme-handler/irc=mime-dummy-handler.desktop 10 | x-scheme-handler/itms=mime-dummy-handler.desktop 11 | x-scheme-handler/mailto=mime-dummy-handler.desktop 12 | x-scheme-handler/man=mime-dummy-handler.desktop 13 | x-scheme-handler/mms=mime-dummy-handler.desktop 14 | x-scheme-handler/rtp=mime-dummy-handler.desktop 15 | x-scheme-handler/rtsp=mime-dummy-handler.desktop 16 | x-scheme-handler/sip=mime-dummy-handler.desktop 17 | x-scheme-handler/trash=mime-dummy-handler.desktop 18 | x-scheme-handler/webcal=mime-dummy-handler.desktop 19 | x-scheme-handler/xmpp=mime-dummy-handler.desktop 20 | -------------------------------------------------------------------------------- /data/autostart/meson.build: -------------------------------------------------------------------------------- 1 | autostart_files_conf = { 2 | 'LIBEXECDIR': gdm_prefix / get_option('libexecdir'), 3 | } 4 | 5 | foreach autostart_file : [ 'orca-autostart.desktop' ] 6 | configure_file( 7 | input: autostart_file, 8 | output: autostart_file, 9 | configuration: autostart_files_conf, 10 | install_dir: gdm_datadir / 'greeter' / 'autostart', 11 | ) 12 | endforeach 13 | -------------------------------------------------------------------------------- /data/autostart/orca-autostart.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Orca screen reader 4 | Exec=orca --disable main-window,splash-window --enable speech,braille 5 | NoDisplay=true 6 | AutostartCondition=GSettings org.gnome.desktop.a11y.applications screen-reader-enabled 7 | X-GNOME-AutoRestart=true 8 | -------------------------------------------------------------------------------- /data/dconf/.gitignore: -------------------------------------------------------------------------------- 1 | /gdm 2 | -------------------------------------------------------------------------------- /data/dconf/defaults/00-upstream-settings: -------------------------------------------------------------------------------- 1 | # This file is part of the GDM packaging and should not be changed. 2 | # 3 | # Instead create your own file next to it with a higher numbered prefix, 4 | # and run 5 | # 6 | # dconf update 7 | # 8 | 9 | [org/gnome/desktop/session] 10 | session-name='gnome-login' 11 | 12 | [org/gnome/desktop/input-sources] 13 | show-all-sources=true 14 | 15 | [org/gnome/desktop/a11y] 16 | always-show-universal-access-status=true 17 | 18 | [org/gnome/desktop/background] 19 | show-desktop-icons=false 20 | 21 | [org/gnome/desktop/default-applications/terminal] 22 | exec='true' 23 | 24 | [org/gnome/desktop/lockdown] 25 | disable-application-handlers=true 26 | disable-command-line=true 27 | disable-lock-screen=true 28 | disable-log-out=false 29 | disable-printing=true 30 | disable-print-setup=true 31 | disable-save-to-disk=true 32 | disable-user-switching=true 33 | 34 | [org/gnome/desktop/sound] 35 | event-sounds=true 36 | 37 | [org/gnome/settings-daemon/plugins/media-keys] 38 | calculator='' 39 | eject='' 40 | email='' 41 | help='' 42 | home='' 43 | media='' 44 | next='' 45 | pause='' 46 | play='' 47 | previous='' 48 | screensaver='' 49 | search='' 50 | stop='' 51 | www='' 52 | -------------------------------------------------------------------------------- /data/dconf/defaults/locks/00-upstream-settings-locks: -------------------------------------------------------------------------------- 1 | /org/gnome/desktop/a11y/keyboard/enable 2 | /org/gnome/desktop/background/show-desktop-icons 3 | /org/gnome/desktop/default-applications/terminal/exec 4 | /org/gnome/desktop/interface/toolkit-accessibility 5 | /org/gnome/desktop/lockdown/disable-application-handlers 6 | /org/gnome/desktop/lockdown/disable-command-line 7 | /org/gnome/desktop/lockdown/disable-lock-screen 8 | /org/gnome/desktop/lockdown/disable-log-out 9 | /org/gnome/desktop/lockdown/disable-printing 10 | /org/gnome/desktop/lockdown/disable-print-setup 11 | /org/gnome/desktop/lockdown/disable-save-to-disk 12 | /org/gnome/desktop/lockdown/disable-user-switching 13 | /org/gnome/desktop/session/session-name 14 | /org/gnome/desktop/sound/event-sounds 15 | /org/gnome/settings-daemon/plugins/media-keys/calculator 16 | /org/gnome/settings-daemon/plugins/media-keys/eject 17 | /org/gnome/settings-daemon/plugins/media-keys/email 18 | /org/gnome/settings-daemon/plugins/media-keys/help 19 | /org/gnome/settings-daemon/plugins/media-keys/home 20 | /org/gnome/settings-daemon/plugins/media-keys/media 21 | /org/gnome/settings-daemon/plugins/media-keys/next 22 | /org/gnome/settings-daemon/plugins/media-keys/pause 23 | /org/gnome/settings-daemon/plugins/media-keys/play 24 | /org/gnome/settings-daemon/plugins/media-keys/previous 25 | /org/gnome/settings-daemon/plugins/media-keys/screensaver 26 | /org/gnome/settings-daemon/plugins/media-keys/search 27 | /org/gnome/settings-daemon/plugins/media-keys/stop 28 | /org/gnome/settings-daemon/plugins/media-keys/www 29 | -------------------------------------------------------------------------------- /data/dconf/gdm.in: -------------------------------------------------------------------------------- 1 | user-db:user 2 | file-db:@DATADIR@/@PACKAGE@/greeter-dconf-defaults 3 | -------------------------------------------------------------------------------- /data/dconf/meson.build: -------------------------------------------------------------------------------- 1 | gdm_dconf = configure_file( 2 | input: 'gdm.in', 3 | output: '@BASENAME@', 4 | configuration: { 5 | 'DATADIR': gdm_prefix / get_option('datadir'), 6 | 'PACKAGE': meson.project_name(), 7 | }, 8 | install_dir: dconf_profiles_path, 9 | ) 10 | 11 | greeter_dconf_defaults = custom_target('greeter-dconf-defaults', 12 | output: 'greeter-dconf-defaults', 13 | input: files( 14 | 'defaults/00-upstream-settings', 15 | 'defaults/locks/00-upstream-settings-locks', 16 | ), 17 | command: [ 18 | find_program('dconf'), 19 | 'compile', 20 | '@OUTPUT@', 21 | meson.current_source_dir() / 'defaults', 22 | ], 23 | install: true, 24 | install_dir: gdm_datadir, 25 | ) 26 | -------------------------------------------------------------------------------- /data/gdm.conf-custom.in: -------------------------------------------------------------------------------- 1 | # GDM configuration storage 2 | 3 | [daemon] 4 | # Uncomment the lines below to force the login screen to use Xorg 5 | #WaylandEnable=false 6 | #XorgEnable=true 7 | 8 | [security] 9 | 10 | [xdmcp] 11 | 12 | [chooser] 13 | 14 | [debug] 15 | # Uncomment the line below to turn on debugging 16 | #Enable=true 17 | 18 | -------------------------------------------------------------------------------- /data/gdm.schemas.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | chooser/Multicast 6 | b 7 | false 8 | 9 | 10 | chooser/MulticastAddr 11 | s 12 | ff02::1 13 | 14 | 15 | 16 | daemon/User 17 | s 18 | @GDM_USERNAME@ 19 | 20 | 21 | daemon/Group 22 | s 23 | @GDM_GROUPNAME@ 24 | 25 | 26 | daemon/AutomaticLoginEnable 27 | b 28 | false 29 | 30 | 31 | daemon/AutomaticLogin 32 | s 33 | 34 | 35 | 36 | daemon/TimedLoginEnable 37 | b 38 | false 39 | 40 | 41 | daemon/TimedLogin 42 | s 43 | 44 | 45 | 46 | daemon/TimedLoginDelay 47 | i 48 | 30 49 | 50 | 51 | daemon/InitialSetupEnable 52 | b 53 | true 54 | 55 | 56 | daemon/PreferredDisplayServer 57 | s 58 | wayland 59 | 60 | 61 | daemon/WaylandEnable 62 | b 63 | true 64 | 65 | 66 | daemon/XorgEnable 67 | b 68 | false 69 | 70 | 71 | daemon/RemoteLoginEnable 72 | b 73 | true 74 | 75 | 76 | security/AllowRemoteAutoLogin 77 | b 78 | false 79 | 80 | 81 | 82 | debug/Enable 83 | b 84 | false 85 | 86 | 87 | 88 | security/DisallowTCP 89 | b 90 | true 91 | 92 | 93 | xdmcp/Enable 94 | b 95 | false 96 | 97 | 98 | xdmcp/ShowLocalGreeter 99 | b 100 | true 101 | 102 | 103 | xdmcp/MaxPending 104 | i 105 | 4 106 | 107 | 108 | xdmcp/MaxSessions 109 | i 110 | 16 111 | 112 | 113 | xdmcp/MaxWait 114 | i 115 | 30 116 | 117 | 118 | xdmcp/DisplaysPerHost 119 | i 120 | 1 121 | 122 | 123 | xdmcp/Port 124 | i 125 | 177 126 | 127 | 128 | xdmcp/HonorIndirect 129 | b 130 | true 131 | 132 | 133 | xdmcp/MaxWaitIndirect 134 | i 135 | 30 136 | 137 | 138 | xdmcp/Willing 139 | s 140 | @gdmconfdir@/Xwilling 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /data/gdm.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=GNOME Display Manager 3 | 4 | # replaces the getty 5 | Conflicts=getty@tty${GDM_INITIAL_VT}.service 6 | After=getty@tty${GDM_INITIAL_VT}.service 7 | 8 | # replaces plymouth-quit since it quits plymouth on its own 9 | Conflicts=${PLYMOUTH_QUIT_SERVICE} 10 | After=${PLYMOUTH_QUIT_SERVICE} 11 | 12 | # Needs all the dependencies of the services it's replacing 13 | # pulled from getty@.service and ${PLYMOUTH_QUIT_SERVICE} 14 | # (except for plymouth-quit-wait.service since it waits until 15 | # plymouth is quit, which we do) 16 | After=rc-local.service plymouth-start.service systemd-user-sessions.service 17 | 18 | # GDM takes responsibility for stopping plymouth, so if it fails 19 | # for any reason, make sure plymouth still stops 20 | OnFailure=plymouth-quit.service 21 | 22 | [Service] 23 | ExecStart=${sbindir}/gdm 24 | KillMode=mixed 25 | Restart=always 26 | IgnoreSIGPIPE=no 27 | BusName=org.gnome.DisplayManager 28 | EnvironmentFile=-${LANG_CONFIG_FILE} 29 | ExecReload=/bin/kill -SIGHUP $MAINPID 30 | KeyringMode=shared 31 | 32 | [Install] 33 | Alias=display-manager.service 34 | -------------------------------------------------------------------------------- /data/gnome-login.session.in: -------------------------------------------------------------------------------- 1 | [GNOME Session] 2 | Name=Display Manager 3 | RequiredComponents=@gnome_required_components@; 4 | -------------------------------------------------------------------------------- /data/locale.alias: -------------------------------------------------------------------------------- 1 | # You could insert none UTF-8 locales likes C, ja_JP.eucJP 2 | # The format is language label, space and locale name but 3 | # the language label is no longer used. 4 | # 5 | # This file will be removed in the future once gdm setup tool is generated. 6 | # 7 | #Unspecified C,POSIX 8 | -------------------------------------------------------------------------------- /data/org.gnome.login-screen.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | Whether or not to allow fingerprint readers for login 13 | 14 | 15 | The login screen can optionally allow users who have enrolled 16 | their fingerprints to log in using those prints. 17 | 18 | 19 | 20 | true 21 | 22 | Whether or not to allow smartcard readers for login 23 | 24 | 25 | The login screen can optionally allow users who have smartcards 26 | to log in using those smartcards. 27 | 28 | 29 | 30 | true 31 | 32 | Whether or not to allow passwords for login 33 | 34 | 35 | The login screen can be configured to disallow password authentication, 36 | forcing the user to use smartcard or fingerprint authentication. 37 | 38 | 39 | 40 | '' 41 | 42 | Path to small image at top of user list 43 | 44 | 45 | The login screen can optionally show a small image to provide site 46 | administrators and distributions a way to display branding. 47 | 48 | 49 | 50 | '' 51 | 52 | Path to small image at top of user list 53 | 54 | 55 | The fallback login screen can optionally show a small image to provide 56 | site administrators and distributions a way to display branding. 57 | 58 | 59 | 60 | false 61 | 62 | Avoid showing user list 63 | 64 | 65 | The login screen normally shows a list of available users to log in 66 | as. This setting can be toggled to disable showing the user list. 67 | 68 | 69 | 70 | false 71 | 72 | Enable showing the banner message 73 | 74 | 75 | Set to true to show the banner message text. 76 | 77 | 78 | 79 | "settings" 80 | 81 | Banner message source 82 | 83 | 84 | The source of the text banner message on the login screen. 85 | 86 | 87 | 88 | '' 89 | 90 | Banner message text 91 | 92 | 93 | Text banner message to show in the login window. 94 | 95 | 96 | 97 | '' 98 | 99 | Banner message path 100 | 101 | 102 | Path to text file with banner message to show in the login window. 103 | 104 | 105 | 106 | false 107 | 108 | Disable showing the restart buttons 109 | 110 | 111 | Set to true to disable showing the restart buttons in the login window. 112 | 113 | 114 | 115 | 3 116 | 117 | Number of allowed authentication failures 118 | 119 | 120 | The number of times a user is allowed to attempt authentication, before 121 | giving up and going back to user selection. 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /data/pam-arch/gdm-autologin.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_shells.so 4 | auth requisite pam_nologin.so 5 | auth optional pam_permit.so 6 | auth required pam_env.so 7 | auth [success=ok default=1] pam_gdm.so 8 | auth optional pam_gnome_keyring.so 9 | 10 | account include system-local-login 11 | 12 | password required pam_deny.so 13 | 14 | session include system-local-login 15 | session optional pam_gnome_keyring.so auto_start 16 | -------------------------------------------------------------------------------- /data/pam-arch/gdm-fingerprint.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_shells.so 4 | auth requisite pam_nologin.so 5 | auth requisite pam_faillock.so preauth 6 | auth required pam_fprintd.so 7 | auth optional pam_permit.so 8 | auth required pam_env.so 9 | auth [success=ok default=1] pam_gdm.so 10 | auth optional pam_gnome_keyring.so 11 | 12 | account include system-local-login 13 | 14 | password required pam_deny.so 15 | 16 | session include system-local-login 17 | session optional pam_gnome_keyring.so auto_start 18 | -------------------------------------------------------------------------------- /data/pam-arch/gdm-launch-environment.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_succeed_if.so audit quiet_success user in gdm:gnome-initial-setup 4 | auth optional pam_permit.so 5 | auth required pam_env.so 6 | 7 | account required pam_succeed_if.so audit quiet_success user in gdm:gnome-initial-setup 8 | account optional pam_permit.so 9 | 10 | password required pam_deny.so 11 | 12 | session optional pam_loginuid.so 13 | session optional pam_keyinit.so force revoke 14 | session required pam_succeed_if.so audit quiet_success user in gdm:gnome-initial-setup 15 | session optional pam_permit.so 16 | -session optional pam_systemd.so 17 | -session optional pam_elogind.so 18 | session required pam_env.so 19 | -------------------------------------------------------------------------------- /data/pam-arch/gdm-password.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth include system-local-login 4 | auth optional pam_gnome_keyring.so 5 | 6 | account include system-local-login 7 | 8 | password include system-local-login 9 | password optional pam_gnome_keyring.so use_authtok 10 | 11 | session include system-local-login 12 | session optional pam_gnome_keyring.so auto_start 13 | -------------------------------------------------------------------------------- /data/pam-arch/gdm-smartcard.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth requisite pam_nologin.so 4 | auth requisite pam_faillock.so preauth 5 | auth required pam_pkcs11.so wait_for_card card_only 6 | auth required pam_shells.so 7 | auth optional pam_permit.so 8 | auth required pam_env.so 9 | auth [success=ok default=1] pam_gdm.so 10 | auth optional pam_gnome_keyring.so 11 | 12 | account include system-local-login 13 | 14 | password required pam_deny.so 15 | 16 | session include system-local-login 17 | session optional pam_gnome_keyring.so auto_start 18 | -------------------------------------------------------------------------------- /data/pam-exherbo/gdm-autologin.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth [success=ok default=1] pam_gdm.so 4 | auth optional pam_gnome_keyring.so 5 | auth sufficient pam_permit.so 6 | 7 | account include system-local-login 8 | 9 | password include system-local-login 10 | 11 | session include system-local-login 12 | session optional pam_gnome_keyring.so auto_start 13 | -------------------------------------------------------------------------------- /data/pam-exherbo/gdm-fingerprint.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_shells.so 4 | auth required pam_nologin.so 5 | auth required pam_faillock.so preauth 6 | auth required pam_fprintd.so 7 | auth required pam_env.so 8 | auth [success=ok default=1] pam_gdm.so 9 | auth optional pam_gnome_keyring.so 10 | 11 | account include system-local-login 12 | 13 | password include system-local-login 14 | 15 | session include system-local-login 16 | session optional pam_gnome_keyring.so auto_start 17 | -------------------------------------------------------------------------------- /data/pam-exherbo/gdm-launch-environment.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_succeed_if.so audit quiet_success user = gdm 4 | auth required pam_env.so 5 | auth optional pam_permit.so 6 | 7 | account required pam_succeed_if.so audit quiet_success user = gdm 8 | account optional pam_permit.so 9 | 10 | password required pam_deny.so 11 | 12 | session optional pam_loginuid.so 13 | session optional pam_keyinit.so force revoke 14 | session required pam_succeed_if.so audit quiet_success user = gdm 15 | -session optional pam_systemd.so 16 | -session optional pam_elogind.so 17 | session optional pam_permit.so 18 | -------------------------------------------------------------------------------- /data/pam-exherbo/gdm-password.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth include system-local-login 4 | auth optional pam_gnome_keyring.so 5 | 6 | account include system-local-login 7 | 8 | password include system-local-login 9 | password optional pam_gnome_keyring.so use_authtok 10 | 11 | session include system-local-login 12 | session optional pam_gnome_keyring.so auto_start 13 | -------------------------------------------------------------------------------- /data/pam-exherbo/gdm-smartcard.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | 3 | auth required pam_shells.so 4 | auth required pam_nologin.so 5 | auth required pam_faillock.so preauth 6 | auth required pam_pkcs11.so wait_for_card card_only 7 | auth required pam_env.so 8 | auth [success=ok default=1] pam_gdm.so 9 | auth optional pam_gnome_keyring.so 10 | 11 | account include system-local-login 12 | 13 | password include system-local-login 14 | 15 | session include system-local-login 16 | session optional pam_gnome_keyring.so auto_start 17 | -------------------------------------------------------------------------------- /data/pam-lfs/gdm-autologin.pam: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/gdm-autologin 2 | 3 | auth requisite pam_nologin.so 4 | auth required pam_env.so 5 | 6 | auth required pam_succeed_if.so uid >= 1000 quiet 7 | auth optional pam_gdm.so 8 | auth optional pam_gnome_keyring.so 9 | auth required pam_permit.so 10 | 11 | account include system-account 12 | password include system-password 13 | 14 | session optional pam_keyinit.so revoke 15 | session required pam_limits.so 16 | session include system-session 17 | session optional pam_gnome_keyring.so auto_start 18 | 19 | # End /etc/pam.d/gdm-autologin 20 | -------------------------------------------------------------------------------- /data/pam-lfs/gdm-fingerprint.pam: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/gdm-fingerprint 2 | 3 | auth requisite pam_nologin.so 4 | auth required pam_env.so 5 | 6 | auth required pam_succeed_if.so uid >= 1000 quiet 7 | auth required pam_fprintd.so 8 | auth optional pam_gnome_keyring.so 9 | 10 | account include system-account 11 | password required pam_fprintd.so 12 | 13 | session optional pam_keyinit.so revoke 14 | session required pam_limits.so 15 | session include system-session 16 | session optional pam_gnome_keyring.so auto_start 17 | 18 | # End /etc/pam.d/gdm-fingerprint 19 | -------------------------------------------------------------------------------- /data/pam-lfs/gdm-launch-environment.pam: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/gdm-launch-environment 2 | 3 | auth required pam_succeed_if.so audit quiet_success user = gdm 4 | auth required pam_env.so 5 | auth optional pam_permit.so 6 | 7 | account required pam_succeed_if.so audit quiet_success user = gdm 8 | account include system-account 9 | 10 | password required pam_deny.so 11 | 12 | session required pam_succeed_if.so audit quiet_success user = gdm 13 | -session optional pam_systemd.so 14 | session optional pam_keyinit.so force revoke 15 | session optional pam_permit.so 16 | 17 | # End /etc/pam.d/gdm-launch-environment 18 | -------------------------------------------------------------------------------- /data/pam-lfs/gdm-password.pam: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/gdm-password 2 | 3 | auth requisite pam_nologin.so 4 | auth required pam_env.so 5 | 6 | auth required pam_succeed_if.so uid >= 1000 quiet 7 | auth include system-auth 8 | auth optional pam_gnome_keyring.so 9 | 10 | account include system-account 11 | password include system-password 12 | 13 | session required pam_limits.so 14 | session include system-session 15 | session optional pam_gnome_keyring.so auto_start 16 | 17 | # End /etc/pam.d/gdm-password 18 | -------------------------------------------------------------------------------- /data/pam-lfs/gdm-smartcard.pam: -------------------------------------------------------------------------------- 1 | # Begin /etc/pam.d/gdm-smartcard 2 | 3 | auth requisite pam_nologin.so 4 | auth required pam_env.so 5 | 6 | auth required pam_succeed_if.so uid >= 1000 quiet 7 | auth required pam_pkcs11.so wait_for_card card_only 8 | auth optional pam_gnome_keyring.so 9 | 10 | account include system-account 11 | password required pam_pkcs11.so 12 | 13 | session required pam_limits.so 14 | session include system-session 15 | session optional pam_gnome_keyring.so auto_start 16 | 17 | # End /etc/pam.d/gdm-smartcard 18 | -------------------------------------------------------------------------------- /data/pam-openembedded/gdm-autologin.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth required pam_permit.so 3 | account include common-account 4 | password include common-auth 5 | session include common-session 6 | -------------------------------------------------------------------------------- /data/pam-openembedded/gdm-launch-environment.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth required pam_permit.so 3 | account include common-account 4 | password include common-auth 5 | session include common-session 6 | -------------------------------------------------------------------------------- /data/pam-openembedded/gdm-password.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include common-auth 3 | account include common-account 4 | password include common-password 5 | session include common-session 6 | -------------------------------------------------------------------------------- /data/pam-redhat/gdm-autologin.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth [success=ok default=1] pam_gdm.so 3 | -auth optional pam_gnome_keyring.so 4 | auth sufficient pam_permit.so 5 | account required pam_nologin.so 6 | account include system-auth 7 | password include system-auth 8 | session required pam_selinux.so close 9 | session required pam_loginuid.so 10 | session required pam_selinux.so open 11 | session optional pam_keyinit.so force revoke 12 | session required pam_namespace.so 13 | session include system-auth 14 | session optional pam_gnome_keyring.so auto_start 15 | session include postlogin 16 | -------------------------------------------------------------------------------- /data/pam-redhat/gdm-fingerprint.pam: -------------------------------------------------------------------------------- 1 | auth substack fingerprint-auth 2 | auth include postlogin 3 | 4 | account required pam_nologin.so 5 | account include fingerprint-auth 6 | 7 | password include fingerprint-auth 8 | 9 | session required pam_selinux.so close 10 | session required pam_loginuid.so 11 | session required pam_selinux.so open 12 | session optional pam_keyinit.so force revoke 13 | session required pam_namespace.so 14 | session include fingerprint-auth 15 | session include postlogin 16 | -------------------------------------------------------------------------------- /data/pam-redhat/gdm-launch-environment.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth required pam_env.so 3 | auth required pam_permit.so 4 | auth include postlogin 5 | account required pam_permit.so 6 | password required pam_permit.so 7 | session optional pam_keyinit.so force revoke 8 | session include system-auth 9 | session include postlogin 10 | -------------------------------------------------------------------------------- /data/pam-redhat/gdm-password.pam: -------------------------------------------------------------------------------- 1 | auth [success=done ignore=ignore default=bad] pam_selinux_permit.so 2 | auth substack password-auth 3 | auth optional pam_gnome_keyring.so 4 | auth include postlogin 5 | 6 | account required pam_nologin.so 7 | account include password-auth 8 | 9 | password substack password-auth 10 | -password optional pam_gnome_keyring.so use_authtok 11 | 12 | session required pam_selinux.so close 13 | session required pam_loginuid.so 14 | session required pam_selinux.so open 15 | session optional pam_keyinit.so force revoke 16 | session required pam_namespace.so 17 | session include password-auth 18 | session optional pam_gnome_keyring.so auto_start 19 | session include postlogin 20 | -------------------------------------------------------------------------------- /data/pam-redhat/gdm-smartcard.pam: -------------------------------------------------------------------------------- 1 | auth substack smartcard-auth 2 | auth include postlogin 3 | 4 | account required pam_nologin.so 5 | account include smartcard-auth 6 | 7 | password include smartcard-auth 8 | 9 | session required pam_selinux.so close 10 | session required pam_loginuid.so 11 | session required pam_selinux.so open 12 | session optional pam_keyinit.so force revoke 13 | session required pam_namespace.so 14 | session include smartcard-auth 15 | session include postlogin 16 | -------------------------------------------------------------------------------- /data/polkit-gdm.rules.in: -------------------------------------------------------------------------------- 1 | polkit.addRule(function(action, subject) { 2 | if (subject.user !== "@GDM_USERNAME@") 3 | return undefined; 4 | 5 | if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" && 6 | subject.local && subject.active) { 7 | return polkit.Result.YES; 8 | } 9 | 10 | if ((action.id == "org.debian.pcsc-lite.access_pcsc" || 11 | action.id == "org.debian.pcsc-lite.access_card") && 12 | subject.local && subject.active) { 13 | return polkit.Result.YES; 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /data/session.conf.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | @wants_required_components@ 3 | 4 | Requires=@requires_component@.target 5 | -------------------------------------------------------------------------------- /docs/C/legal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is granted to copy, distribute and/or modify this 4 | document under the terms of the GNU Free Documentation 5 | License (GFDL), Version 1.1 or any later version published 6 | by the Free Software Foundation with no Invariant Sections, 7 | no Front-Cover Texts, and no Back-Cover Texts. You can find 8 | a copy of the GFDL at this link or in the file COPYING-DOCS 10 | distributed with this manual. 11 | 12 | This manual is part of a collection of GNOME manuals 13 | distributed under the GFDL. If you want to distribute this 14 | manual separately from the collection, you can do so by 15 | adding a copy of the license to the manual, as described in 16 | section 6 of the license. 17 | 18 | 19 | 20 | Many of the names used by companies to distinguish their 21 | products and services are claimed as trademarks. Where those 22 | names appear in any GNOME documentation, and the members of 23 | the GNOME Documentation Project are made aware of those 24 | trademarks, then the names are in capital letters or initial 25 | capital letters. 26 | 27 | 28 | 29 | DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED 30 | UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE 31 | WITH THE FURTHER UNDERSTANDING THAT: 32 | 33 | 34 | 35 | DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, 36 | WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR 37 | IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES 38 | THAT THE DOCUMENT OR MODIFIED VERSION OF THE 39 | DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR 40 | A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE 41 | RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE 42 | OF THE DOCUMENT OR MODIFIED VERSION OF THE 43 | DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR 44 | MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, 45 | YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY 46 | CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY 47 | SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER 48 | OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS 49 | LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED 50 | VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER 51 | EXCEPT UNDER THIS DISCLAIMER; AND 52 | 53 | 54 | 55 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL 56 | THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), 57 | CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, 58 | INITIAL WRITER, ANY CONTRIBUTOR, OR ANY 59 | DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION 60 | OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH 61 | PARTIES, BE LIABLE TO ANY PERSON FOR ANY 62 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR 63 | CONSEQUENTIAL DAMAGES OF ANY CHARACTER 64 | INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS 65 | OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR 66 | MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR 67 | LOSSES ARISING OUT OF OR RELATING TO USE OF THE 68 | DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, 69 | EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF 70 | THE POSSIBILITY OF SUCH DAMAGES. 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /docs/LINGUAS: -------------------------------------------------------------------------------- 1 | ca 2 | cs 3 | de 4 | el 5 | en_GB 6 | es 7 | eu 8 | fr 9 | gl 10 | hr 11 | hu 12 | id 13 | it 14 | ka 15 | ko 16 | nl 17 | oc 18 | pt_BR 19 | ro 20 | ru 21 | sl 22 | sv 23 | te 24 | tr 25 | uk 26 | zh_CN 27 | -------------------------------------------------------------------------------- /docs/meson.build: -------------------------------------------------------------------------------- 1 | gnome.yelp(meson.project_name(), 2 | sources: [ 3 | 'index.docbook', 4 | 'legal.xml', 5 | ], 6 | ) 7 | -------------------------------------------------------------------------------- /gdm.doap: -------------------------------------------------------------------------------- 1 | 6 | 7 | gdm 8 | Display manager and login screen 9 | 10 | 11 | 12 | 13 | 14 | 15 | C 16 | The GNOME Display Manager is a system service responsible for 17 | providing graphical log-ins and managing local and remote displays. 18 | 19 | 20 | Adrian Vovk 21 | 22 | adrianvovk 23 | 24 | 25 | 26 | 27 | 28 | Joan Torres 29 | 30 | joantorres 31 | 32 | 33 | 34 | 35 | 36 | Ray Strode 37 | 38 | halfline 39 | 40 | 41 | 50 | 51 | -------------------------------------------------------------------------------- /libgdm/gdm-sessions.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright 2008 Red Hat, Inc. 4 | * Copyright 2007 William Jon McCann 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Written by: Ray Strode 21 | * William Jon McCann 22 | */ 23 | 24 | #ifndef __GDM_GREETER_SESSIONS_H 25 | #define __GDM_GREETER_SESSIONS_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | char ** gdm_get_session_ids (void); 32 | char * gdm_get_session_name_and_description (const char *id, 33 | char **description); 34 | 35 | G_END_DECLS 36 | 37 | #endif /* __GDM_SESSION_H */ 38 | -------------------------------------------------------------------------------- /libgdm/gdm-user-switching.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Red Hat, Inc. 4 | * Copyright (C) 2012 Giovanni Campagna 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #include "common/gdm-common.h" 23 | #include "gdm-user-switching.h" 24 | 25 | gboolean 26 | gdm_goto_login_session_sync (GCancellable *cancellable, 27 | GError **error) 28 | { 29 | return gdm_goto_login_session (cancellable, error); 30 | } 31 | -------------------------------------------------------------------------------- /libgdm/gdm-user-switching.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Red Hat, Inc. 4 | * Copyright (C) 2012 Giovanni Campagna 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | */ 21 | 22 | #ifndef __GDM_USER_SWITCHING_H 23 | #define __GDM_USER_SWITCHING_H 24 | 25 | #include 26 | #include 27 | 28 | gboolean gdm_goto_login_session_sync (GCancellable *cancellable, 29 | GError **error); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libgdm/gdm.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: GDM Client Library 7 | Description: Client Library for communicating with GDM daemon 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lgdm 10 | Cflags: -I${includedir}/gdm 11 | Requires: gobject-2.0 12 | -------------------------------------------------------------------------------- /libgdm/libgdm.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | *; 4 | local: 5 | _*; 6 | }; 7 | -------------------------------------------------------------------------------- /libgdm/meson.build: -------------------------------------------------------------------------------- 1 | libgdm_manager_dbus_gen = gnome.gdbus_codegen('gdm-manager-glue', 2 | sources: '..' / 'daemon' / 'gdm-manager.xml', 3 | namespace: 'Gdm', 4 | interface_prefix: 'org.gnome.DisplayManager', 5 | autocleanup: 'all', 6 | annotations: [ 7 | [ 'org.gnome.DisplayManager.Manager', 'org.gtk.GDBus.C.Name', 'Manager' ], 8 | ], 9 | build_by_default: true, 10 | ) 11 | libgdm_client_dbus_gen = gnome.gdbus_codegen('gdm-client-glue', 12 | sources: '..' / 'daemon' / 'gdm-session.xml', 13 | namespace: 'Gdm', 14 | interface_prefix: 'org.gnome.DisplayManager', 15 | autocleanup: 'all', 16 | annotations: [ 17 | [ 'org.gnome.DisplayManager.UserVerifier', 'org.gtk.GDBus.C.Name', 'UserVerifier' ], 18 | [ 'org.gnome.DisplayManager.Greeter', 'org.gtk.GDBus.C.Name', 'Greeter' ], 19 | [ 'org.gnome.DisplayManager.RemoteGreeter', 'org.gtk.GDBus.C.Name', 'RemoteGreeter' ], 20 | [ 'org.gnome.DisplayManager.Chooser', 'org.gtk.GDBus.C.Name', 'Chooser' ], 21 | ], 22 | build_by_default: true, 23 | install_header: true, 24 | install_dir: get_option('includedir') / meson.project_name() 25 | ) 26 | 27 | libgdm_built_sources = [ 28 | libgdm_manager_dbus_gen, 29 | libgdm_client_dbus_gen, 30 | ] 31 | 32 | libgdm_sources = files( 33 | 'gdm-client.c', 34 | 'gdm-sessions.c', 35 | 'gdm-user-switching.c', 36 | ) 37 | 38 | libgdm_public_headers = [ 39 | 'gdm-client.h', 40 | 'gdm-sessions.h', 41 | 'gdm-user-switching.h', 42 | # gdm-client-glue.h is automatically installed 43 | ] 44 | 45 | install_headers(libgdm_public_headers, 46 | subdir: meson.project_name(), 47 | ) 48 | 49 | libgdm_headers = [ 50 | libgdm_public_headers, 51 | libgdm_client_dbus_gen[1], 52 | libgdm_manager_dbus_gen[1], 53 | ] 54 | 55 | libgdm_deps = [ 56 | glib_dep, 57 | gio_dep, 58 | gio_unix_dep, 59 | logind_dep, 60 | libgdmcommon_dep, 61 | ] 62 | 63 | libgdm_link_flags = [ 64 | '-Wl,--version-script,@0@/libgdm.map'.format(meson.current_source_dir()), 65 | ] 66 | 67 | libgdm = library('gdm', 68 | libgdm_sources + libgdm_built_sources, 69 | version: '1.0.0', 70 | dependencies: libgdm_deps, 71 | include_directories: config_h_dir, 72 | link_args: libgdm_link_flags, 73 | install: true, 74 | ) 75 | 76 | libgdm_gir_includes = [ 77 | 'GLib-2.0', 78 | 'GObject-2.0', 79 | 'Gio-2.0', 80 | ] 81 | 82 | libgdm_dep = declare_dependency( 83 | link_with: libgdm, 84 | dependencies: libgdm_deps, 85 | include_directories: include_directories('.'), 86 | sources: libgdm_built_sources, 87 | ) 88 | 89 | libgdm_gir = gnome.generate_gir(libgdm, 90 | sources: [ 91 | libgdm_headers, 92 | libgdm_sources, 93 | libgdm_built_sources, 94 | ], 95 | namespace: 'Gdm', 96 | nsversion: '1.0', 97 | identifier_prefix: 'Gdm', 98 | includes: libgdm_gir_includes, 99 | install: true, 100 | ) 101 | 102 | # Pkg-config file 103 | pkgconfig.generate(libgdm, 104 | name: 'GDM Client Library', 105 | description: 'Client Library for communicating with GDM daemon', 106 | filebase: meson.project_name(), 107 | requires: gobject_dep, 108 | ) 109 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gdm/514148b82f58a18ebc3c7d65f044779e25fc97c7/logo.png -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('at-spi-registryd-dir', type: 'string', value: '', description: 'Specify the directory of at-spi-registryd.') 2 | option('custom-conf', type: 'string', value: '', description: 'Filename to give to custom configuration file.') 3 | option('dbus-sys', type: 'string', value: '', description: 'Where D-Bus systemd directory is.') 4 | option('default-pam-config', type: 'combo', choices: [ 'autodetect', 'redhat', 'openembedded', 'exherbo', 'lfs', 'arch', 'none'], value: 'autodetect', description: '') 5 | option('default-path', type: 'string', value: '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin', description: 'Path GDM will use as the user\'s default PATH.') 6 | option('defaults-conf', type: 'string', value: '', description: 'Filename to give to defaults file.') 7 | option('distro', type: 'string', value: 'none', description: 'Distribution name, used to detect PAM files and hook scripts.') 8 | option('dmconfdir', type: 'string', value: '', description: 'Directory where sessions are stored.') 9 | option('gdm-xsession', type: 'boolean', value: false, description: 'Enable installing the gdm Xsession file.') 10 | option('gnome-settings-daemon-dir', type: 'string', value: '', description: 'Specify the directory of gnome-settings-daemon used by the chooser.') 11 | option('group', type: 'string', value: 'gdm', description: 'GDM\'s group.') 12 | option('initial-vt', type: 'integer', value: 1, description: 'Initial virtual terminal to use.') 13 | option('ipv6', type: 'boolean', value: false, description: 'Enables compilation of IPv6 code.') 14 | option('lang-file', type: 'string', value: '', description: 'File containing default language settings.') 15 | option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.') 16 | option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.') 17 | option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.') 18 | option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.') 19 | option('pam-prefix', type: 'string', value: '', description: 'Specify where PAM files go.') 20 | option('pid-file', type: 'string', value: '', description: 'Pid file.') 21 | option('plymouth', type: 'feature', value: 'auto', description: 'Add plymouth support.') 22 | option('private-dbus-dir', type: 'string', value: '', description: 'Directory for private D-Bus server sockets') 23 | option('profiling', type: 'boolean', value: false, description: 'Enable profiling.') 24 | option('ran-once-marker-dir', type: 'string', value: '', description: 'Ran once marker directory.') 25 | option('run-dir', type: 'string', value: '', description: 'Runtime directory.') 26 | option('runtime-conf', type: 'string', value: '', description: 'Filename to give to runtime configuration file.') 27 | option('screenshot-dir', type: 'string', value: '', description: 'Directory to store greeter screenshot.') 28 | option('selinux', type: 'feature', value: 'auto', description: 'Add SELinux support.') 29 | option('solaris', type: 'boolean', value: false, description: 'Build for Solaris') 30 | option('split-authentication', type: 'boolean', value: true, description: 'Enable multiple simultaneous PAM conversations during login.') 31 | option('sysconfsubdir', type: 'string', value: 'gdm', description: 'Directory name used under sysconfdir.') 32 | option('systemd-journal', type: 'boolean', value: true, description: 'Use journald support.') 33 | option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files, or \'no\' to disable.') 34 | option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files, or \'no\' to disable.') 35 | option('tcp-wrappers', type: 'boolean', value: false, description: 'Use TCP wrappers.') 36 | option('udev-dir', type: 'string', value: '', description: 'Directory for udev rules file.') 37 | option('user', type: 'string', value: 'gdm', description: 'GDM\'s username.') 38 | option('user-display-server', type: 'boolean', value: true, description: 'Enable running X server as user.') 39 | option('wayland-support', type: 'boolean', value: true, description: 'Enable support for wayland sessions.') 40 | option('working-dir', type: 'string', value: '', description: 'Working directory.') 41 | option('x11-support', type: 'boolean', value: false, description: 'Enable support for x11 sessions.') 42 | option('xauth-dir', type: 'string', value: '', description: 'XAuth cookie directory.') 43 | option('xdmcp', type: 'feature', value: 'auto', description: 'Add XDMCP (remote login) support.') 44 | -------------------------------------------------------------------------------- /pam-extensions/gdm-choice-list-pam-extension.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | #ifndef GDM_CHOICE_LIST_PAM_EXTENSION_H 21 | #define GDM_CHOICE_LIST_PAM_EXTENSION_H 22 | 23 | #include "gdm-pam-extensions-common.h" 24 | 25 | typedef struct { 26 | const char *key; 27 | const char *text; 28 | } GdmChoiceListItems; 29 | 30 | typedef struct { 31 | size_t number_of_items; 32 | GdmChoiceListItems items[]; 33 | } GdmChoiceList; 34 | 35 | typedef struct { 36 | GdmPamExtensionMessage header; 37 | 38 | char *prompt_message; 39 | GdmChoiceList list; 40 | } GdmPamExtensionChoiceListRequest; 41 | 42 | typedef struct { 43 | GdmPamExtensionMessage header; 44 | 45 | char *key; 46 | } GdmPamExtensionChoiceListResponse; 47 | 48 | #define GDM_PAM_EXTENSION_CHOICE_LIST "org.gnome.DisplayManager.UserVerifier.ChoiceList" 49 | 50 | #define GDM_CHOICE_LIST_SIZE(num_items) (offsetof(GdmChoiceList, items) + (num_items) * sizeof (GdmChoiceListItems)) 51 | #define GDM_PAM_EXTENSION_CHOICE_LIST_REQUEST_SIZE(num_items) (offsetof(GdmPamExtensionChoiceListRequest, list) + GDM_CHOICE_LIST_SIZE((num_items))) 52 | #define GDM_PAM_EXTENSION_CHOICE_LIST_REQUEST_INIT(request, title, num_items) \ 53 | { \ 54 | int _n = num_items; \ 55 | GDM_PAM_EXTENSION_LOOK_UP_TYPE (GDM_PAM_EXTENSION_CHOICE_LIST, &request->header.type); \ 56 | request->header.length = htobe32 (GDM_PAM_EXTENSION_CHOICE_LIST_REQUEST_SIZE(_n)); \ 57 | request->prompt_message = title; \ 58 | request->list.number_of_items = _n; \ 59 | } 60 | 61 | #define GDM_PAM_EXTENSION_CHOICE_LIST_RESPONSE_SIZE sizeof (GdmPamExtensionChoiceListResponse) 62 | #define GDM_PAM_EXTENSION_CHOICE_LIST_RESPONSE_INIT(response) \ 63 | { \ 64 | GDM_PAM_EXTENSION_LOOK_UP_TYPE (GDM_PAM_EXTENSION_CHOICE_LIST, &response->header.type); \ 65 | response->header.length = htobe32 (GDM_PAM_EXTENSION_CHOICE_LIST_RESPONSE_SIZE); \ 66 | response->key = NULL; \ 67 | } 68 | #define GDM_PAM_EXTENSION_REPLY_TO_CHOICE_LIST_RESPONSE(reply) ((GdmPamExtensionChoiceListResponse *) (void *) reply->resp) 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /pam-extensions/gdm-custom-json-pam-extension.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2023 Canonical Ltd. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * Author: Marco Trevisan (Treviño) 20 | * 21 | */ 22 | 23 | #pragma once 24 | 25 | #include "gdm-pam-extensions-common.h" 26 | 27 | typedef struct { 28 | GdmPamExtensionMessage header; 29 | 30 | const char protocol_name[64]; 31 | unsigned int version; 32 | char *json; 33 | } GdmPamExtensionJSONProtocol; 34 | 35 | #define GDM_PAM_EXTENSION_CUSTOM_JSON "org.gnome.DisplayManager.UserVerifier.CustomJSON" 36 | #define GDM_PAM_EXTENSION_CUSTOM_JSON_SIZE sizeof (GdmPamExtensionJSONProtocol) 37 | 38 | #define GDM_PAM_EXTENSION_CUSTOM_JSON_REQUEST_INIT(request, proto_name, proto_version, json_str) \ 39 | { \ 40 | size_t proto_len = strnlen ((proto_name), sizeof ((request)->protocol_name) - 1); \ 41 | GDM_PAM_EXTENSION_LOOK_UP_TYPE (GDM_PAM_EXTENSION_CUSTOM_JSON, &((request)->header.type)); \ 42 | (request)->header.length = htobe32 (GDM_PAM_EXTENSION_CUSTOM_JSON_SIZE); \ 43 | memcpy ((char *)(request)->protocol_name, (proto_name), proto_len); \ 44 | ((char *)((request)->protocol_name))[proto_len] = '\0'; \ 45 | (request)->version = (proto_version); \ 46 | (request)->json = (char *) (json_str); \ 47 | } 48 | 49 | #define GDM_PAM_EXTENSION_CUSTOM_JSON_RESPONSE_INIT(response, proto_name, proto_version) \ 50 | { \ 51 | size_t proto_len = strnlen ((proto_name), sizeof ((response)->protocol_name) - 1); \ 52 | GDM_PAM_EXTENSION_LOOK_UP_TYPE (GDM_PAM_EXTENSION_CUSTOM_JSON, &((response)->header.type)); \ 53 | (response)->header.length = htobe32 (GDM_PAM_EXTENSION_CUSTOM_JSON_SIZE); \ 54 | memcpy ((char *)(response)->protocol_name, (proto_name), proto_len); \ 55 | ((char *)((response)->protocol_name))[proto_len] = '\0'; \ 56 | (response)->version = (proto_version); \ 57 | (response)->json = NULL; \ 58 | } 59 | 60 | #define GDM_PAM_EXTENSION_REPLY_TO_CUSTOM_JSON_RESPONSE(reply) \ 61 | ((GdmPamExtensionJSONProtocol *) (void *) reply->resp) 62 | -------------------------------------------------------------------------------- /pam-extensions/gdm-pam-extensions.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Red Hat, Inc. 4 | * Copyright (C) 2023 Canonical Ltd. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | */ 21 | #ifndef GDM_PAM_EXTENSIONS_H 22 | #define GDM_PAM_EXTENSIONS_H 23 | 24 | #include "gdm-choice-list-pam-extension.h" 25 | #include "gdm-custom-json-pam-extension.h" 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /pam-extensions/gdm-pam-extensions.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: GDM PAM Extensions 7 | Description: Macros for custom protocols over PAM 8 | Version: @VERSION@ 9 | Cflags: -I${includedir}/gdm 10 | -------------------------------------------------------------------------------- /pam-extensions/meson.build: -------------------------------------------------------------------------------- 1 | if pam_extensions_supported 2 | pkgconfig.generate( 3 | name: 'GDM PAM Extensions', 4 | description: 'Macros for custom protocols over PAM', 5 | filebase: 'gdm-pam-extensions', 6 | version: meson.project_version(), 7 | subdirs: meson.project_name(), 8 | ) 9 | 10 | header_files = files('gdm-pam-extensions.h', 11 | 'gdm-pam-extensions-common.h', 12 | 'gdm-choice-list-pam-extension.h', 13 | 'gdm-custom-json-pam-extension.h') 14 | 15 | pam_extensions_inc = include_directories('.') 16 | install_headers(header_files, 17 | subdir: meson.project_name() 18 | ) 19 | endif 20 | -------------------------------------------------------------------------------- /pam_gdm/meson.build: -------------------------------------------------------------------------------- 1 | pam_gdm_deps = [ 2 | libpam_dep, 3 | ] 4 | 5 | if keyutils_dep.found() 6 | pam_gdm_deps += keyutils_dep 7 | endif 8 | 9 | pam_gdm = library('pam_gdm', 10 | 'pam_gdm.c', 11 | dependencies: pam_gdm_deps, 12 | include_directories: config_h_dir, 13 | name_prefix: '', 14 | install: true, 15 | install_dir: pam_mod_dir, 16 | ) 17 | -------------------------------------------------------------------------------- /pam_gdm/pam_gdm.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef HAVE_KEYUTILS 31 | #include 32 | #endif 33 | 34 | int 35 | pam_sm_authenticate (pam_handle_t *pamh, 36 | int flags, 37 | int argc, 38 | const char **argv) 39 | { 40 | #ifdef HAVE_KEYUTILS 41 | long r; 42 | size_t cached_passwords_length; 43 | void *cached_passwords = NULL; 44 | char *last_cached_password = NULL; 45 | key_serial_t serial; 46 | size_t i; 47 | 48 | serial = find_key_by_type_and_desc ("user", "cryptsetup", 0); 49 | if (serial == 0) 50 | return PAM_AUTHINFO_UNAVAIL; 51 | 52 | r = keyctl_read_alloc (serial, &cached_passwords); 53 | if (r < 0) 54 | return PAM_AUTHINFO_UNAVAIL; 55 | 56 | cached_passwords_length = r; 57 | 58 | /* 59 | Find the last password in the NUL-separated list of passwords. 60 | Multiple passwords are returned either when the user enters an 61 | incorrect password or there are multiple encrypted drives. 62 | In the case of an incorrect password the last one is correct. 63 | In the case of multiple drives, choosing the last drive is as 64 | arbitrary a choice as any other, but choosing the last password at 65 | least supports multiple attempts on the last drive. 66 | */ 67 | last_cached_password = cached_passwords; 68 | for (i = 0; i < cached_passwords_length; i++) { 69 | last_cached_password = ((char *) cached_passwords) + i; 70 | i += strlen (last_cached_password); 71 | } 72 | 73 | r = pam_set_item (pamh, PAM_AUTHTOK, last_cached_password); 74 | 75 | free (cached_passwords); 76 | 77 | if (r < 0) 78 | return PAM_AUTH_ERR; 79 | else 80 | return PAM_SUCCESS; 81 | #endif 82 | 83 | return PAM_AUTHINFO_UNAVAIL; 84 | } 85 | 86 | int 87 | pam_sm_setcred (pam_handle_t *pamh, 88 | int flags, 89 | int argc, 90 | const char **argv) 91 | { 92 | return PAM_SUCCESS; 93 | } 94 | 95 | int 96 | pam_sm_acct_mgmt (pam_handle_t *pamh, 97 | int flags, 98 | int argc, 99 | const char **argv) 100 | { 101 | return PAM_SUCCESS; 102 | } 103 | 104 | int 105 | pam_sm_chauthtok (pam_handle_t *pamh, 106 | int flags, 107 | int argc, 108 | const char **argv) 109 | { 110 | return PAM_SUCCESS; 111 | } 112 | 113 | int 114 | pam_sm_open_session (pam_handle_t *pamh, 115 | int flags, 116 | int argc, 117 | const char **argv) 118 | { 119 | return PAM_SUCCESS; 120 | } 121 | 122 | int 123 | pam_sm_close_session (pam_handle_t *pamh, 124 | int flags, 125 | int argc, 126 | const char **argv) 127 | { 128 | return PAM_SUCCESS; 129 | } 130 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # please keep this list sorted alphabetically 2 | # 3 | ab 4 | af 5 | am 6 | an 7 | ar 8 | as 9 | ast 10 | az 11 | be 12 | be@latin 13 | bg 14 | bn 15 | bn_IN 16 | br 17 | bs 18 | ca 19 | ca@valencia 20 | ckb 21 | crh 22 | cs 23 | csb 24 | cy 25 | da 26 | de 27 | dz 28 | el 29 | en_CA 30 | en_GB 31 | en@shaw 32 | eo 33 | es 34 | et 35 | eu 36 | fa 37 | fi 38 | fr 39 | fur 40 | fy 41 | ga 42 | gd 43 | gl 44 | gu 45 | gv 46 | he 47 | hi 48 | hr 49 | hu 50 | hy 51 | id 52 | is 53 | it 54 | ja 55 | ka 56 | kab 57 | kk 58 | km 59 | kn 60 | ko 61 | ku 62 | ky 63 | lt 64 | lv 65 | mai 66 | mg 67 | mi 68 | mjw 69 | mk 70 | ml 71 | mn 72 | mr 73 | ms 74 | nb 75 | nds 76 | ne 77 | nl 78 | nn 79 | nso 80 | oc 81 | or 82 | pa 83 | pl 84 | ps 85 | pt 86 | pt_BR 87 | ro 88 | ru 89 | rw 90 | si 91 | sk 92 | sl 93 | sq 94 | sr 95 | sr@latin 96 | sv 97 | sw 98 | ta 99 | te 100 | tg 101 | th 102 | tr 103 | ug 104 | uk 105 | uz 106 | uz@cyrillic 107 | vi 108 | wa 109 | xh 110 | zh_CN 111 | zh_HK 112 | zh_TW 113 | zu 114 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = GDM Contributors 22 | 23 | # This tells whether or not to prepend "GNU " prefix to the package 24 | # name that gets inserted into the header of the $(DOMAIN).pot file. 25 | # Possible values are "yes", "no", or empty. If it is empty, try to 26 | # detect it automatically by scanning the files in $(top_srcdir) for 27 | # "GNU packagename" string. 28 | PACKAGE_GNU = no 29 | 30 | # This is the email address or URL to which the translators shall report 31 | # bugs in the untranslated strings: 32 | # - Strings which are not entire sentences, see the maintainer guidelines 33 | # in the GNU gettext documentation, section 'Preparing Strings'. 34 | # - Strings which use unclear terms or require additional context to be 35 | # understood. 36 | # - Strings which make invalid assumptions about notation of date, time or 37 | # money. 38 | # - Pluralisation problems. 39 | # - Incorrect English spelling. 40 | # - Incorrect formatting. 41 | # It can be your email address, or a mailing list address where translators 42 | # can write to without being subscribed, or the URL of a web page through 43 | # which the translators can contact you. 44 | MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/gdm/issues 45 | 46 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 47 | # message catalogs shall be used. It is usually empty. 48 | EXTRA_LOCALE_CATEGORIES = 49 | 50 | # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 51 | # context. Possible values are "yes" and "no". Set this to yes if the 52 | # package uses functions taking also a message context, like pgettext(), or 53 | # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 54 | USE_MSGCTXT = yes 55 | 56 | # These options get passed to msgmerge. 57 | # Useful options are in particular: 58 | # --previous to keep previous msgids of translated messages, 59 | # --quiet to reduce the verbosity. 60 | MSGMERGE_OPTIONS = 61 | 62 | # These options get passed to msginit. 63 | # If you want to disable line wrapping when writing PO files, add 64 | # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and 65 | # MSGINIT_OPTIONS. 66 | MSGINIT_OPTIONS = 67 | 68 | # This tells whether or not to regenerate a PO file when $(DOMAIN).pot 69 | # has changed. Possible values are "yes" and "no". Set this to no if 70 | # the POT file is checked in the repository and the version control 71 | # program ignores timestamps. 72 | PO_DEPENDS_ON_POT = no 73 | 74 | # This tells whether or not to forcibly update $(DOMAIN).pot and 75 | # regenerate PO files on "make dist". Possible values are "yes" and 76 | # "no". Set this to no if the POT file and PO files are maintained 77 | # externally. 78 | DIST_DEPENDS_ON_UPDATE_PO = no 79 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # Files with translatable strings. 2 | # Please keep this file in alphabetical order. 3 | chooser/gdm-host-chooser-dialog.c 4 | chooser/gdm-host-chooser-widget.c 5 | common/gdm-common.c 6 | common/gdm-log.c 7 | common/gdm-settings-backend.c 8 | common/gdm-settings.c 9 | common/gdm-settings-desktop-backend.c 10 | common/gdm-settings-direct.c 11 | common/gdm-settings-utils.c 12 | common/test-log.c 13 | daemon/gdm-dbus-util.c 14 | daemon/gdm-display-access-file.c 15 | daemon/gdm-display.c 16 | daemon/gdm-display-factory.c 17 | daemon/gdm-display-store.c 18 | daemon/gdm-launch-environment.c 19 | daemon/gdm-legacy-display.c 20 | daemon/gdm-local-display.c 21 | daemon/gdm-local-display-factory.c 22 | daemon/gdm-manager.c 23 | daemon/gdm-server.c 24 | daemon/gdm-session-auditor.c 25 | daemon/gdm-session.c 26 | daemon/gdm-session-linux-auditor.c 27 | daemon/gdm-session-record.c 28 | daemon/gdm-session-settings.c 29 | daemon/gdm-session-solaris-auditor.c 30 | daemon/gdm-session-worker.c 31 | daemon/gdm-session-worker-common.c 32 | daemon/gdm-session-worker-job.c 33 | daemon/gdm-wayland-session.c 34 | daemon/gdm-xdmcp-chooser-display.c 35 | daemon/gdm-xdmcp-display.c 36 | daemon/gdm-xdmcp-display-factory.c 37 | daemon/gdm-x-session.c 38 | daemon/main.c 39 | daemon/session-worker-main.c 40 | daemon/test-session-client.c 41 | data/org.gnome.login-screen.gschema.xml 42 | libgdm/gdm-user-switching.c 43 | utils/gdm-config.c 44 | utils/gdmflexiserver.c 45 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | # Files with translatable strings to skip. 2 | # Please keep this file in alphabetical order. 3 | # 4 | # The following three desktop.in files are generated files, so 5 | # it is not necessary to check them for translatable strings. 6 | # Without these files, "make distcheck" fails. Please do not 7 | # remove these unless you fix "make distcheck" a different way. 8 | # 9 | data/gdm.schemas.in 10 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | preset: 'glib' 3 | ) 4 | -------------------------------------------------------------------------------- /tests/m-common.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "s-common-address.h" 27 | #include "s-common.h" 28 | 29 | static gboolean no_fork = FALSE; 30 | static gboolean verbose = FALSE; 31 | 32 | static GOptionEntry entries[] = { 33 | {"no-fork", 0, 0, G_OPTION_ARG_NONE, &no_fork, "Don't fork individual tests", NULL}, 34 | {"verbose", 0, 0, G_OPTION_ARG_NONE, &verbose, "Enable verbose output", NULL}, 35 | {NULL} 36 | }; 37 | 38 | int 39 | main (int argc, char **argv) 40 | { 41 | GOptionContext *context; 42 | SRunner *r; 43 | int failed; 44 | GError *error; 45 | 46 | context = g_option_context_new (""); 47 | g_option_context_add_main_entries (context, entries, NULL); 48 | error = NULL; 49 | g_option_context_parse (context, &argc, &argv, &error); 50 | g_option_context_free (context); 51 | 52 | if (error != NULL) { 53 | g_warning ("%s", error->message); 54 | g_error_free (error); 55 | exit (EXIT_FAILURE); 56 | } 57 | 58 | r = srunner_create (suite_common_address ()); 59 | 60 | if (no_fork) { 61 | srunner_set_fork_status (r, CK_NOFORK); 62 | } 63 | 64 | srunner_run_all (r, verbose ? CK_VERBOSE : CK_NORMAL); 65 | failed = srunner_ntests_failed (r); 66 | srunner_free (r); 67 | 68 | r = srunner_create (suite_common ()); 69 | 70 | if (no_fork) { 71 | srunner_set_fork_status (r, CK_NOFORK); 72 | } 73 | 74 | srunner_run_all (r, verbose ? CK_VERBOSE : CK_NORMAL); 75 | failed |= srunner_ntests_failed (r); 76 | srunner_free (r); 77 | 78 | return failed != 0; 79 | } 80 | -------------------------------------------------------------------------------- /tests/meson.build: -------------------------------------------------------------------------------- 1 | m_common_test_src = [ 2 | 'm-common.c', 3 | 's-common-address.c', 4 | 's-common.c', 5 | ] 6 | 7 | m_common_test_deps = [ 8 | libgdmcommon_dep, 9 | libcheck_dep, 10 | ] 11 | 12 | m_common_test = executable('m-common', 13 | m_common_test_src, 14 | dependencies: m_common_test_deps, 15 | ) 16 | 17 | test('m-common', m_common_test) 18 | -------------------------------------------------------------------------------- /tests/s-common-address.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __S_COMMON_ADDRESS_H 22 | #define __S_COMMON_ADDRESS_H 23 | 24 | #include 25 | 26 | Suite *suite_common_address (void); 27 | 28 | #endif /* __S_COMMON_ADDRESS_H */ 29 | -------------------------------------------------------------------------------- /tests/s-common.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 Andrew Ziem 4 | * Copyright (C) 2007 William Jon McCann 5 | * Copyright (C) 2015 Alexander Larsson 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include "gdm-common.h" 30 | #include "s-common.h" 31 | 32 | static void 33 | setup (void) 34 | { 35 | } 36 | 37 | static void 38 | teardown (void) 39 | { 40 | } 41 | 42 | static char * 43 | expand_fn (const char *var, gpointer data) 44 | { 45 | if (strcmp (var, "FOO") == 0) 46 | return g_strdup ("BAR"); 47 | if (strcmp (var, "FOO9") == 0) 48 | return g_strdup ("XXX"); 49 | if (strcmp (var, "_FOO") == 0) 50 | return g_strdup ("YYY"); 51 | if (strcmp (var, "FOO_FOO") == 0) 52 | return g_strdup ("ZZZ"); 53 | return NULL; 54 | } 55 | 56 | static gboolean expands_to (const char *to_expand, const char *expanded) 57 | { 58 | return strcmp (gdm_shell_expand (to_expand, expand_fn, NULL), expanded) == 0; 59 | } 60 | 61 | START_TEST (test_gdm_shell_expand) 62 | { 63 | ck_assert (expands_to ("foo", "foo")); 64 | ck_assert (expands_to ("foo ", "foo ")); 65 | ck_assert (expands_to ("foo#bar", "foo#bar")); 66 | ck_assert (expands_to ("foo #bar", "foo ")); 67 | ck_assert (expands_to ("#bar", "")); 68 | ck_assert (expands_to ("foo #bar gazonk", "foo ")); 69 | ck_assert (expands_to ("foo #bar gazonk", "foo ")); 70 | ck_assert (expands_to ("foo #bar gazonk", "foo ")); 71 | ck_assert (expands_to ("$FOO", "BAR")); 72 | ck_assert (expands_to ("$9FOO", "$9FOO")); 73 | ck_assert (expands_to ("$FOO9", "XXX")); 74 | ck_assert (expands_to ("${FOO}9", "BAR9")); 75 | ck_assert (expands_to ("$_FOO", "YYY")); 76 | ck_assert (expands_to ("$FOO_FOO", "ZZZ")); 77 | ck_assert (expands_to ("${FOO}", "BAR")); 78 | ck_assert (expands_to ("$FOO$FOO", "BARBAR")); 79 | ck_assert (expands_to ("${FOO}${FOO}", "BARBAR")); 80 | ck_assert (expands_to ("$FOO${FOO}", "BARBAR")); 81 | ck_assert (expands_to ("$foo", "")); 82 | ck_assert (expands_to ("$FOOBAR", "")); 83 | ck_assert (expands_to ("$FOO/BAR", "BAR/BAR")); 84 | ck_assert (expands_to ("${FOO}BAR", "BARBAR")); 85 | ck_assert (expands_to ("$/BAR", "$/BAR")); 86 | ck_assert (expands_to ("${FOO BAR}BAR", "${FOO BAR}BAR")); 87 | ck_assert (expands_to ("${}BAR", "${}BAR")); 88 | ck_assert (expands_to ("${$FOO}BAR", "${BAR}BAR")); 89 | ck_assert (expands_to ("\\$foo", "$foo")); 90 | ck_assert (expands_to ("a\\\\b", "a\\b")); 91 | ck_assert (expands_to ("a\\b", "a\\b")); 92 | ck_assert (expands_to ("a\\#b", "a#b")); 93 | } 94 | END_TEST 95 | 96 | Suite * 97 | suite_common (void) 98 | { 99 | Suite *s; 100 | TCase *tc_core; 101 | 102 | s = suite_create ("gdm-common"); 103 | tc_core = tcase_create ("core"); 104 | 105 | tcase_add_checked_fixture (tc_core, setup, teardown); 106 | tcase_add_test (tc_core, test_gdm_shell_expand); 107 | suite_add_tcase (s, tc_core); 108 | 109 | return s; 110 | } 111 | -------------------------------------------------------------------------------- /tests/s-common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2015 Alexander Larsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __S_COMMON_H 22 | #define __S_COMMON_H 23 | 24 | #include 25 | 26 | Suite *suite_common (void); 27 | 28 | #endif /* __S_COMMON_H */ 29 | -------------------------------------------------------------------------------- /utils/gdm-auth-config-generic: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (C) 2020 Marco Trevisan 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | # 02110-1301, USA. 19 | 20 | command=$1 21 | action=$2 22 | action_setting=$3 23 | 24 | set -e 25 | export LANG=C 26 | 27 | ENABLED="enabled" 28 | DISABLED="disabled" 29 | REQUIRED="required" 30 | STOP=19 31 | 32 | 33 | case "$command" in 34 | show) 35 | case "$action" in 36 | password) 37 | ;; 38 | smartcard) 39 | ;; 40 | fingerprint) 41 | ;; 42 | esac 43 | 44 | exit 0; 45 | ;; 46 | 47 | smartcard) 48 | case "$action" in 49 | enable) 50 | ;; 51 | require) 52 | # While we can't require anything here, we assume that GDM 53 | # will disable the password authentication in this case. 54 | ;; 55 | disable) 56 | ;; 57 | removal-action) 58 | ;; 59 | esac 60 | 61 | # We assume the default handler can manage this, as gdm already 62 | # provides a PAM config file for this case 63 | exit 0 64 | ;; 65 | 66 | fingerprint) 67 | case "$action" in 68 | enable) 69 | ;; 70 | require) 71 | exit 1 72 | ;; 73 | disable) 74 | ;; 75 | esac 76 | 77 | # We assume the default handler can manage this, as gdm already 78 | # provides a PAM config file for this case 79 | exit 0 80 | ;; 81 | 82 | password) 83 | # We assume the default handler can manage this, as gdm already 84 | # provides a PAM config file for this case 85 | exit 0 86 | ;; 87 | 88 | reset) 89 | exit 0 90 | ;; 91 | 92 | *) 93 | # Use default behavior 94 | exit 0; 95 | ;; 96 | esac 97 | 98 | exit 1 99 | -------------------------------------------------------------------------------- /utils/gdm-runtime-config.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #include "config.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | int 30 | main (int argc, char *argv[]) 31 | { 32 | g_autoptr(GKeyFile) key_file = NULL; 33 | g_autoptr(GError) error = NULL; 34 | gchar *group, *key, *value; 35 | gboolean saved_okay; 36 | 37 | if (argc < 5 || g_strcmp0(argv[1], "set") != 0) { 38 | g_printerr("gdm-runtime-config: command format should be " \ 39 | "'gdm-runtime-config set '\n" \ 40 | "For example, 'gdm-runtime-config set daemon WaylandEnable true'\n"); 41 | return EX_USAGE; 42 | } 43 | 44 | group = argv[2]; 45 | key = argv[3]; 46 | value = argv[4]; 47 | 48 | setlocale (LC_ALL, ""); 49 | 50 | key_file = g_key_file_new (); 51 | 52 | /* Just load the runtime conf file and ignore the error. A new file 53 | * will be created later if it is file not found. 54 | * So that more than one config item can be set. 55 | */ 56 | g_key_file_load_from_file (key_file, 57 | GDM_RUNTIME_CONF, 58 | G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, 59 | &error); 60 | g_clear_error (&error); 61 | 62 | g_key_file_set_value (key_file, group, key, value); 63 | 64 | g_mkdir_with_parents (GDM_RUN_DIR, 0711); 65 | 66 | saved_okay = g_key_file_save_to_file (key_file, GDM_RUNTIME_CONF, &error); 67 | 68 | if (!saved_okay) { 69 | g_printerr ("gdm-runtime-config: unable to set '%s' in '%s' group to '%s': %s\n", 70 | key, group, value, error->message); 71 | return EX_CANTCREAT; 72 | } 73 | 74 | return EX_OK; 75 | } 76 | -------------------------------------------------------------------------------- /utils/meson.build: -------------------------------------------------------------------------------- 1 | # gdm-flexiserver 2 | gdm_flexiserver_deps = [ 3 | glib_dep, 4 | libgdmcommon_dep, 5 | ] 6 | 7 | gdm_flexiserver = executable('gdmflexiserver', 8 | 'gdmflexiserver.c', 9 | dependencies: gdm_flexiserver_deps, 10 | include_directories: config_h_dir, 11 | install: true, 12 | ) 13 | 14 | # gdm-runtime-config 15 | gdm_runtime_config_deps = [ 16 | glib_dep, 17 | ] 18 | 19 | gdm_runtime_config = executable('gdm-runtime-config', 20 | 'gdm-runtime-config.c', 21 | dependencies: gdm_runtime_config_deps, 22 | include_directories: config_h_dir, 23 | install: true, 24 | install_dir: get_option('libexecdir'), 25 | ) 26 | 27 | gdm_auth_config = executable('gdm-config', 28 | 'gdm-config.c', 29 | dependencies: [ 30 | glib_dep, 31 | gio_dep, 32 | libgdmcommon_dep, 33 | ], 34 | include_directories: config_h_dir, 35 | install: true, 36 | ) 37 | 38 | auth_config_distro_hooks = [ 39 | 'redhat', 40 | 'generic', 41 | ] 42 | 43 | if distro != 'none' 44 | if distro not in auth_config_distro_hooks and pam_data_files_map.has_key(distro) 45 | distro = 'generic' 46 | endif 47 | 48 | gdm_distro_hook = install_data('gdm-auth-config-@0@'.format(distro), 49 | install_mode: 'rwxr-xr-x', 50 | install_dir: get_option('libexecdir'), 51 | ) 52 | endif 53 | --------------------------------------------------------------------------------