Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
polkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zbigniew Jędrzejewski-Szmek
polkit
Commits
f455c2f6
Commit
f455c2f6
authored
Oct 20, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add C++ include guards and a new method to get pfe's by annotation
parent
0d7cdd74
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
128 additions
and
0 deletions
+128
-0
polkit-dbus/polkit-dbus.h
polkit-dbus/polkit-dbus.h
+3
-0
polkit-grant/polkit-grant.h
polkit-grant/polkit-grant.h
+3
-0
polkit/polkit-action.h
polkit/polkit-action.h
+4
-0
polkit/polkit-caller.h
polkit/polkit-caller.h
+4
-0
polkit/polkit-config.h
polkit/polkit-config.h
+5
-0
polkit/polkit-context.h
polkit/polkit-context.h
+4
-0
polkit/polkit-error.h
polkit/polkit-error.h
+6
-0
polkit/polkit-grant-database.h
polkit/polkit-grant-database.h
+4
-0
polkit/polkit-policy-cache.c
polkit/polkit-policy-cache.c
+42
-0
polkit/polkit-policy-cache.h
polkit/polkit-policy-cache.h
+10
-0
polkit/polkit-policy-default.h
polkit/polkit-policy-default.h
+5
-0
polkit/polkit-policy-file-entry.h
polkit/polkit-policy-file-entry.h
+4
-0
polkit/polkit-policy-file.h
polkit/polkit-policy-file.h
+5
-0
polkit/polkit-result.h
polkit/polkit-result.h
+4
-0
polkit/polkit-seat.h
polkit/polkit-seat.h
+4
-0
polkit/polkit-session.h
polkit/polkit-session.h
+4
-0
polkit/polkit-types.h
polkit/polkit-types.h
+12
-0
polkit/polkit-utils.h
polkit/polkit-utils.h
+4
-0
polkit/polkit.h
polkit/polkit.h
+1
-0
No files found.
polkit-dbus/polkit-dbus.h
View file @
f455c2f6
...
...
@@ -30,6 +30,8 @@
#include <polkit/polkit.h>
#include <dbus/dbus.h>
POLKIT_BEGIN_DECLS
PolKitSession
*
polkit_session_new_from_objpath
(
DBusConnection
*
con
,
const
char
*
objpath
,
uid_t
uid
,
DBusError
*
error
);
PolKitSession
*
polkit_session_new_from_cookie
(
DBusConnection
*
con
,
const
char
*
cookie
,
DBusError
*
error
);
...
...
@@ -54,6 +56,7 @@ PolKitCaller *polkit_tracker_get_caller_from_dbus_name (PolKitTracker *pk_trac
PolKitCaller
*
polkit_tracker_get_caller_from_pid
(
PolKitTracker
*
pk_tracker
,
pid_t
pid
,
DBusError
*
error
);
POLKIT_END_DECLS
#endif
/* POLKIT_DBUS_H */
...
...
polkit-grant/polkit-grant.h
View file @
f455c2f6
...
...
@@ -28,6 +28,8 @@
#include <polkit/polkit.h>
POLKIT_BEGIN_DECLS
struct
_PolKitGrant
;
typedef
struct
_PolKitGrant
PolKitGrant
;
...
...
@@ -360,6 +362,7 @@ void polkit_grant_cancel_auth (PolKitGrant *polkit_grant);
void
polkit_grant_io_func
(
PolKitGrant
*
polkit_grant
,
int
fd
);
void
polkit_grant_child_func
(
PolKitGrant
*
polkit_grant
,
pid_t
pid
,
int
exit_code
);
POLKIT_END_DECLS
#endif
/* POLKIT_GRANT_H */
...
...
polkit/polkit-action.h
View file @
f455c2f6
...
...
@@ -32,6 +32,8 @@
#include <polkit/polkit-types.h>
POLKIT_BEGIN_DECLS
struct
_PolKitAction
;
typedef
struct
_PolKitAction
PolKitAction
;
...
...
@@ -46,6 +48,8 @@ polkit_bool_t polkit_action_validate (PolKitAction *action);
polkit_bool_t
polkit_action_validate_id
(
const
char
*
action_id
);
POLKIT_END_DECLS
#endif
/* POLKIT_ACTION_H */
polkit/polkit-caller.h
View file @
f455c2f6
...
...
@@ -34,6 +34,8 @@
#include <polkit/polkit-session.h>
#include <sys/types.h>
POLKIT_BEGIN_DECLS
struct
_PolKitCaller
;
typedef
struct
_PolKitCaller
PolKitCaller
;
...
...
@@ -54,4 +56,6 @@ polkit_bool_t polkit_caller_get_ck_session (PolKitCaller *caller, Pol
void
polkit_caller_debug
(
PolKitCaller
*
caller
);
polkit_bool_t
polkit_caller_validate
(
PolKitCaller
*
caller
);
POLKIT_END_DECLS
#endif
/* POLKIT_H */
polkit/polkit-config.h
View file @
f455c2f6
...
...
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <regex.h>
#include <polkit/polkit-types.h>
#include <polkit/polkit-error.h>
#include <polkit/polkit-types.h>
#include <polkit/polkit-result.h>
...
...
@@ -39,6 +40,8 @@
#include <polkit/polkit-session.h>
#include <polkit/polkit-caller.h>
POLKIT_BEGIN_DECLS
struct
_PolKitConfig
;
typedef
struct
_PolKitConfig
PolKitConfig
;
...
...
@@ -78,6 +81,8 @@ polkit_bool_t polkit_config_determine_admin_auth_type (PolKitConfig
PolKitConfigAdminAuthType
*
out_admin_auth_type
,
const
char
**
out_data
);
POLKIT_END_DECLS
#endif
/* POLKIT_CONFIG_H */
polkit/polkit-context.h
View file @
f455c2f6
...
...
@@ -41,6 +41,8 @@
#include <polkit/polkit-policy-cache.h>
#include <polkit/polkit-config.h>
POLKIT_BEGIN_DECLS
struct
_PolKitContext
;
typedef
struct
_PolKitContext
PolKitContext
;
...
...
@@ -165,6 +167,8 @@ PolKitResult polkit_context_can_caller_do_action (PolKitContext *pk_contex
PolKitConfig
*
polkit_context_get_config
(
PolKitContext
*
pk_context
,
PolKitError
**
error
);
POLKIT_END_DECLS
#endif
/* POLKIT_CONTEXT_H */
polkit/polkit-error.h
View file @
f455c2f6
...
...
@@ -30,6 +30,10 @@
#ifndef POLKIT_ERROR_H
#define POLKIT_ERROR_H
#include <polkit/polkit-types.h>
POLKIT_BEGIN_DECLS
/**
* PolKitErrorCode:
* @POLKIT_ERROR_OUT_OF_MEMORY: Out of memory
...
...
@@ -51,4 +55,6 @@ const char *polkit_error_get_error_message (PolKitError *error);
void
polkit_error_free
(
PolKitError
*
error
);
void
polkit_error_set_error
(
PolKitError
**
error
,
PolKitErrorCode
error_code
,
const
char
*
format
,
...)
__attribute__
((
__format__
(
__printf__
,
3
,
4
)));
POLKIT_END_DECLS
#endif
/* POLKIT_ERROR_H */
polkit/polkit-grant-database.h
View file @
f455c2f6
...
...
@@ -28,6 +28,8 @@
#include <polkit/polkit.h>
POLKIT_BEGIN_DECLS
PolKitResult
_polkit_grantdb_check_can_caller_do_action
(
PolKitContext
*
pk_context
,
PolKitAction
*
action
,
PolKitCaller
*
caller
);
...
...
@@ -78,4 +80,6 @@ void _polkit_grantdb_foreach (PolKitGrantDbForeachFunc callback, void *user_data
polkit_bool_t
_polkit_grantdb_delete_for_user
(
uid_t
uid
);
POLKIT_END_DECLS
#endif
/* POLKIT_GRANT_DATABASE_H */
polkit/polkit-policy-cache.c
View file @
f455c2f6
...
...
@@ -301,3 +301,45 @@ polkit_policy_cache_foreach (PolKitPolicyCache *policy_cache,
callback
(
policy_cache
,
pfe
,
user_data
);
}
}
/**
* polkit_policy_cache_get_entry_by_annotation:
* @policy_cache: the policy cache
* @annotation_key: the key to check for
* @annotation_value: the value to check for
*
* Find the first policy file entry where a given annotation matches a
* given value. Note that there is nothing preventing the existence of
* multiple policy file entries matching this criteria; it would
* however be a packaging bug if this situation occured.
*
* Returns: The first #PolKitPolicyFileEntry matching the search
* criteria. The caller shall not unref this object. Returns #NULL if
* there are no policy file entries matching the search criteria.
*/
PolKitPolicyFileEntry
*
polkit_policy_cache_get_entry_by_annotation
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
annotation_key
,
const
char
*
annotation_value
)
{
GSList
*
i
;
g_return_val_if_fail
(
policy_cache
!=
NULL
,
NULL
);
g_return_val_if_fail
(
annotation_key
!=
NULL
,
NULL
);
g_return_val_if_fail
(
annotation_value
!=
NULL
,
NULL
);
for
(
i
=
policy_cache
->
priv_entries
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
{
const
char
*
value
;
PolKitPolicyFileEntry
*
pfe
=
i
->
data
;
value
=
polkit_policy_file_entry_get_annotation
(
pfe
,
annotation_key
);
if
(
value
==
NULL
)
continue
;
if
(
strcmp
(
annotation_value
,
value
)
==
0
)
{
return
pfe
;
}
}
return
NULL
;
}
polkit/polkit-policy-cache.h
View file @
f455c2f6
...
...
@@ -30,10 +30,13 @@
#ifndef POLKIT_POLICY_CACHE_H
#define POLKIT_POLICY_CACHE_H
#include <polkit/polkit-types.h>
#include <polkit/polkit-error.h>
#include <polkit/polkit-action.h>
#include <polkit/polkit-policy-file-entry.h>
POLKIT_BEGIN_DECLS
struct
_PolKitPolicyCache
;
typedef
struct
_PolKitPolicyCache
PolKitPolicyCache
;
...
...
@@ -56,10 +59,17 @@ PolKitPolicyFileEntry* polkit_policy_cache_get_entry (PolKitPolicyCache *policy_
PolKitAction
*
action
);
PolKitPolicyFileEntry
*
polkit_policy_cache_get_entry_by_id
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
action_id
);
PolKitPolicyFileEntry
*
polkit_policy_cache_get_entry_by_annotation
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
annotation_key
,
const
char
*
annotation_value
);
void
polkit_policy_cache_foreach
(
PolKitPolicyCache
*
policy_cache
,
PolKitPolicyCacheForeachFunc
callback
,
void
*
user_data
);
POLKIT_END_DECLS
#endif
/* POLKIT_POLICY_CACHE_H */
polkit/polkit-policy-default.h
View file @
f455c2f6
...
...
@@ -30,12 +30,15 @@
#ifndef POLKIT_POLICY_DEFAULT_H
#define POLKIT_POLICY_DEFAULT_H
#include <polkit/polkit-types.h>
#include <polkit/polkit-result.h>
#include <polkit/polkit-action.h>
#include <polkit/polkit-session.h>
#include <polkit/polkit-caller.h>
#include <polkit/polkit-error.h>
POLKIT_BEGIN_DECLS
struct
_PolKitPolicyDefault
;
typedef
struct
_PolKitPolicyDefault
PolKitPolicyDefault
;
...
...
@@ -57,6 +60,8 @@ PolKitResult polkit_policy_default_get_allow_active (PolKitPolicyDefault *policy
/* TODO: export knobs for "default policy" */
POLKIT_END_DECLS
#endif
/* POLKIT_POLICY_DEFAULT_H */
polkit/polkit-policy-file-entry.h
View file @
f455c2f6
...
...
@@ -30,9 +30,12 @@
#ifndef POLKIT_POLICY_FILE_ENTRY_H
#define POLKIT_POLICY_FILE_ENTRY_H
#include <polkit/polkit-types.h>
#include <polkit/polkit-result.h>
#include <polkit/polkit-policy-default.h>
POLKIT_BEGIN_DECLS
struct
_PolKitPolicyFileEntry
;
typedef
struct
_PolKitPolicyFileEntry
PolKitPolicyFileEntry
;
...
...
@@ -66,6 +69,7 @@ void polkit_policy_file_entry_annotations_foreach (PolKitPolic
const
char
*
polkit_policy_file_entry_get_annotation
(
PolKitPolicyFileEntry
*
policy_file_entry
,
const
char
*
key
);
POLKIT_END_DECLS
#endif
/* POLKIT_POLICY_FILE_ENTRY_H */
...
...
polkit/polkit-policy-file.h
View file @
f455c2f6
...
...
@@ -30,9 +30,12 @@
#ifndef POLKIT_POLICY_FILE_H
#define POLKIT_POLICY_FILE_H
#include <polkit/polkit-types.h>
#include <polkit/polkit-error.h>
#include <polkit/polkit-policy-file-entry.h>
POLKIT_BEGIN_DECLS
struct
_PolKitPolicyFile
;
typedef
struct
_PolKitPolicyFile
PolKitPolicyFile
;
...
...
@@ -57,6 +60,8 @@ void polkit_policy_file_entry_foreach (PolKitPolicyFile
PolKitPolicyFileEntryForeachFunc
cb
,
void
*
user_data
);
POLKIT_END_DECLS
#endif
/* POLKIT_POLICY_FILE_H */
polkit/polkit-result.h
View file @
f455c2f6
...
...
@@ -32,6 +32,8 @@
#include <polkit/polkit-types.h>
POLKIT_BEGIN_DECLS
/**
* PolKitResult:
* @POLKIT_RESULT_UNKNOWN: The result is unknown / cannot be
...
...
@@ -88,4 +90,6 @@ polkit_result_to_string_representation (PolKitResult result);
polkit_bool_t
polkit_result_from_string_representation
(
const
char
*
string
,
PolKitResult
*
out_result
);
POLKIT_END_DECLS
#endif
/* POLKIT_RESULT_H */
polkit/polkit-seat.h
View file @
f455c2f6
...
...
@@ -32,6 +32,8 @@
#include <polkit/polkit-types.h>
POLKIT_BEGIN_DECLS
struct
_PolKitSeat
;
typedef
struct
_PolKitSeat
PolKitSeat
;
...
...
@@ -44,6 +46,8 @@ polkit_bool_t polkit_seat_get_ck_objref (PolKitSeat *seat, char **out_ck_o
void
polkit_seat_debug
(
PolKitSeat
*
seat
);
polkit_bool_t
polkit_seat_validate
(
PolKitSeat
*
seat
);
POLKIT_END_DECLS
#endif
/* POLKIT_SEAT_H */
polkit/polkit-session.h
View file @
f455c2f6
...
...
@@ -35,6 +35,8 @@
#include <sys/types.h>
POLKIT_BEGIN_DECLS
struct
_PolKitSession
;
typedef
struct
_PolKitSession
PolKitSession
;
...
...
@@ -57,4 +59,6 @@ polkit_bool_t polkit_session_get_ck_remote_host (PolKitSession *session, char
void
polkit_session_debug
(
PolKitSession
*
session
);
polkit_bool_t
polkit_session_validate
(
PolKitSession
*
session
);
POLKIT_END_DECLS
#endif
/* POLKIT_SESSION_H */
polkit/polkit-types.h
View file @
f455c2f6
...
...
@@ -30,6 +30,16 @@
#ifndef POLKIT_TYPES_H
#define POLKIT_TYPES_H
#ifdef __cplusplus
# define POLKIT_BEGIN_DECLS extern "C" {
# define POLKIT_END_DECLS }
#else
# define POLKIT_BEGIN_DECLS
# define POLKIT_END_DECLS
#endif
POLKIT_BEGIN_DECLS
/**
* SECTION:polkit-types
* @title: Basic types
...
...
@@ -59,6 +69,8 @@ typedef unsigned long long polkit_uint64_t;
# define FALSE 0
#endif
POLKIT_END_DECLS
#endif
/* POLKIT_TYPES_H */
polkit/polkit-utils.h
View file @
f455c2f6
...
...
@@ -28,10 +28,14 @@
#include <polkit/polkit-types.h>
POLKIT_BEGIN_DECLS
polkit_bool_t
_pk_validate_identifier
(
const
char
*
identifier
);
polkit_bool_t
_pk_validate_unique_bus_name
(
const
char
*
unique_bus_name
);
POLKIT_END_DECLS
#endif
/* POLKIT_UTILS_H */
polkit/polkit.h
View file @
f455c2f6
...
...
@@ -39,6 +39,7 @@
#include <polkit/polkit-policy-file.h>
#include <polkit/polkit-policy-cache.h>
#include <polkit/polkit-policy-default.h>
#include <polkit/polkit-config.h>
#undef _POLKIT_INSIDE_POLKIT_H
#endif
/* POLKIT_H */
...
...
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