summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/examples/netdomjoin-gui
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-04-15 14:36:13 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-04-15 14:36:13 +1000
commit4678d1c6f4de1af9144de37d6d4b35c6c39e254d (patch)
tree94e58cf112ef34412bc5521f4bc9f56424ee967f /source3/lib/netapi/examples/netdomjoin-gui
parent86b50a0e6eacc14e157602811f30f11dccc471a8 (diff)
parent92d321006d1748ac47cf9b52330212f4ae03f502 (diff)
downloadsamba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.tar.gz
samba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.tar.bz2
samba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into libcli-auth-merge-without-netlogond
Diffstat (limited to 'source3/lib/netapi/examples/netdomjoin-gui')
-rw-r--r--source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
index 40a6e415eb..8164b7456b 100644
--- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
+++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
@@ -78,6 +78,7 @@ typedef struct join_state {
gboolean hostname_changed;
uint32_t stored_num_ous;
char *target_hostname;
+ uid_t uid;
} join_state;
static void debug(const char *format, ...)
@@ -1440,6 +1441,10 @@ static int draw_main_window(struct join_state *state)
/* Entry */
entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(entry), 256);
+
+ if (state->uid != 0) {
+ gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
+ }
g_signal_connect(G_OBJECT(entry), "changed",
G_CALLBACK(callback_enter_computer_description_and_unlock),
state);
@@ -1526,6 +1531,9 @@ static int draw_main_window(struct join_state *state)
G_CALLBACK(callback_do_change),
(gpointer)state);
gtk_box_pack_start(GTK_BOX(bbox), button, TRUE, TRUE, 0);
+ if (state->uid != 0) {
+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+ }
gtk_widget_show(button);
/* Label (hidden) */
@@ -1533,6 +1541,11 @@ static int draw_main_window(struct join_state *state)
gtk_label_set_line_wrap(GTK_LABEL(state->label_reboot), TRUE);
gtk_misc_set_alignment(GTK_MISC(state->label_reboot), 0, 0);
gtk_box_pack_start(GTK_BOX(vbox), state->label_reboot, TRUE, TRUE, 0);
+ if (state->uid != 0) {
+ gtk_label_set_text(GTK_LABEL(state->label_reboot),
+ "You cannot change computer description as you're not running with root permissions");
+ }
+
gtk_widget_show(state->label_reboot);
#if 0
@@ -1763,6 +1776,8 @@ static int initialize_join_state(struct join_state *state,
return -1;
}
+ state->uid = geteuid();
+
state->ctx = ctx;
return 0;