1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-14 03:10:47 +00:00
freebsd-ports/x11/gnome-session/files/patch-gnome-session_logout.c
Joe Marcus Clarke e7ed58ff63 Allow users other than root to shutdown and restart the computer from logout.
Now, any user in the operator group (users that can normally run
/sbin/shutdown) will be able to shutdown the computer during logout.
2004-05-09 20:02:38 +00:00

37 lines
883 B
C

--- gnome-session/logout.c.orig Sun May 9 15:45:34 2004
+++ gnome-session/logout.c Sun May 9 15:48:29 2004
@@ -37,12 +37,20 @@
static gchar *halt_command[] =
{
+#ifdef __FreeBSD__
+ HALT_COMMAND, "-p", "now", NULL
+#else
HALT_COMMAND, NULL
+#endif
};
static gchar *reboot_command[] =
{
+#ifdef __FreeBSD__
+ REBOOT_COMMAND, "-r", "now", NULL
+#else
REBOOT_COMMAND, NULL
+#endif
};
/* What action to take upon shutdown */
@@ -401,8 +409,12 @@
*/
s = g_strconcat ("/var/lock/console/", g_get_user_name (), NULL);
t = g_strconcat ("/var/run/console/", g_get_user_name (), NULL);
+#ifndef __FreeBSD__
if (((geteuid () == 0) || g_file_exists (t) || g_file_exists(s)) &&
access (halt_command[0], X_OK) == 0)
+#else
+ if (access (halt_command[0], X_OK) == 0)
+#endif
{
GtkWidget *title, *spacer;
GtkWidget *action_vbox, *hbox;