Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Zbigniew Jędrzejewski-Szmek
polkit
Commits
756043c7
Commit
756043c7
authored
Nov 11, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove glib dependency from libpolkit.so
parent
29837b4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
53 deletions
+34
-53
src/polkit-dbus/Makefile.am
src/polkit-dbus/Makefile.am
+1
-1
src/polkit/Makefile.am
src/polkit/Makefile.am
+2
-3
src/polkit/polkit-authorization-db-dummy.c
src/polkit/polkit-authorization-db-dummy.c
+2
-4
src/polkit/polkit-authorization-db.c
src/polkit/polkit-authorization-db.c
+29
-45
No files found.
src/polkit-dbus/Makefile.am
View file @
756043c7
...
...
@@ -23,7 +23,7 @@ libpolkit_dbusinclude_HEADERS = \
libpolkit_dbus_la_SOURCES
=
\
polkit-dbus.h polkit-dbus.c
libpolkit_dbus_la_LIBADD
=
@DBUS_LIBS@
$(top_builddir)
/src/polkit/libpolkit.la
$(SELINUX_LIBS)
libpolkit_dbus_la_LIBADD
=
@DBUS_LIBS@
$(top_builddir)
/src/polkit/libpolkit.la
$(SELINUX_LIBS)
$(GLIB_LIBS)
libpolkit_dbus_la_LDFLAGS
=
-version-info
$(LT_CURRENT)
:
$(LT_REVISION)
:
$(LT_AGE)
...
...
src/polkit/Makefile.am
View file @
756043c7
...
...
@@ -11,8 +11,7 @@ INCLUDES = \
-DPACKAGE_LIB_DIR
=
\"
"
$(libdir)
"
\"
\
-D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT
\
-DPOLKIT_COMPILATION
\
-DTEST_DATA_DIR
=
\"
$(top_srcdir)
/test/
\"
\
@GLIB_CFLAGS@
-DTEST_DATA_DIR
=
\"
$(top_srcdir)
/test/
\"
lib_LTLIBRARIES
=
libpolkit.la
...
...
@@ -71,7 +70,7 @@ libpolkit_la_SOURCES += \
polkit-authorization-db.c
endif
libpolkit_la_LIBADD
=
@GLIB_LIBS@
@EXPAT_LIBS@
$(top_builddir)
/src/kit/libkit.la
libpolkit_la_LIBADD
=
@EXPAT_LIBS@
$(top_builddir)
/src/kit/libkit.la
libpolkit_la_LDFLAGS
=
-version-info
$(LT_CURRENT)
:
$(LT_REVISION)
:
$(LT_AGE)
...
...
src/polkit/polkit-authorization-db-dummy.c
View file @
756043c7
...
...
@@ -39,8 +39,6 @@
#include <fcntl.h>
#include <pwd.h>
#include <glib.h>
#include "polkit-debug.h"
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
...
...
@@ -59,7 +57,7 @@ _polkit_authorization_db_new (void)
{
PolKitAuthorizationDB
*
authdb
;
authdb
=
g
_new0
(
PolKitAuthorizationDB
,
1
);
authdb
=
kit
_new0
(
PolKitAuthorizationDB
,
1
);
authdb
->
refcount
=
1
;
return
authdb
;
...
...
@@ -95,7 +93,7 @@ polkit_authorization_db_unref (PolKitAuthorizationDB *authdb)
authdb
->
refcount
--
;
if
(
authdb
->
refcount
>
0
)
return
;
g
_free
(
authdb
);
kit
_free
(
authdb
);
}
void
...
...
src/polkit/polkit-authorization-db.c
View file @
756043c7
...
...
@@ -39,8 +39,6 @@
#include <fcntl.h>
#include <pwd.h>
#include <glib.h>
#include "polkit-debug.h"
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
...
...
@@ -253,15 +251,14 @@ _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb)
*
* Since: 0.7
*/
static
GS
List
*
static
Kit
List
*
_authdb_get_auths_for_uid
(
PolKitAuthorizationDB
*
authdb
,
uid_t
uid
,
PolKitError
**
error
)
{
GS
List
*
ret
;
Kit
List
*
ret
;
char
*
helper_argv
[]
=
{
PACKAGE_LIBEXEC_DIR
"/polkit-read-auth-helper"
,
NULL
,
NULL
};
gint
exit_status
;
GError
*
g_error
;
int
exit_status
;
char
*
standard_output
;
size_t
len
;
off_t
n
;
...
...
@@ -280,27 +277,21 @@ _authdb_get_auths_for_uid (PolKitAuthorizationDB *authdb,
* because the auth file is readable only for uid 0 and gid
* polkituser.
*/
g_error
=
NULL
;
if
(
!
g_spawn_sync
(
NULL
,
/* const gchar *working_directory */
helper_argv
,
/* gchar **argv */
NULL
,
/* gchar **envp */
0
,
/* GSpawnFlags flags */
NULL
,
/* GSpawnChildSetupFunc child_setup */
NULL
,
/* gpointer user_data */
&
standard_output
,
/* gchar **standard_output */
NULL
,
/* gchar **standard_error */
&
exit_status
,
/* gint *exit_status */
&
g_error
))
{
/* GError **error */
if
(
!
kit_spawn_sync
(
NULL
,
/* const char *working_directory */
helper_argv
,
/* char **argv */
NULL
,
/* char **envp */
NULL
,
/* char *stdin */
&
standard_output
,
/* char **stdout */
NULL
,
/* char **stderr */
&
exit_status
))
{
/* int *exit_status */
polkit_error_set_error
(
error
,
POLKIT_ERROR_GENERAL_ERROR
,
"Error spawning read auth helper: %s"
,
g_error
->
message
);
g_error_free
(
g_error
);
"Error spawning read auth helper: %m"
);
goto
out
;
}
if
(
!
WIFEXITED
(
exit_status
))
{
g
_warning
(
"Read auth helper crashed!"
);
kit
_warning
(
"Read auth helper crashed!"
);
polkit_error_set_error
(
error
,
POLKIT_ERROR_GENERAL_ERROR
,
"Read auth helper crashed!"
);
...
...
@@ -345,7 +336,7 @@ _authdb_get_auths_for_uid (PolKitAuthorizationDB *authdb,
auth
=
_polkit_authorization_new_for_uid
(
line
,
uid
);
if
(
auth
!=
NULL
)
{
ret
=
g_s
list_prepend
(
ret
,
auth
);
ret
=
kit_
list_prepend
(
ret
,
auth
);
}
}
...
...
@@ -369,8 +360,8 @@ _internal_foreach (PolKitAuthorizationDB *authdb,
void
*
user_data
,
PolKitError
**
error
)
{
GS
List
*
l
;
GS
List
*
auths
;
Kit
List
*
l
;
Kit
List
*
auths
;
polkit_bool_t
ret
;
char
*
action_id
;
...
...
@@ -544,7 +535,7 @@ typedef struct {
static
polkit_bool_t
_check_auth_for_session
(
PolKitAuthorizationDB
*
authdb
,
PolKitAuthorization
*
auth
,
void
*
user_data
)
{
g
bool
ean
ret
;
polkit_
bool
_t
ret
;
CheckDataSession
*
cd
=
(
CheckDataSession
*
)
user_data
;
PolKitAuthorizationConstraint
*
constraint
;
...
...
@@ -649,7 +640,7 @@ static polkit_bool_t
_check_auth_for_caller
(
PolKitAuthorizationDB
*
authdb
,
PolKitAuthorization
*
auth
,
void
*
user_data
)
{
g
bool
ean
ret
;
polkit_
bool
_t
ret
;
pid_t
caller_pid
;
polkit_uint64_t
caller_pid_start_time
;
CheckData
*
cd
=
(
CheckData
*
)
user_data
;
...
...
@@ -680,7 +671,7 @@ _check_auth_for_caller (PolKitAuthorizationDB *authdb, PolKitAuthorization *auth
if
(
cd
->
revoke_if_one_shot
)
{
error
=
NULL
;
if
(
!
polkit_authorization_db_revoke_entry
(
authdb
,
auth
,
&
error
))
{
g
_warning
(
"Cannot revoke one-shot auth: %s: %s"
,
kit
_warning
(
"Cannot revoke one-shot auth: %s: %s"
,
polkit_error_get_error_name
(
error
),
polkit_error_get_error_message
(
error
));
polkit_error_free
(
error
);
...
...
@@ -798,11 +789,10 @@ polkit_authorization_db_revoke_entry (PolKitAuthorizationDB *authdb,
PolKitAuthorization
*
auth
,
PolKitError
**
error
)
{
GError
*
g_error
;
char
*
helper_argv
[]
=
{
PACKAGE_LIBEXEC_DIR
"/polkit-revoke-helper"
,
""
,
NULL
,
NULL
,
NULL
};
const
char
*
auth_file_entry
;
g
bool
ean
ret
;
g
int
exit_status
;
polkit_
bool
_t
ret
;
int
exit_status
;
ret
=
FALSE
;
...
...
@@ -816,27 +806,21 @@ polkit_authorization_db_revoke_entry (PolKitAuthorizationDB *authdb,
helper_argv
[
2
]
=
"uid"
;
helper_argv
[
3
]
=
kit_strdup_printf
(
"%d"
,
polkit_authorization_get_uid
(
auth
));
g_error
=
NULL
;
if
(
!
g_spawn_sync
(
NULL
,
/* const gchar *working_directory */
helper_argv
,
/* gchar **argv */
NULL
,
/* gchar **envp */
0
,
/* GSpawnFlags flags */
NULL
,
/* GSpawnChildSetupFunc child_setup */
NULL
,
/* gpointer user_data */
NULL
,
/* gchar **standard_output */
NULL
,
/* gchar **standard_error */
&
exit_status
,
/* gint *exit_status */
&
g_error
))
{
/* GError **error */
if
(
!
kit_spawn_sync
(
NULL
,
/* const char *working_directory */
helper_argv
,
/* char **argv */
NULL
,
/* char **envp */
NULL
,
/* char *stdin */
NULL
,
/* char **stdout */
NULL
,
/* char **stderr */
&
exit_status
))
{
/* int *exit_status */
polkit_error_set_error
(
error
,
POLKIT_ERROR_GENERAL_ERROR
,
"Error spawning revoke helper: %s"
,
g_error
->
message
);
g_error_free
(
g_error
);
"Error spawning revoke helper: %m"
);
goto
out
;
}
if
(
!
WIFEXITED
(
exit_status
))
{
g
_warning
(
"Revoke helper crashed!"
);
kit
_warning
(
"Revoke helper crashed!"
);
polkit_error_set_error
(
error
,
POLKIT_ERROR_GENERAL_ERROR
,
"Revoke helper crashed!"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment