File: libgksu12-GksuContext.html

package info (click to toggle)
libgksu1.2 1.3.8-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 3,212 kB
  • ctags: 1,337
  • sloc: sh: 9,359; ansic: 8,864; xml: 548; makefile: 477; yacc: 288; sed: 16
file content (948 lines) | stat: -rw-r--r-- 35,680 bytes parent folder | download
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GksuContext - run programs as other users with su or sudo</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="LibGKSu Reference Manual">
<link rel="up" href="ch01.html" title="Main Reference">
<link rel="prev" href="ch01.html" title="Main Reference">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Main Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">LibGKSu Reference Manual</th>
<td>&#160;</td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#desc" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libgksu12-GksuContext"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="top_of_page"></a>GksuContext - run programs as other users with su or sudo</span></h2>
<p>GksuContext - run programs as other users with su or sudo &#8212; Handler that contains all the necessary information for a 
program to be run by the libgksu library.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">



            <a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a>;
<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a>* <a href="libgksu12-GksuContext.html#gksu-context-new">gksu_context_new</a>               ();
void        <a href="libgksu12-GksuContext.html#gksu-context-free">gksu_context_free</a>               (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-user">gksu_context_set_user</a>           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *username);
const gchar* <a href="libgksu12-GksuContext.html#gksu-context-get-user">gksu_context_get_user</a>          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-command">gksu_context_set_command</a>        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *command);
const gchar* <a href="libgksu12-GksuContext.html#gksu-context-get-command">gksu_context_get_command</a>       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-password">gksu_context_set_password</a>       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *password);
const gchar* <a href="libgksu12-GksuContext.html#gksu-context-get-password">gksu_context_get_password</a>      (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-login-shell">gksu_context_set_login_shell</a>    (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-get-login-shell">gksu_context_get_login_shell</a>    (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-keep-env">gksu_context_set_keep_env</a>       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-get-keep-env">gksu_context_get_keep_env</a>       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-debug">gksu_context_set_debug</a>          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-get-debug">gksu_context_get_debug</a>          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
void        <a href="libgksu12-GksuContext.html#gksu-context-set-ssh-fwd">gksu_context_set_ssh_fwd</a>        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-get-ssh-fwd">gksu_context_get_ssh_fwd</a>        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-sudo-try-need-password">gksu_context_sudo_try_need_password</a>
                                            (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-try-need-password">gksu_context_try_need_password</a>  (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-run-full">gksu_context_run_full</a>           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GksuAskPasswordFunc ask_pass,
                                             gpointer user_data,
                                             GksuPasswordNotNeededFunc pass_not_needed,
                                             gpointer pnn_user_data,
                                             GError **error);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-run">gksu_context_run</a>                (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GError **error);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-sudo-run-full">gksu_context_sudo_run_full</a>      (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GksuAskPasswordFunc ask_pass,
                                             gpointer user_data,
                                             GksuPasswordNotNeededFunc pass_not_needed,
                                             gpointer pnn_user_data,
                                             GError **error);
gboolean    <a href="libgksu12-GksuContext.html#gksu-context-sudo-run">gksu_context_sudo_run</a>           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GError **error);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="desc"></a><h2>Description</h2>
<p>
Everything that is done by libgksu needs to know a lot of stuff
about what to run, as what user to run and some more information,
as X authentication information and such. All that information is
contained in a GksuContext.
</p>
</div>
<div class="refsect1" lang="en">
<a name="details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2536511"></a><h3>
<a name="GksuContext"></a>GksuContext</h3>
<a class="indexterm" name="id2536523"></a><pre class="programlisting">typedef struct {
  GObject parent;

  gchar *xauth;
  gchar *dir;

  gchar *display;

  gchar *user;
  gchar *password;
  gchar *command;

  gboolean login_shell;
  gboolean keep_env;

  gboolean debug;
  gboolean ssh_fwd;
} GksuContext;
</pre>
<p>
Object that holds all configuration information, some
important environment variables and some meta-information
about mainly x authentication.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term">GObject&#160;<em class="structfield"><code>parent</code></em>;</span></td>
<td> <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> is based on <span class="type">GObject</span>
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>xauth</code></em>;</span></td>
<td> the X authorization token
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>dir</code></em>;</span></td>
<td> the directory where the .Xauthority file is created in sudo
mode
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>display</code></em>;</span></td>
<td> storage for the DISPLAY environment variable
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>user</code></em>;</span></td>
<td> user gksu will switch to
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>password</code></em>;</span></td>
<td> the password that should be passed to su or sudo
</td>
</tr>
<tr>
<td>
<span class="term">gchar&#160;*<em class="structfield"><code>command</code></em>;</span></td>
<td> which command to run with su
</td>
</tr>
<tr>
<td>
<span class="term">gboolean&#160;<em class="structfield"><code>login_shell</code></em>;</span></td>
<td> should run a login shell?
</td>
</tr>
<tr>
<td>
<span class="term">gboolean&#160;<em class="structfield"><code>keep_env</code></em>;</span></td>
<td> should the current environment be kept?
</td>
</tr>
<tr>
<td>
<span class="term">gboolean&#160;<em class="structfield"><code>debug</code></em>;</span></td>
<td> show debug information?
</td>
</tr>
<tr>
<td>
<span class="term">gboolean&#160;<em class="structfield"><code>ssh_fwd</code></em>;</span></td>
<td> are we running inside a ssh X11 forwarding
tunnel?
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2472108"></a><h3>
<a name="gksu-context-new"></a>gksu_context_new ()</h3>
<a class="indexterm" name="id2472120"></a><pre class="programlisting"><a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a>* gksu_context_new               ();</pre>
<p>
Creates a new context to use gksu with. You must
manually free the context with gksu_context_free
after use.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561254"></a><h3>
<a name="gksu-context-free"></a>gksu_context_free ()</h3>
<a class="indexterm" name="id2561265"></a><pre class="programlisting">void        gksu_context_free               (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Frees the provided <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> to be freed.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561320"></a><h3>
<a name="gksu-context-set-user"></a>gksu_context_set_user ()</h3>
<a class="indexterm" name="id2561331"></a><pre class="programlisting">void        gksu_context_set_user           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *username);</pre>
<p>
Sets up what user the command will be run as. The default
is root, but you can run the command as any user.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>username</code></em>&#160;:</span></td>
<td> the target username
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561406"></a><h3>
<a name="gksu-context-get-user"></a>gksu_context_get_user ()</h3>
<a class="indexterm" name="id2561417"></a><pre class="programlisting">const gchar* gksu_context_get_user          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Gets the user the command will be run as, as set
by gksu_context_set_user.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a pointer to the string containing the username.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561488"></a><h3>
<a name="gksu-context-set-command"></a>gksu_context_set_command ()</h3>
<a class="indexterm" name="id2561499"></a><pre class="programlisting">void        gksu_context_set_command        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *command);</pre>
<p>
Sets up what command will run with the target user.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>command</code></em>&#160;:</span></td>
<td> the command that shall be ran
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561577"></a><h3>
<a name="gksu-context-get-command"></a>gksu_context_get_command ()</h3>
<a class="indexterm" name="id2561588"></a><pre class="programlisting">const gchar* gksu_context_get_command       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Gets the command that will be run, as set by
gksu_context_set_command.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a pointer to the string containing the command.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561659"></a><h3>
<a name="gksu-context-set-password"></a>gksu_context_set_password ()</h3>
<a class="indexterm" name="id2561670"></a><pre class="programlisting">void        gksu_context_set_password       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gchar *password);</pre>
<p>
Sets up what is the password to be passed to su/sudo. *</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>password</code></em>&#160;:</span></td>
<td> the password
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561749"></a><h3>
<a name="gksu-context-get-password"></a>gksu_context_get_password ()</h3>
<a class="indexterm" name="id2561760"></a><pre class="programlisting">const gchar* gksu_context_get_password      (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Gets the password that is set for calling the su/sudo
programs.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a pointer to the string containing the password.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561831"></a><h3>
<a name="gksu-context-set-login-shell"></a>gksu_context_set_login_shell ()</h3>
<a class="indexterm" name="id2561844"></a><pre class="programlisting">void        gksu_context_set_login_shell    (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);</pre>
<p>
Should the shell in which the command will be run be
a login shell?</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
<td> TRUE or FALSE
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2561923"></a><h3>
<a name="gksu-context-get-login-shell"></a>gksu_context_get_login_shell ()</h3>
<a class="indexterm" name="id2561936"></a><pre class="programlisting">gboolean    gksu_context_get_login_shell    (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Finds out if the shell created by the underlying su process
will be a login shell.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if the shell will be a login shell, FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562006"></a><h3>
<a name="gksu-context-set-keep-env"></a>gksu_context_set_keep_env ()</h3>
<a class="indexterm" name="id2562018"></a><pre class="programlisting">void        gksu_context_set_keep_env       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);</pre>
<p>
Should the environment be kept as it is? Defaults to
TRUE. Notice that setting this to FALSE may cause the
X authorization stuff to fail.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
<td> TRUE or FALSE
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562097"></a><h3>
<a name="gksu-context-get-keep-env"></a>gksu_context_get_keep_env ()</h3>
<a class="indexterm" name="id2562109"></a><pre class="programlisting">gboolean    gksu_context_get_keep_env       (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Finds out if the environment in which the program will be
run will be reset.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if the environment is going to be kept,
FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562179"></a><h3>
<a name="gksu-context-set-debug"></a>gksu_context_set_debug ()</h3>
<a class="indexterm" name="id2562190"></a><pre class="programlisting">void        gksu_context_set_debug          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);</pre>
<p>
Set up if debuging information should be printed.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
<td> TRUE or FALSE
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562268"></a><h3>
<a name="gksu-context-get-debug"></a>gksu_context_get_debug ()</h3>
<a class="indexterm" name="id2562279"></a><pre class="programlisting">gboolean    gksu_context_get_debug          (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Finds out if the library is configured to print debuging
information.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if it is, FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562348"></a><h3>
<a name="gksu-context-set-ssh-fwd"></a>gksu_context_set_ssh_fwd ()</h3>
<a class="indexterm" name="id2562359"></a><pre class="programlisting">void        gksu_context_set_ssh_fwd        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             gboolean value);</pre>
<p>
Set up if we are running inside a sshd forwarding
session. That's because the X authorization semantics
differ a bit.
-&gt; THIS SETTING IS CURRENTLY USED FOR NOTHING</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> you want to modify
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
<td> TRUE or FALSE
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562439"></a><h3>
<a name="gksu-context-get-ssh-fwd"></a>gksu_context_get_ssh_fwd ()</h3>
<a class="indexterm" name="id2562450"></a><pre class="programlisting">gboolean    gksu_context_get_ssh_fwd        (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Finds out if the library is configured as being run inside a
ssh X11 forwarding tunnel.
-&gt; THIS SETTING IS CURRENTLY USED FOR NOTHING</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> the <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a> from which to grab the information
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if it is, FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562520"></a><h3>
<a name="gksu-context-sudo-try-need-password"></a>gksu_context_sudo_try_need_password ()</h3>
<a class="indexterm" name="id2562534"></a><pre class="programlisting">gboolean    gksu_context_sudo_try_need_password
                                            (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Checks if we need to ask for a password or if we have ways of
getting the password for ourselves or we simply don't need it.
Since 1.3.1.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if requesting a password is needed, FALSE otherwise.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562605"></a><h3>
<a name="gksu-context-try-need-password"></a>gksu_context_try_need_password ()</h3>
<a class="indexterm" name="id2562618"></a><pre class="programlisting">gboolean    gksu_context_try_need_password  (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context);</pre>
<p>
Checks if we need to ask for a password or if we have ways of
getting the password for ourselves or we simply don't need it.
Since 1.3.0.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE if requesting a password is needed, FALSE otherwise.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562689"></a><h3>
<a name="gksu-context-run-full"></a>gksu_context_run_full ()</h3>
<a class="indexterm" name="id2562700"></a><pre class="programlisting">gboolean    gksu_context_run_full           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GksuAskPasswordFunc ask_pass,
                                             gpointer user_data,
                                             GksuPasswordNotNeededFunc pass_not_needed,
                                             gpointer pnn_user_data,
                                             GError **error);</pre>
<p>
This could be considered one of the main functions in GKSu.
it is responsible for doing the 'user changing' magic calling
the <span class="type">GksuAskPasswordFunc</span> function to request a password if needed.
and the <span class="type">GksuPasswordNotNeededFunc</span> function if a password won't be
needed, so the application has the oportunity of warning the user
what it's doing.
Since 1.3.3.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ask_pass</code></em>&#160;:</span></td>
<td> a <span class="type">GksuAskPasswordFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td>
<td> a <span class="type">gpointer</span> with user data to be passed to the
<span class="type">GksuAskPasswordFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pass_not_needed</code></em>&#160;:</span></td>
<td> a <span class="type">GksuPasswordNotNeededFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pnn_user_data</code></em>&#160;:</span></td>
<td> a <span class="type">gpointer</span> with the user data to be passed to the
<span class="type">GksuPasswordNotNeededFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
<td> a <span class="type">GError</span> object to be filled with the error code or NULL
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the child's error status, 0 if all went fine, -1 if failed
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2562916"></a><h3>
<a name="gksu-context-run"></a>gksu_context_run ()</h3>
<a class="indexterm" name="id2562927"></a><pre class="programlisting">gboolean    gksu_context_run                (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GError **error);</pre>
<p>
This could be considered one of the main functions in GKSu.
it is responsible for doing the 'user changing' magic.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
<td> a <span class="type">GError</span> object to be filled with the error code or NULL
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the child's error status, 0 if all went fine, -1 if failed
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2563016"></a><h3>
<a name="gksu-context-sudo-run-full"></a>gksu_context_sudo_run_full ()</h3>
<a class="indexterm" name="id2563027"></a><pre class="programlisting">gboolean    gksu_context_sudo_run_full      (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GksuAskPasswordFunc ask_pass,
                                             gpointer user_data,
                                             GksuPasswordNotNeededFunc pass_not_needed,
                                             gpointer pnn_user_data,
                                             GError **error);</pre>
<p>
This could be considered one of the main functions in GKSu.
it is responsible for doing the 'user changing' magic calling
the <span class="type">GksuAskPasswordFunc</span> function to request a password if needed.
and the <span class="type">GksuPasswordNotNeededFunc</span> function if a password won't be
needed, so the application has the oportunity of warning the user
what it's doing.
Since 1.3.3.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ask_pass</code></em>&#160;:</span></td>
<td> a <span class="type">GksuAskPasswordFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td>
<td> a <span class="type">gpointer</span> with user data to be passed to the
<span class="type">GksuAskPasswordFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pass_not_needed</code></em>&#160;:</span></td>
<td> a <span class="type">GksuPasswordNotNeededFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pnn_user_data</code></em>&#160;:</span></td>
<td> a <span class="type">gpointer</span> with the user data to be passed to the
<span class="type">GksuPasswordNotNeededFunc</span>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
<td> a <span class="type">GError</span> object to be filled with the error code or NULL
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the child's error status, 0 if all went fine, -1 if failed
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2563247"></a><h3>
<a name="gksu-context-sudo-run"></a>gksu_context_sudo_run ()</h3>
<a class="indexterm" name="id2563257"></a><pre class="programlisting">gboolean    gksu_context_sudo_run           (<a href="libgksu12-GksuContext.html#GksuContext">GksuContext</a> *context,
                                             GError **error);</pre>
<p>
This could be considered one of the main functions in GKSu.
it is responsible for doing the 'user changing' magic by
calling <code class="function">gksu_ask_password()</code> if it needs the user's password
it behaves like sudo.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> a <a href="libgksu12-GksuContext.html#GksuContext"><span class="type">GksuContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
<td> a <span class="type">GError</span> object to be filled with the error code or NULL
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the child's error status, 0 if all went fine, -1 if failed
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2563357"></a><h2>See Also</h2>
<p>
For convenience Gtk+2.0 widgets to request the user's password take a
look at libgksuui1.0 and its API reference.
</p>
</div>
</div>
</body>
</html>