[glib] GCredentials: use effective uid/gid



commit 173977a7015c45e5dc3c43534cd3deb81159ad1f
Author: David Zeuthen <davidz redhat com>
Date:   Fri Jul 30 11:26:43 2010 -0400

    GCredentials: use effective uid/gid
    
    Otherwise e.g. setuid root processes can't connect to the system
    bus. This was discovered when porting PolicyKit's pkexec(1) command to
    a PolicyKit library using GDBus.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 docs/reference/glib/tmpl/glib-unused.sgml |   40 ++++++++++++++++++++++++++++
 docs/reference/glib/tmpl/messages.sgml    |   27 ++++---------------
 docs/reference/glib/tmpl/version.sgml     |   41 -----------------------------
 gio/gcredentials.c                        |    4 +-
 4 files changed, 48 insertions(+), 64 deletions(-)
---
diff --git a/docs/reference/glib/tmpl/glib-unused.sgml b/docs/reference/glib/tmpl/glib-unused.sgml
index 7b57189..3d551f7 100644
--- a/docs/reference/glib/tmpl/glib-unused.sgml
+++ b/docs/reference/glib/tmpl/glib-unused.sgml
@@ -937,6 +937,46 @@ Turns the argument into a string literal by using the '#' stringizing operator.
 </para>
 
 
+<!-- ##### VARIABLE glib_binary_age ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION glib_check_version ##### -->
+<para>
+
+</para>
+
+ required_major: 
+ required_minor: 
+ required_micro: 
+ Returns: 
+
+<!-- ##### VARIABLE glib_interface_age ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### VARIABLE glib_major_version ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### VARIABLE glib_micro_version ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### VARIABLE glib_minor_version ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### MACRO lseek ##### -->
 <para>
 
diff --git a/docs/reference/glib/tmpl/messages.sgml b/docs/reference/glib/tmpl/messages.sgml
index 245a775..2c4e8d8 100644
--- a/docs/reference/glib/tmpl/messages.sgml
+++ b/docs/reference/glib/tmpl/messages.sgml
@@ -117,18 +117,15 @@ documentation.
 @args: the parameters to insert into the format string.
 
 
-<!-- ##### FUNCTION g_message ##### -->
+<!-- ##### MACRO g_message ##### -->
 <para>
 A convenience function/macro to log a normal message.
 </para>
 
- format: 
- Varargs: 
-<!-- # Unused Parameters # -->
 @...: format string, followed by parameters to insert into the format string (as with printf())
 
 
-<!-- ##### FUNCTION g_warning ##### -->
+<!-- ##### MACRO g_warning ##### -->
 <para>
 A convenience function/macro to log a warning message.
 </para>
@@ -138,13 +135,10 @@ You can make warnings fatal at runtime by setting the %G_DEBUG environment
 variable (see <ulink url="glib-running.html">Running GLib Applications</ulink>).
 </para>
 
- format: 
- Varargs: 
-<!-- # Unused Parameters # -->
 @...: format string, followed by parameters to insert into the format string (as with printf())
 
 
-<!-- ##### FUNCTION g_critical ##### -->
+<!-- ##### MACRO g_critical ##### -->
 <para>
 Logs a "critical warning" (#G_LOG_LEVEL_CRITICAL). It's more or less
 application-defined what constitutes a critical vs. a regular
@@ -159,13 +153,10 @@ the %G_DEBUG environment variable (see
 <ulink url="glib-running.html">Running GLib Applications</ulink>).
 </para>
 
- format: 
- Varargs: 
-<!-- # Unused Parameters # -->
 @...: format string, followed by parameters to insert into the format string (as with printf())
 
 
-<!-- ##### FUNCTION g_error ##### -->
+<!-- ##### MACRO g_error ##### -->
 <para>
 A convenience function/macro to log an error message.
 Error messages are always fatal, resulting in a call to
@@ -175,22 +166,16 @@ expect. Using this function indicates a bug in your program, i.e. an
 assertion failure.
 </para>
 
- format: 
- Varargs: 
-<!-- # Unused Parameters # -->
 @...: format string, followed by parameters to insert into the format string (as with printf())
 
 
-<!-- ##### FUNCTION g_debug ##### -->
+<!-- ##### MACRO g_debug ##### -->
 <para>
 A convenience function/macro to log a debug message.
 </para>
 
- format: 
- Varargs: 
- Since: 2.6
-<!-- # Unused Parameters # -->
 @...: format string, followed by parameters to insert into the format string (as with printf())
+ Since: 2.6
 
 
 <!-- ##### FUNCTION g_log_set_handler ##### -->
diff --git a/docs/reference/glib/tmpl/version.sgml b/docs/reference/glib/tmpl/version.sgml
index 027a0f4..dca4ac9 100644
--- a/docs/reference/glib/tmpl/version.sgml
+++ b/docs/reference/glib/tmpl/version.sgml
@@ -22,47 +22,6 @@ typically use the features described here.
 <!-- ##### SECTION Image ##### -->
 
 
-<!-- ##### VARIABLE glib_major_version ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### VARIABLE glib_minor_version ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### VARIABLE glib_micro_version ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### VARIABLE glib_binary_age ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### VARIABLE glib_interface_age ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### FUNCTION glib_check_version ##### -->
-<para>
-
-</para>
-
- required_major: 
- required_minor: 
- required_micro: 
- Returns: 
-
-
 <!-- ##### MACRO GLIB_MAJOR_VERSION ##### -->
 <para>
 The major version number of the GLib library.
diff --git a/gio/gcredentials.c b/gio/gcredentials.c
index e79901f..a9c2b5a 100644
--- a/gio/gcredentials.c
+++ b/gio/gcredentials.c
@@ -118,8 +118,8 @@ g_credentials_init (GCredentials *credentials)
 {
 #ifdef __linux__
   credentials->native.pid = getpid ();
-  credentials->native.uid = getuid ();
-  credentials->native.gid = getgid ();
+  credentials->native.uid = geteuid ();
+  credentials->native.gid = getegid ();
 #endif
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]