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
f2bc7838
Commit
f2bc7838
authored
Oct 28, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move all private functions into a private header file
parent
bfa9f0d6
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
105 additions
and
61 deletions
+105
-61
polkit-dbus/Makefile.am
polkit-dbus/Makefile.am
+1
-0
polkit-dbus/polkit-explicit-grant-helper.c
polkit-dbus/polkit-explicit-grant-helper.c
+1
-3
polkit/Makefile.am
polkit/Makefile.am
+2
-1
polkit/polkit-authorization-constraint.c
polkit/polkit-authorization-constraint.c
+1
-2
polkit/polkit-authorization-db-dummy.c
polkit/polkit-authorization-db-dummy.c
+0
-3
polkit/polkit-authorization-db.c
polkit/polkit-authorization-db.c
+1
-11
polkit/polkit-authorization.c
polkit/polkit-authorization.c
+1
-4
polkit/polkit-context.c
polkit/polkit-context.c
+1
-5
polkit/polkit-policy-cache.c
polkit/polkit-policy-cache.c
+1
-2
polkit/polkit-policy-default.c
polkit/polkit-policy-default.c
+1
-4
polkit/polkit-policy-file-entry.c
polkit/polkit-policy-file-entry.c
+2
-15
polkit/polkit-policy-file.c
polkit/polkit-policy-file.c
+1
-11
polkit/polkit-private.h
polkit/polkit-private.h
+92
-0
No files found.
polkit-dbus/Makefile.am
View file @
f2bc7838
...
...
@@ -10,6 +10,7 @@ INCLUDES = \
-DPACKAGE_LOCALE_DIR
=
\"
"
$(localedir)
"
\"
\
-DPACKAGE_LIB_DIR
=
\"
"
$(libdir)
"
\"
\
-D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT
\
-DPOLKIT_COMPILATION
\
@GLIB_CFLAGS@ @DBUS_CFLAGS@
lib_LTLIBRARIES
=
libpolkit-dbus.la
...
...
polkit-dbus/polkit-explicit-grant-helper.c
View file @
f2bc7838
...
...
@@ -45,6 +45,7 @@
#include <fcntl.h>
#include <polkit-dbus/polkit-dbus.h>
#include <polkit/polkit-private.h>
static
polkit_bool_t
check_pid_for_authorization
(
pid_t
caller_pid
,
const
char
*
action_id
)
...
...
@@ -108,9 +109,6 @@ out:
return
ret
;
}
/* this function is in polkit/polkit-authorization-db.c */
extern
polkit_bool_t
_polkit_authorization_db_auth_file_add
(
const
char
*
root
,
polkit_bool_t
transient
,
uid_t
uid
,
char
*
str_to_add
);
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
polkit/Makefile.am
View file @
f2bc7838
...
...
@@ -38,7 +38,8 @@ libpolkitinclude_HEADERS = \
libpolkit_la_SOURCES
=
\
polkit.h
\
polkit-types.h
\
polkit-private.h
\
polkit-types.h
\
polkit-error.h polkit-error.c
\
polkit-result.h polkit-result.c
\
polkit-context.h polkit-context.c
\
...
...
polkit/polkit-authorization-constraint.c
View file @
f2bc7838
...
...
@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-authorization-constraint.h"
#include "polkit-utils.h"
#include "polkit-private.h"
/**
* SECTION:polkit-authorization-constraint
...
...
@@ -80,8 +81,6 @@ static PolKitAuthorizationConstraint _local_active_constraint = {-1,
POLKIT_AUTHORIZATION_CONSTRAINT_REQUIRE_LOCAL
|
POLKIT_AUTHORIZATION_CONSTRAINT_REQUIRE_ACTIVE
};
extern
PolKitAuthorizationConstraint
*
_polkit_authorization_constraint_new
(
const
char
*
entry_in_auth_file
);
PolKitAuthorizationConstraint
*
_polkit_authorization_constraint_new
(
const
char
*
entry_in_auth_file
)
{
...
...
polkit/polkit-authorization-db-dummy.c
View file @
f2bc7838
...
...
@@ -45,9 +45,6 @@
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
extern
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
extern
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
struct
_PolKitAuthorizationDB
{
int
refcount
;
...
...
polkit/polkit-authorization-db.c
View file @
f2bc7838
...
...
@@ -44,9 +44,7 @@
#include "polkit-debug.h"
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
extern
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
extern
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
#include "polkit-private.h"
/**
* SECTION:polkit-authorization-db
...
...
@@ -272,8 +270,6 @@ out:
return
start_time
;
}
extern
PolKitAuthorization
*
_polkit_authorization_new_for_uid
(
const
char
*
entry_in_auth_file
,
uid_t
uid
);
/**
* _authdb_get_auths_for_uid:
* @authdb: authorization database
...
...
@@ -819,9 +815,6 @@ out:
return
ret
;
}
/* this function is also used by polkit-dbus/polkit-explicit-grant-helper */
extern
polkit_bool_t
_polkit_authorization_db_auth_file_add
(
const
char
*
root
,
polkit_bool_t
transient
,
uid_t
uid
,
char
*
str_to_add
);
polkit_bool_t
_polkit_authorization_db_auth_file_add
(
const
char
*
root
,
polkit_bool_t
transient
,
uid_t
uid
,
char
*
str_to_add
)
{
...
...
@@ -1181,9 +1174,6 @@ polkit_authorization_db_add_entry_always (PolKitAuthorizationDB *authd
return
ret
;
}
extern
const
char
*
_polkit_authorization_get_authfile_entry
(
PolKitAuthorization
*
auth
);
/**
* polkit_authorization_db_revoke_entry:
* @authdb: the authorization database
...
...
polkit/polkit-authorization.c
View file @
f2bc7838
...
...
@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-authorization.h"
#include "polkit-utils.h"
#include "polkit-private.h"
/**
* SECTION:polkit-authorization
...
...
@@ -84,10 +85,6 @@ struct _PolKitAuthorization
char
*
session_id
;
};
extern
PolKitAuthorization
*
_polkit_authorization_new_for_uid
(
const
char
*
entry_in_auth_file
,
uid_t
uid
);
extern
const
char
*
_polkit_authorization_get_authfile_entry
(
PolKitAuthorization
*
auth
);
const
char
*
_polkit_authorization_get_authfile_entry
(
PolKitAuthorization
*
auth
)
{
...
...
polkit/polkit-context.c
View file @
f2bc7838
...
...
@@ -43,9 +43,7 @@
#include "polkit-debug.h"
#include "polkit-context.h"
#include "polkit-policy-cache.h"
extern
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
extern
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
#include "polkit-private.h"
/**
* SECTION:polkit
...
...
@@ -388,8 +386,6 @@ polkit_context_set_load_descriptions (PolKitContext *pk_context)
pk_context
->
load_descriptions
=
TRUE
;
}
extern
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
/**
* polkit_context_get_policy_cache:
* @pk_context: the context
...
...
polkit/polkit-policy-cache.c
View file @
f2bc7838
...
...
@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-policy-file.h"
#include "polkit-policy-cache.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-cache
...
...
@@ -76,8 +77,6 @@ _append_entry (PolKitPolicyFile *policy_file,
policy_cache
->
priv_entries
=
g_slist_append
(
policy_cache
->
priv_entries
,
policy_file_entry
);
}
extern
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
)
{
...
...
polkit/polkit-policy-default.c
View file @
f2bc7838
...
...
@@ -40,6 +40,7 @@
#include "polkit-debug.h"
#include "polkit-error.h"
#include "polkit-policy-default.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-default
...
...
@@ -63,10 +64,6 @@ struct _PolKitPolicyDefault
PolKitResult
default_active
;
};
extern
PolKitPolicyDefault
*
_polkit_policy_default_new
(
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
);
PolKitPolicyDefault
*
_polkit_policy_default_new
(
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
...
...
polkit/polkit-policy-file-entry.c
View file @
f2bc7838
...
...
@@ -42,6 +42,7 @@
#include "polkit-result.h"
#include "polkit-policy-file-entry.h"
#include "polkit-authorization-db.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-file-entry
...
...
@@ -68,23 +69,9 @@ struct _PolKitPolicyFileEntry
GHashTable
*
annotations
;
};
extern
void
_polkit_policy_file_entry_set_descriptions
(
PolKitPolicyFileEntry
*
pfe
,
const
char
*
policy_description
,
const
char
*
policy_message
);
extern
PolKitPolicyDefault
*
_polkit_policy_default_new
(
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
);
extern
PolKitPolicyFileEntry
*
_polkit_policy_file_entry_new
(
const
char
*
action_id
,
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
,
GHashTable
*
annotations
);
/* NOTE: we take ownership of the annotations object */
extern
PolKitPolicyFileEntry
*
PolKitPolicyFileEntry
*
_polkit_policy_file_entry_new
(
const
char
*
action_id
,
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
...
...
polkit/polkit-policy-file.c
View file @
f2bc7838
...
...
@@ -45,6 +45,7 @@
#include "polkit-policy-file.h"
#include "polkit-policy-file-entry.h"
#include "polkit-debug.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-file
...
...
@@ -66,12 +67,6 @@ struct _PolKitPolicyFile
GSList
*
entries
;
};
extern
PolKitPolicyFileEntry
*
_polkit_policy_file_entry_new
(
const
char
*
action_id
,
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
,
GHashTable
*
annotations
);
enum
{
STATE_NONE
,
STATE_UNKNOWN_TAG
,
...
...
@@ -308,11 +303,6 @@ error:
XML_StopParser
(
pd
->
parser
,
FALSE
);
}
extern
void
_polkit_policy_file_entry_set_descriptions
(
PolKitPolicyFileEntry
*
pfe
,
const
char
*
policy_description
,
const
char
*
policy_message
);
/**
* _localize:
* @translations: a mapping from xml:lang to the value, e.g. 'da' -> 'Smadre', 'en_CA' -> 'Punch, Aye!'
...
...
polkit/polkit-private.h
0 → 100644
View file @
f2bc7838
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* polkit-private.h : Private functions
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#if !defined (POLKIT_COMPILATION)
#error "This is a private file and shouldn't be included outside PolicyKit."
#endif
#ifndef POLKIT_PRIVATE_H
#define POLKIT_PRIVATE_H
#include <glib.h>
#include <polkit/polkit.h>
POLKIT_BEGIN_DECLS
PolKitAuthorization
*
_polkit_authorization_new_for_uid
(
const
char
*
entry_in_auth_file
,
uid_t
uid
);
const
char
*
_polkit_authorization_get_authfile_entry
(
PolKitAuthorization
*
auth
);
PolKitAuthorizationConstraint
*
_polkit_authorization_constraint_new
(
const
char
*
entry_in_auth_file
);
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
PolKitAuthorization
*
_polkit_authorization_new_for_uid
(
const
char
*
entry_in_auth_file
,
uid_t
uid
);
polkit_bool_t
_polkit_authorization_db_auth_file_add
(
const
char
*
root
,
polkit_bool_t
transient
,
uid_t
uid
,
char
*
str_to_add
);
const
char
*
_polkit_authorization_get_authfile_entry
(
PolKitAuthorization
*
auth
);
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
PolKitPolicyDefault
*
_polkit_policy_default_new
(
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
);
PolKitPolicyFileEntry
*
_polkit_policy_file_entry_new
(
const
char
*
action_id
,
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
,
GHashTable
*
annotations
);
void
_polkit_policy_file_entry_set_descriptions
(
PolKitPolicyFileEntry
*
pfe
,
const
char
*
policy_description
,
const
char
*
policy_message
);
PolKitPolicyDefault
*
_polkit_policy_default_new
(
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
);
PolKitPolicyFileEntry
*
_polkit_policy_file_entry_new
(
const
char
*
action_id
,
PolKitResult
defaults_allow_any
,
PolKitResult
defaults_allow_inactive
,
PolKitResult
defaults_allow_active
,
GHashTable
*
annotations
);
void
_polkit_policy_file_entry_set_descriptions
(
PolKitPolicyFileEntry
*
pfe
,
const
char
*
policy_description
,
const
char
*
policy_message
);
POLKIT_END_DECLS
#endif
/* POLKIT_PRIVATE_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