115
113
</programlisting>
118
115
</para></refsect2>
119
116
<refsect2 id="gksu-context-new" role="function">
120
117
<title>gksu_context_new ()</title>
121
<indexterm zone="gksu-context-new"><primary>gksu_context_new</primary></indexterm><programlisting><link linkend="GksuContext">GksuContext</link>* gksu_context_new (void);</programlisting>
118
<indexterm zone="gksu-context-new"><primary sortas="gksu_context_new">gksu_context_new</primary></indexterm><programlisting><link linkend="GksuContext">GksuContext</link>* gksu_context_new (void);</programlisting>
123
120
This function should be used when creating a new <link linkend="GksuContext"><type>GksuContext</type></link> to
124
121
pass to gksu_su_full or gksu_sudo_full. The <link linkend="GksuContext"><type>GksuContext</type></link> must be
125
122
freed with gksu_context_free.</para>
128
124
</para><variablelist role="params">
129
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated <link linkend="GksuContext"><type>GksuContext</type></link>
125
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated <link linkend="GksuContext"><type>GksuContext</type></link>
130
126
</simpara></listitem></varlistentry>
131
127
</variablelist></refsect2>
132
128
<refsect2 id="gksu-context-set-user" role="function">
133
129
<title>gksu_context_set_user ()</title>
134
<indexterm zone="gksu-context-set-user"><primary>gksu_context_set_user</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_user (<link linkend="GksuContext">GksuContext</link> *context,
130
<indexterm zone="gksu-context-set-user"><primary sortas="gksu_context_set_user">gksu_context_set_user</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_user (<link linkend="GksuContext">GksuContext</link> *context,
135
131
<link linkend="gchar">gchar</link> *username);</programlisting>
137
133
Sets up what user the command will be run as. The default
138
134
is root, but you can run the command as any user.</para>
141
136
</para><variablelist role="params">
142
<varlistentry><term><parameter>context</parameter> :</term>
137
<varlistentry><term><parameter>context</parameter> :</term>
143
138
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
144
139
</simpara></listitem></varlistentry>
145
<varlistentry><term><parameter>username</parameter> :</term>
140
<varlistentry><term><parameter>username</parameter> :</term>
146
141
<listitem><simpara> the target username
147
142
</simpara></listitem></varlistentry>
148
143
</variablelist></refsect2>
149
144
<refsect2 id="gksu-context-get-user" role="function">
150
145
<title>gksu_context_get_user ()</title>
151
<indexterm zone="gksu-context-get-user"><primary>gksu_context_get_user</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>* gksu_context_get_user (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
146
<indexterm zone="gksu-context-get-user"><primary sortas="gksu_context_get_user">gksu_context_get_user</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> * gksu_context_get_user (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
153
148
Gets the user the command will be run as, as set
154
149
by gksu_context_set_user.</para>
157
151
</para><variablelist role="params">
158
<varlistentry><term><parameter>context</parameter> :</term>
152
<varlistentry><term><parameter>context</parameter> :</term>
159
153
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> from which to grab the information
160
154
</simpara></listitem></varlistentry>
161
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the user or NULL if not set.
155
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the user or NULL if not set.
162
156
</simpara></listitem></varlistentry>
163
157
</variablelist></refsect2>
164
158
<refsect2 id="gksu-context-set-command" role="function">
165
159
<title>gksu_context_set_command ()</title>
166
<indexterm zone="gksu-context-set-command"><primary>gksu_context_set_command</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_command (<link linkend="GksuContext">GksuContext</link> *context,
160
<indexterm zone="gksu-context-set-command"><primary sortas="gksu_context_set_command">gksu_context_set_command</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_command (<link linkend="GksuContext">GksuContext</link> *context,
167
161
<link linkend="gchar">gchar</link> *command);</programlisting>
169
163
Sets up what command will run with the target user.</para>
172
165
</para><variablelist role="params">
173
<varlistentry><term><parameter>context</parameter> :</term>
166
<varlistentry><term><parameter>context</parameter> :</term>
174
167
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
175
168
</simpara></listitem></varlistentry>
176
<varlistentry><term><parameter>command</parameter> :</term>
169
<varlistentry><term><parameter>command</parameter> :</term>
177
170
<listitem><simpara> the command that shall be ran
178
171
</simpara></listitem></varlistentry>
179
172
</variablelist></refsect2>
180
173
<refsect2 id="gksu-context-get-command" role="function">
181
174
<title>gksu_context_get_command ()</title>
182
<indexterm zone="gksu-context-get-command"><primary>gksu_context_get_command</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>* gksu_context_get_command (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
175
<indexterm zone="gksu-context-get-command"><primary sortas="gksu_context_get_command">gksu_context_get_command</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> * gksu_context_get_command (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
184
177
Gets the command that will be run, as set by
185
178
gksu_context_set_command.</para>
188
180
</para><variablelist role="params">
189
<varlistentry><term><parameter>context</parameter> :</term>
181
<varlistentry><term><parameter>context</parameter> :</term>
190
182
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> from which to grab the information
191
183
</simpara></listitem></varlistentry>
192
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the command or NULL if not set.
184
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the command or NULL if not set.
193
185
</simpara></listitem></varlistentry>
194
186
</variablelist></refsect2>
195
187
<refsect2 id="gksu-context-set-keep-env" role="function">
196
188
<title>gksu_context_set_keep_env ()</title>
197
<indexterm zone="gksu-context-set-keep-env"><primary>gksu_context_set_keep_env</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_keep_env (<link linkend="GksuContext">GksuContext</link> *context,
189
<indexterm zone="gksu-context-set-keep-env"><primary sortas="gksu_context_set_keep_env">gksu_context_set_keep_env</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_keep_env (<link linkend="GksuContext">GksuContext</link> *context,
198
190
<link linkend="gboolean">gboolean</link> value);</programlisting>
200
192
Should the environment be kept as it is? Defaults to
201
193
TRUE. Notice that setting this to FALSE may cause the
202
194
X authorization stuff to fail.</para>
205
196
</para><variablelist role="params">
206
<varlistentry><term><parameter>context</parameter> :</term>
197
<varlistentry><term><parameter>context</parameter> :</term>
207
198
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
208
199
</simpara></listitem></varlistentry>
209
<varlistentry><term><parameter>value</parameter> :</term>
200
<varlistentry><term><parameter>value</parameter> :</term>
210
201
<listitem><simpara> TRUE or FALSE
211
202
</simpara></listitem></varlistentry>
212
203
</variablelist></refsect2>
213
204
<refsect2 id="gksu-context-get-keep-env" role="function">
214
205
<title>gksu_context_get_keep_env ()</title>
215
<indexterm zone="gksu-context-get-keep-env"><primary>gksu_context_get_keep_env</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_keep_env (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
206
<indexterm zone="gksu-context-get-keep-env"><primary sortas="gksu_context_get_keep_env">gksu_context_get_keep_env</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_keep_env (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
217
208
Finds out if the environment in which the program will be
218
209
run will be reset.</para>
221
211
</para><variablelist role="params">
222
<varlistentry><term><parameter>context</parameter> :</term>
212
<varlistentry><term><parameter>context</parameter> :</term>
223
213
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> from which to grab the information
224
214
</simpara></listitem></varlistentry>
225
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the environment is going to be kept,
215
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the environment is going to be kept,
227
217
</simpara></listitem></varlistentry>
228
218
</variablelist></refsect2>
229
219
<refsect2 id="gksu-context-get-description" role="function">
230
220
<title>gksu_context_get_description ()</title>
231
<indexterm zone="gksu-context-get-description"><primary>gksu_context_get_description</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* gksu_context_get_description (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
221
<indexterm zone="gksu-context-get-description"><primary sortas="gksu_context_get_description">gksu_context_get_description</primary></indexterm><programlisting><link linkend="gchar">gchar</link> * gksu_context_get_description (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
233
223
Get the description that the window will have when the
234
224
default function for requesting the password is
238
227
</para><variablelist role="params">
239
<varlistentry><term><parameter>context</parameter> :</term>
228
<varlistentry><term><parameter>context</parameter> :</term>
240
229
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to get the description from.
241
230
</simpara></listitem></varlistentry>
242
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the description or NULL if not set.
231
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the description or NULL if not set.
243
232
</simpara></listitem></varlistentry>
244
233
</variablelist></refsect2>
245
234
<refsect2 id="gksu-context-set-description" role="function">
246
235
<title>gksu_context_set_description ()</title>
247
<indexterm zone="gksu-context-set-description"><primary>gksu_context_set_description</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_description (<link linkend="GksuContext">GksuContext</link> *context,
236
<indexterm zone="gksu-context-set-description"><primary sortas="gksu_context_set_description">gksu_context_set_description</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_description (<link linkend="GksuContext">GksuContext</link> *context,
248
237
<link linkend="gchar">gchar</link> *description);</programlisting>
250
239
Set the nice name for the action that is being run that the window
251
240
that asks for the password will have. This is only meant to be
252
241
used if the default window is used, of course.</para>
255
243
</para><variablelist role="params">
256
<varlistentry><term><parameter>context</parameter> :</term>
244
<varlistentry><term><parameter>context</parameter> :</term>
257
245
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
258
246
</simpara></listitem></varlistentry>
259
<varlistentry><term><parameter>description</parameter> :</term>
247
<varlistentry><term><parameter>description</parameter> :</term>
260
248
<listitem><simpara> a string to set the description for
261
249
</simpara></listitem></varlistentry>
262
250
</variablelist></refsect2>
263
251
<refsect2 id="gksu-context-set-message" role="function">
264
252
<title>gksu_context_set_message ()</title>
265
<indexterm zone="gksu-context-set-message"><primary>gksu_context_set_message</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_message (<link linkend="GksuContext">GksuContext</link> *context,
253
<indexterm zone="gksu-context-set-message"><primary sortas="gksu_context_set_message">gksu_context_set_message</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_message (<link linkend="GksuContext">GksuContext</link> *context,
266
254
<link linkend="gchar">gchar</link> *message);</programlisting>
268
256
Set the message that the window that asks for the password will have.
269
257
This is only meant to be used if the default window is used, of course.</para>
272
259
</para><variablelist role="params">
273
<varlistentry><term><parameter>context</parameter> :</term>
260
<varlistentry><term><parameter>context</parameter> :</term>
274
261
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
275
262
</simpara></listitem></varlistentry>
276
<varlistentry><term><parameter>message</parameter> :</term>
263
<varlistentry><term><parameter>message</parameter> :</term>
277
264
<listitem><simpara> a string to set the message for
278
265
</simpara></listitem></varlistentry>
279
266
</variablelist></refsect2>
280
267
<refsect2 id="gksu-context-get-message" role="function">
281
268
<title>gksu_context_get_message ()</title>
282
<indexterm zone="gksu-context-get-message"><primary>gksu_context_get_message</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* gksu_context_get_message (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
269
<indexterm zone="gksu-context-get-message"><primary sortas="gksu_context_get_message">gksu_context_get_message</primary></indexterm><programlisting><link linkend="gchar">gchar</link> * gksu_context_get_message (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
284
271
Get the message that the window will have when the
285
272
default function for requesting the password is
289
275
</para><variablelist role="params">
290
<varlistentry><term><parameter>context</parameter> :</term>
276
<varlistentry><term><parameter>context</parameter> :</term>
291
277
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to get the message from.
292
278
</simpara></listitem></varlistentry>
293
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the message or NULL if not set.
279
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a string with the message or NULL if not set.
294
280
</simpara></listitem></varlistentry>
295
281
</variablelist></refsect2>
296
282
<refsect2 id="gksu-context-set-login-shell" role="function">
297
283
<title>gksu_context_set_login_shell ()</title>
298
<indexterm zone="gksu-context-set-login-shell"><primary>gksu_context_set_login_shell</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_login_shell (<link linkend="GksuContext">GksuContext</link> *context,
284
<indexterm zone="gksu-context-set-login-shell"><primary sortas="gksu_context_set_login_shell">gksu_context_set_login_shell</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_login_shell (<link linkend="GksuContext">GksuContext</link> *context,
299
285
<link linkend="gboolean">gboolean</link> value);</programlisting>
301
287
Should the shell in which the command will be run be
302
288
a login shell?</para>
305
290
</para><variablelist role="params">
306
<varlistentry><term><parameter>context</parameter> :</term>
291
<varlistentry><term><parameter>context</parameter> :</term>
307
292
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
308
293
</simpara></listitem></varlistentry>
309
<varlistentry><term><parameter>value</parameter> :</term>
294
<varlistentry><term><parameter>value</parameter> :</term>
310
295
<listitem><simpara> TRUE or FALSE
311
296
</simpara></listitem></varlistentry>
312
297
</variablelist></refsect2>
313
298
<refsect2 id="gksu-context-get-login-shell" role="function">
314
299
<title>gksu_context_get_login_shell ()</title>
315
<indexterm zone="gksu-context-get-login-shell"><primary>gksu_context_get_login_shell</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_login_shell (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
300
<indexterm zone="gksu-context-get-login-shell"><primary sortas="gksu_context_get_login_shell">gksu_context_get_login_shell</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_login_shell (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
317
302
Finds out if the shell created by the underlying su process
318
303
will be a login shell.</para>
321
305
</para><variablelist role="params">
322
<varlistentry><term><parameter>context</parameter> :</term>
306
<varlistentry><term><parameter>context</parameter> :</term>
323
307
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> from which to grab the information
324
308
</simpara></listitem></varlistentry>
325
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the shell will be a login shell, FALSE otherwise.
309
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the shell will be a login shell, FALSE otherwise.
326
310
</simpara></listitem></varlistentry>
327
311
</variablelist></refsect2>
328
312
<refsect2 id="gksu-context-set-grab" role="function">
329
313
<title>gksu_context_set_grab ()</title>
330
<indexterm zone="gksu-context-set-grab"><primary>gksu_context_set_grab</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_grab (<link linkend="GksuContext">GksuContext</link> *context,
314
<indexterm zone="gksu-context-set-grab"><primary sortas="gksu_context_set_grab">gksu_context_set_grab</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_grab (<link linkend="GksuContext">GksuContext</link> *context,
331
315
<link linkend="gboolean">gboolean</link> value);</programlisting>
334
317
</para><variablelist role="params">
335
<varlistentry><term><parameter>context</parameter> :</term>
318
<varlistentry><term><parameter>context</parameter> :</term>
336
319
<listitem><simpara>
337
320
</simpara></listitem></varlistentry>
338
<varlistentry><term><parameter>value</parameter> :</term>
321
<varlistentry><term><parameter>value</parameter> :</term>
339
322
<listitem><simpara>
342
323
</simpara></listitem></varlistentry>
343
324
</variablelist></refsect2>
344
325
<refsect2 id="gksu-context-get-grab" role="function">
345
326
<title>gksu_context_get_grab ()</title>
346
<indexterm zone="gksu-context-get-grab"><primary>gksu_context_get_grab</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_grab (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
327
<indexterm zone="gksu-context-get-grab"><primary sortas="gksu_context_get_grab">gksu_context_get_grab</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_grab (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
348
329
Returns TRUE if gksu has been asked to do a grab on keyboard and mouse
349
330
when asking for the password.</para>
352
332
</para><variablelist role="params">
353
<varlistentry><term><parameter>context</parameter> :</term>
333
<varlistentry><term><parameter>context</parameter> :</term>
354
334
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to ask whether a grab will be done.
355
335
</simpara></listitem></varlistentry>
356
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if yes, FALSE otherwise.
336
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if yes, FALSE otherwise.
357
337
</simpara></listitem></varlistentry>
358
338
</variablelist></refsect2>
359
339
<refsect2 id="gksu-context-set-debug" role="function">
360
340
<title>gksu_context_set_debug ()</title>
361
<indexterm zone="gksu-context-set-debug"><primary>gksu_context_set_debug</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_debug (<link linkend="GksuContext">GksuContext</link> *context,
341
<indexterm zone="gksu-context-set-debug"><primary sortas="gksu_context_set_debug">gksu_context_set_debug</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_set_debug (<link linkend="GksuContext">GksuContext</link> *context,
362
342
<link linkend="gboolean">gboolean</link> value);</programlisting>
364
344
Set up if debuging information should be printed.</para>
367
346
</para><variablelist role="params">
368
<varlistentry><term><parameter>context</parameter> :</term>
347
<varlistentry><term><parameter>context</parameter> :</term>
369
348
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> you want to modify
370
349
</simpara></listitem></varlistentry>
371
<varlistentry><term><parameter>value</parameter> :</term>
350
<varlistentry><term><parameter>value</parameter> :</term>
372
351
<listitem><simpara> TRUE or FALSE
373
352
</simpara></listitem></varlistentry>
374
353
</variablelist></refsect2>
375
354
<refsect2 id="gksu-context-get-debug" role="function">
376
355
<title>gksu_context_get_debug ()</title>
377
<indexterm zone="gksu-context-get-debug"><primary>gksu_context_get_debug</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_debug (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
356
<indexterm zone="gksu-context-get-debug"><primary sortas="gksu_context_get_debug">gksu_context_get_debug</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_context_get_debug (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
379
358
Finds out if the library is configured to print debuging
380
359
information.</para>
383
361
</para><variablelist role="params">
384
<varlistentry><term><parameter>context</parameter> :</term>
362
<varlistentry><term><parameter>context</parameter> :</term>
385
363
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> from which to grab the information
386
364
</simpara></listitem></varlistentry>
387
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if it is, FALSE otherwise.
365
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if it is, FALSE otherwise.
388
366
</simpara></listitem></varlistentry>
389
367
</variablelist></refsect2>
390
368
<refsect2 id="gksu-context-free" role="function">
391
369
<title>gksu_context_free ()</title>
392
<indexterm zone="gksu-context-free"><primary>gksu_context_free</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_free (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
370
<indexterm zone="gksu-context-free"><primary sortas="gksu_context_free">gksu_context_free</primary></indexterm><programlisting><link linkend="void">void</link> gksu_context_free (<link linkend="GksuContext">GksuContext</link> *context);</programlisting>
394
372
Frees the given <link linkend="GksuContext"><type>GksuContext</type></link>.</para>
397
374
</para><variablelist role="params">
398
<varlistentry><term><parameter>context</parameter> :</term>
375
<varlistentry><term><parameter>context</parameter> :</term>
399
376
<listitem><simpara> the <link linkend="GksuContext"><type>GksuContext</type></link> to be freed.
400
377
</simpara></listitem></varlistentry>
401
378
</variablelist></refsect2>
402
379
<refsect2 id="gksu-run" role="function">
403
380
<title>gksu_run ()</title>
404
<indexterm zone="gksu-run"><primary>gksu_run</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_run (<link linkend="gchar">gchar</link> *command_line,
381
<indexterm zone="gksu-run"><primary sortas="gksu_run">gksu_run</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_run (<link linkend="gchar">gchar</link> *command_line,
405
382
<link linkend="GError">GError</link> **error);</programlisting>
407
384
This function is a wrapper for gksu_sudo/gksu_su. It will call one
409
386
behavior for gksu is su or sudo mode. This is the recommended way of
410
387
using the library functionality.</para>
413
389
</para><variablelist role="params">
414
<varlistentry><term><parameter>command_line</parameter> :</term>
390
<varlistentry><term><parameter>command_line</parameter> :</term>
415
391
<listitem><simpara> the command line that will be executed as other user
416
392
</simpara></listitem></varlistentry>
417
<varlistentry><term><parameter>error</parameter> :</term>
393
<varlistentry><term><parameter>error</parameter> :</term>
418
394
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> to be set with the error condition, if an error
420
396
</simpara></listitem></varlistentry>
421
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> FALSE if all went well, TRUE if an error happend.
397
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> FALSE if all went well, TRUE if an error happend.
422
398
</simpara></listitem></varlistentry>
423
399
</variablelist></refsect2>
424
400
<refsect2 id="gksu-run-full" role="function">
425
401
<title>gksu_run_full ()</title>
426
<indexterm zone="gksu-run-full"><primary>gksu_run_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_run_full (<link linkend="GksuContext">GksuContext</link> *context,
402
<indexterm zone="gksu-run-full"><primary sortas="gksu_run_full">gksu_run_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_run_full (<link linkend="GksuContext">GksuContext</link> *context,
427
403
<link linkend="GksuAskPassFunc">GksuAskPassFunc</link> ask_pass,
428
404
<link linkend="gpointer">gpointer</link> ask_pass_data,
429
405
<link linkend="GksuPassNotNeededFunc">GksuPassNotNeededFunc</link> pass_not_needed,
430
406
<link linkend="gpointer">gpointer</link> pass_not_needed_data,
431
407
<link linkend="GError">GError</link> **error);</programlisting>
433
This function is a wrapper for gksu_sudo_full/gksu_su_full. It will
434
call one of them, depending on the GConf key that defines whether
435
the default behavior for gksu is su or sudo mode. This is the
436
recommended way of using the library functionality.</para>
409
This is a compatibility shim over gksu_run_fuller, which, for
410
compatibility reasons, lacks the 'exit_status' argument.</para>
439
412
</para><variablelist role="params">
440
<varlistentry><term><parameter>context</parameter> :</term>
413
<varlistentry><term><parameter>context</parameter> :</term>
441
414
<listitem><simpara> a <link linkend="GksuContext"><type>GksuContext</type></link>
442
415
</simpara></listitem></varlistentry>
443
<varlistentry><term><parameter>ask_pass</parameter> :</term>
416
<varlistentry><term><parameter>ask_pass</parameter> :</term>
444
417
<listitem><simpara> a <link linkend="GksuAskPassFunc"><type>GksuAskPassFunc</type></link> to be called when the lib determines
445
418
requesting a password is necessary; it may be NULL, in which case
446
419
the standard password request dialog will be used
447
420
</simpara></listitem></varlistentry>
448
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
421
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
449
422
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with user data to be passed to the
450
423
<link linkend="GksuAskPasswordFunc"><type>GksuAskPasswordFunc</type></link>
451
424
</simpara></listitem></varlistentry>
452
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
425
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
453
426
<listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called
454
427
when the command is being run without the need for requesting
455
428
a password; it will only be called if the display-no-pass-info
456
429
gconf key is enabled; NULL will have the standard dialog be shown
457
430
</simpara></listitem></varlistentry>
458
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
431
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
459
432
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the
460
433
<link linkend="GksuPasswordNotNeededFunc"><type>GksuPasswordNotNeededFunc</type></link>
461
434
</simpara></listitem></varlistentry>
462
<varlistentry><term><parameter>error</parameter> :</term>
435
<varlistentry><term><parameter>error</parameter> :</term>
463
436
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> object to be filled with the error code or NULL
464
437
</simpara></listitem></varlistentry>
465
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
438
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
466
439
</simpara></listitem></varlistentry>
467
440
</variablelist></refsect2>
468
441
<refsect2 id="gksu-su" role="function">
469
442
<title>gksu_su ()</title>
470
<indexterm zone="gksu-su"><primary>gksu_su</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_su (<link linkend="gchar">gchar</link> *command_line,
443
<indexterm zone="gksu-su"><primary sortas="gksu_su">gksu_su</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_su (<link linkend="gchar">gchar</link> *command_line,
471
444
<link linkend="GError">GError</link> **error);</programlisting>
473
446
This function is a wrapper for gksu_su_run_full. It will call it
475
448
ones being called. A simple <link linkend="GksuContext"><type>GksuContext</type></link> is created to hold the
476
449
user name and the command.</para>
479
451
</para><variablelist role="params">
480
<varlistentry><term><parameter>command_line</parameter> :</term>
452
<varlistentry><term><parameter>command_line</parameter> :</term>
481
453
<listitem><simpara> the command line that will be executed as other user
482
454
</simpara></listitem></varlistentry>
483
<varlistentry><term><parameter>error</parameter> :</term>
455
<varlistentry><term><parameter>error</parameter> :</term>
484
456
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> to be set with the error condition, if an error
486
458
</simpara></listitem></varlistentry>
487
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went well, FALSE if an error happend.
459
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went well, FALSE if an error happend.
488
460
</simpara></listitem></varlistentry>
489
461
</variablelist></refsect2>
490
462
<refsect2 id="gksu-su-full" role="function">
491
463
<title>gksu_su_full ()</title>
492
<indexterm zone="gksu-su-full"><primary>gksu_su_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_su_full (<link linkend="GksuContext">GksuContext</link> *context,
464
<indexterm zone="gksu-su-full"><primary sortas="gksu_su_full">gksu_su_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_su_full (<link linkend="GksuContext">GksuContext</link> *context,
493
465
<link linkend="GksuAskPassFunc">GksuAskPassFunc</link> ask_pass,
494
466
<link linkend="gpointer">gpointer</link> ask_pass_data,
495
467
<link linkend="GksuPassNotNeededFunc">GksuPassNotNeededFunc</link> pass_not_needed,
496
468
<link linkend="gpointer">gpointer</link> pass_not_needed_data,
497
469
<link linkend="GError">GError</link> **error);</programlisting>
499
This could be considered one of the main functions in GKSu.
500
it is responsible for doing the 'user changing' magic calling
501
the <link linkend="GksuAskPassFunc"><type>GksuAskPassFunc</type></link> function to request a password if needed.
502
and the <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> function if a password won't be
503
needed, so the application has the oportunity of warning the user
507
This function uses su as backend.</para>
471
This is a compatibility shim over gksu_su_fuller, which, for
472
compatibility reasons, lacks the 'exit_status' argument. You should
473
check the documentation for gksu_su_fuller for information about
474
the arguments.</para>
510
476
</para><variablelist role="params">
511
<varlistentry><term><parameter>context</parameter> :</term>
477
<varlistentry><term><parameter>context</parameter> :</term>
512
478
<listitem><simpara> a <link linkend="GksuContext"><type>GksuContext</type></link>
513
479
</simpara></listitem></varlistentry>
514
<varlistentry><term><parameter>ask_pass</parameter> :</term>
480
<varlistentry><term><parameter>ask_pass</parameter> :</term>
515
481
<listitem><simpara> a <link linkend="GksuAskPassFunc"><type>GksuAskPassFunc</type></link> to be called when the lib determines
516
482
requesting a password is necessary; it may be NULL, in which case
517
483
the standard password request dialog will be used
518
484
</simpara></listitem></varlistentry>
519
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
485
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
520
486
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with user data to be passed to the
521
487
<link linkend="GksuAskPasswordFunc"><type>GksuAskPasswordFunc</type></link>
522
488
</simpara></listitem></varlistentry>
523
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
489
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
524
490
<listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called
525
491
when the command is being run without the need for requesting
526
492
a password; it will only be called if the display-no-pass-info
527
493
gconf key is enabled; NULL will have the standard dialog be shown
528
494
</simpara></listitem></varlistentry>
529
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
495
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
530
496
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the
531
497
<link linkend="GksuPasswordNotNeededFunc"><type>GksuPasswordNotNeededFunc</type></link>
532
498
</simpara></listitem></varlistentry>
533
<varlistentry><term><parameter>error</parameter> :</term>
499
<varlistentry><term><parameter>error</parameter> :</term>
534
500
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> object to be filled with the error code or NULL
535
501
</simpara></listitem></varlistentry>
536
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
502
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
537
503
</simpara></listitem></varlistentry>
538
504
</variablelist></refsect2>
539
505
<refsect2 id="gksu-sudo" role="function">
540
506
<title>gksu_sudo ()</title>
541
<indexterm zone="gksu-sudo"><primary>gksu_sudo</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_sudo (<link linkend="gchar">gchar</link> *command_line,
507
<indexterm zone="gksu-sudo"><primary sortas="gksu_sudo">gksu_sudo</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_sudo (<link linkend="gchar">gchar</link> *command_line,
542
508
<link linkend="GError">GError</link> **error);</programlisting>
544
510
This function is a wrapper for gksu_sudo_run_full. It will call it
546
512
ones being called. A simple <link linkend="GksuContext"><type>GksuContext</type></link> is created to hold the
547
513
user name and the command.</para>
550
515
</para><variablelist role="params">
551
<varlistentry><term><parameter>command_line</parameter> :</term>
516
<varlistentry><term><parameter>command_line</parameter> :</term>
552
517
<listitem><simpara> the command line that will be executed as other user
553
518
</simpara></listitem></varlistentry>
554
<varlistentry><term><parameter>error</parameter> :</term>
519
<varlistentry><term><parameter>error</parameter> :</term>
555
520
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> to be set with the error condition, if an error
557
522
</simpara></listitem></varlistentry>
558
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went well, FALSE if an error happend.
523
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went well, FALSE if an error happend.
559
524
</simpara></listitem></varlistentry>
560
525
</variablelist></refsect2>
561
526
<refsect2 id="gksu-sudo-full" role="function">
562
527
<title>gksu_sudo_full ()</title>
563
<indexterm zone="gksu-sudo-full"><primary>gksu_sudo_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_sudo_full (<link linkend="GksuContext">GksuContext</link> *context,
528
<indexterm zone="gksu-sudo-full"><primary sortas="gksu_sudo_full">gksu_sudo_full</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gksu_sudo_full (<link linkend="GksuContext">GksuContext</link> *context,
564
529
<link linkend="GksuAskPassFunc">GksuAskPassFunc</link> ask_pass,
565
530
<link linkend="gpointer">gpointer</link> ask_pass_data,
566
531
<link linkend="GksuPassNotNeededFunc">GksuPassNotNeededFunc</link> pass_not_needed,
567
532
<link linkend="gpointer">gpointer</link> pass_not_needed_data,
568
533
<link linkend="GError">GError</link> **error);</programlisting>
570
This could be considered one of the main functions in GKSu.
571
it is responsible for doing the 'user changing' magic calling
572
the <link linkend="GksuAskPassFunc"><type>GksuAskPassFunc</type></link> function to request a password if needed.
573
and the <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> function if a password won't be
574
needed, so the application has the oportunity of warning the user
578
This function uses the sudo backend.</para>
535
This is a compatibility shim over gksu_sudo_fuller, which, for
536
compatibility reasons, lacks the 'exit_status' argument. You should
537
check the documentation for gksu_sudo_fuller for information about
538
the arguments.</para>
581
540
</para><variablelist role="params">
582
<varlistentry><term><parameter>context</parameter> :</term>
541
<varlistentry><term><parameter>context</parameter> :</term>
583
542
<listitem><simpara> a <link linkend="GksuContext"><type>GksuContext</type></link>
584
543
</simpara></listitem></varlistentry>
585
<varlistentry><term><parameter>ask_pass</parameter> :</term>
544
<varlistentry><term><parameter>ask_pass</parameter> :</term>
586
545
<listitem><simpara> a <link linkend="GksuAskPassFunc"><type>GksuAskPassFunc</type></link> to be called when the lib determines
587
546
requesting a password is necessary; it may be NULL, in which case
588
547
the standard password request dialog will be used
589
548
</simpara></listitem></varlistentry>
590
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
549
<varlistentry><term><parameter>ask_pass_data</parameter> :</term>
591
550
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with user data to be passed to the
592
551
<link linkend="GksuAskPasswordFunc"><type>GksuAskPasswordFunc</type></link>
593
552
</simpara></listitem></varlistentry>
594
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
553
<varlistentry><term><parameter>pass_not_needed</parameter> :</term>
595
554
<listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called
596
555
when the command is being run without the need for requesting
597
556
a password; it will only be called if the display-no-pass-info
598
557
gconf key is enabled; NULL will have the standard dialog be shown
599
558
</simpara></listitem></varlistentry>
600
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
559
<varlistentry><term><parameter>pass_not_needed_data</parameter> :</term>
601
560
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the
602
561
<link linkend="GksuPasswordNotNeededFunc"><type>GksuPasswordNotNeededFunc</type></link>
603
562
</simpara></listitem></varlistentry>
604
<varlistentry><term><parameter>error</parameter> :</term>
563
<varlistentry><term><parameter>error</parameter> :</term>
605
564
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> object to be filled with the error code or NULL
606
565
</simpara></listitem></varlistentry>
607
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
566
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if all went fine, FALSE if failed
608
567
</simpara></listitem></varlistentry>
609
568
</variablelist></refsect2>
610
569
<refsect2 id="gksu-ask-password" role="function">
611
570
<title>gksu_ask_password ()</title>
612
<indexterm zone="gksu-ask-password"><primary>gksu_ask_password</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* gksu_ask_password (<link linkend="GError">GError</link> **error);</programlisting>
571
<indexterm zone="gksu-ask-password"><primary sortas="gksu_ask_password">gksu_ask_password</primary></indexterm><programlisting><link linkend="gchar">gchar</link> * gksu_ask_password (<link linkend="GError">GError</link> **error);</programlisting>
614
573
This function uses the gksu infra-structure to request for a
615
574
password, but instead of passing it to su or sudo to run a command
616
575
it simply returns the password. This is just a convenience wrapper
617
576
for gksu_ask_password_full.</para>
620
578
</para><variablelist role="params">
621
<varlistentry><term><parameter>error</parameter> :</term>
579
<varlistentry><term><parameter>error</parameter> :</term>
622
580
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> to be set with the error condition, if an error
624
582
</simpara></listitem></varlistentry>
625
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated string with the password;
583
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a newly allocated string with the password;
626
584
</simpara></listitem></varlistentry>
627
585
</variablelist></refsect2>
628
586
<refsect2 id="gksu-ask-password-full" role="function">
629
587
<title>gksu_ask_password_full ()</title>
630
<indexterm zone="gksu-ask-password-full"><primary>gksu_ask_password_full</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* gksu_ask_password_full (<link linkend="GksuContext">GksuContext</link> *context,
588
<indexterm zone="gksu-ask-password-full"><primary sortas="gksu_ask_password_full">gksu_ask_password_full</primary></indexterm><programlisting><link linkend="gchar">gchar</link> * gksu_ask_password_full (<link linkend="GksuContext">GksuContext</link> *context,
631
589
<link linkend="gchar">gchar</link> *prompt,
632
590
<link linkend="GError">GError</link> **error);</programlisting>