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
96e73f52
Commit
96e73f52
authored
Mar 28, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split libpolkit into more source/header files
parent
9a0ad189
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
876 additions
and
412 deletions
+876
-412
libpolkit.pc.in
libpolkit.pc.in
+1
-1
libpolkit/Makefile.am
libpolkit/Makefile.am
+19
-7
libpolkit/libpolkit-caller.c
libpolkit/libpolkit-caller.c
+116
-0
libpolkit/libpolkit-caller.h
libpolkit/libpolkit-caller.h
+55
-0
libpolkit/libpolkit-context.c
libpolkit/libpolkit-context.c
+69
-0
libpolkit/libpolkit-context.h
libpolkit/libpolkit-context.h
+61
-0
libpolkit/libpolkit-privilege.c
libpolkit/libpolkit-privilege.c
+72
-0
libpolkit/libpolkit-privilege.h
libpolkit/libpolkit-privilege.h
+45
-0
libpolkit/libpolkit-resource.c
libpolkit/libpolkit-resource.c
+83
-0
libpolkit/libpolkit-resource.h
libpolkit/libpolkit-resource.h
+47
-0
libpolkit/libpolkit-seat.c
libpolkit/libpolkit-seat.c
+72
-0
libpolkit/libpolkit-seat.h
libpolkit/libpolkit-seat.h
+45
-0
libpolkit/libpolkit-session.c
libpolkit/libpolkit-session.c
+128
-0
libpolkit/libpolkit-session.h
libpolkit/libpolkit-session.h
+57
-0
libpolkit/libpolkit.c
libpolkit/libpolkit.c
+0
-312
libpolkit/libpolkit.h
libpolkit/libpolkit.h
+6
-92
No files found.
libpolkit.pc.in
View file @
96e73f52
...
...
@@ -8,4 +8,4 @@ Description: library for querying system-wide policy
Version: @VERSION@
Requires: glib-2.0
Libs: -L${libdir} -lpolkit
Cflags: -I${includedir}/
libpolk
it
Cflags: -I${includedir}/
PolicyK
it
libpolkit/Makefile.am
View file @
96e73f52
...
...
@@ -12,13 +12,25 @@ INCLUDES = \
lib_LTLIBRARIES
=
libpolkit.la
libpolkitincludedir
=
$(includedir)
/libpolkit
libpolkitinclude_HEADERS
=
\
libpolkit.h
libpolkit_la_SOURCES
=
\
libpolkit.c libpolkit.h
libpolkitincludedir
=
$(includedir)
/PolicyKit/libpolkit
libpolkitinclude_HEADERS
=
\
libpolkit.h
\
libpolkit-context.h
\
libpolkit-privilege.h
\
libpolkit-resource.h
\
libpolkit-seat.h
\
libpolkit-session.h
\
libpolkit-caller.h
libpolkit_la_SOURCES
=
\
libpolkit.h libpolkit.c
\
libpolkit-context.h libpolkit-context.c
\
libpolkit-privilege.h libpolkit-privilege.c
\
libpolkit-resource.h libpolkit-resource.c
\
libpolkit-seat.h libpolkit-seat.c
\
libpolkit-session.h libpolkit-session.c
\
libpolkit-caller.h libpolkit-caller.c
libpolkit_la_LIBADD
=
@GLIB_LIBS@
...
...
libpolkit/libpolkit-caller.c
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-caller.c : callers
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-caller.h"
struct
PolKitCaller_s
{
};
PolKitCaller
*
libpolkit_caller_new
(
void
)
{
return
NULL
;
}
PolKitCaller
*
libpolkit_caller_ref
(
PolKitCaller
*
caller
)
{
return
caller
;
}
void
libpolkit_caller_set_dbus_name
(
PolKitCaller
*
caller
,
const
char
*
dbus_name
)
{
}
void
libpolkit_caller_set_uid
(
PolKitCaller
*
caller
,
uid_t
uid
)
{
}
void
libpolkit_caller_set_pid
(
PolKitCaller
*
caller
,
pid_t
pid
)
{
}
void
libpolkit_caller_set_selinux_context
(
PolKitCaller
*
caller
,
const
char
*
selinux_context
)
{
}
void
libpolkit_caller_set_ck_session
(
PolKitCaller
*
caller
,
PolKitSession
*
session
)
{
}
gboolean
libpolkit_caller_get_dbus_name
(
PolKitCaller
*
caller
,
char
**
out_dbus_name
)
{
return
FALSE
;
}
gboolean
libpolkit_caller_get_uid
(
PolKitCaller
*
caller
,
uid_t
*
out_uid
)
{
return
FALSE
;
}
gboolean
libpolkit_caller_get_pid
(
PolKitCaller
*
caller
,
uid_t
*
out_pid
)
{
return
FALSE
;
}
gboolean
libpolkit_caller_get_selinux_context
(
PolKitCaller
*
caller
,
char
*
out_selinux_context
)
{
return
FALSE
;
}
gboolean
libpolkit_caller_get_ck_session
(
PolKitCaller
*
caller
,
PolKitSession
**
out_session
)
{
return
FALSE
;
}
void
libpolkit_caller_unref
(
PolKitCaller
*
caller
)
{
}
libpolkit/libpolkit-caller.h
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-caller.h : callers
*
* 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
*
**************************************************************************/
#ifndef LIBPOLKIT_CALLER_H
#define LIBPOLKIT_CALLER_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
#include <libpolkit/libpolkit-session.h>
struct
PolKitCaller_s
;
typedef
struct
PolKitCaller_s
PolKitCaller
;
PolKitCaller
*
libpolkit_caller_new
(
void
);
PolKitCaller
*
libpolkit_caller_ref
(
PolKitCaller
*
caller
);
void
libpolkit_caller_set_dbus_name
(
PolKitCaller
*
caller
,
const
char
*
dbus_name
);
void
libpolkit_caller_set_uid
(
PolKitCaller
*
caller
,
uid_t
uid
);
void
libpolkit_caller_set_pid
(
PolKitCaller
*
caller
,
pid_t
pid
);
void
libpolkit_caller_set_selinux_context
(
PolKitCaller
*
caller
,
const
char
*
selinux_context
);
void
libpolkit_caller_set_ck_session
(
PolKitCaller
*
caller
,
PolKitSession
*
session
);
gboolean
libpolkit_caller_get_dbus_name
(
PolKitCaller
*
caller
,
char
**
out_dbus_name
);
gboolean
libpolkit_caller_get_uid
(
PolKitCaller
*
caller
,
uid_t
*
out_uid
);
gboolean
libpolkit_caller_get_pid
(
PolKitCaller
*
caller
,
uid_t
*
out_pid
);
gboolean
libpolkit_caller_get_selinux_context
(
PolKitCaller
*
caller
,
char
*
out_selinux_context
);
gboolean
libpolkit_caller_get_ck_session
(
PolKitCaller
*
caller
,
PolKitSession
**
out_session
);
void
libpolkit_caller_unref
(
PolKitCaller
*
caller
);
#endif
/* LIBPOLKIT_H */
libpolkit/libpolkit-context.c
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-context.c : context for PolicyKit
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-context.h"
struct
PolKitContext_s
{
};
PolKitContext
*
libpolkit_context_new
(
void
)
{
return
FALSE
;
}
PolKitContext
*
libpolkit_context_ref
(
PolKitContext
*
pk_context
)
{
return
pk_context
;
}
void
libpolkit_context_set_config_changed
(
PolKitContext
*
pk_context
,
PolKitContextConfigChangedCB
cb
,
gpointer
user_data
)
{
}
void
libpolkit_context_unref
(
PolKitContext
*
pk_context
)
{
}
libpolkit/libpolkit-context.h
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-context.h : PolicyKit context
*
* 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
*
**************************************************************************/
#ifndef LIBPOLKIT_CONTEXT_H
#define LIBPOLKIT_CONTEXT_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct
PolKitContext_s
;
typedef
struct
PolKitContext_s
PolKitContext
;
/**
* PolKitContextConfigChangedCB:
* @pk_context: PolicyKit context
* @user_data: user data
*
* Called when configuration changes. Mechanisms should listen on this
* signal and e.g. reconfigure all permissions / acl's they have set
* in response to policy decisions made from information provided by
* PolicyKit.
*/
typedef
void
(
*
PolKitContextConfigChangedCB
)
(
PolKitContext
*
pk_context
,
gpointer
user_data
);
PolKitContext
*
libpolkit_context_new
(
void
);
PolKitContext
*
libpolkit_context_ref
(
PolKitContext
*
pk_context
);
void
libpolkit_context_set_config_changed
(
PolKitContext
*
pk_context
,
PolKitContextConfigChangedCB
cb
,
gpointer
user_data
);
void
libpolkit_context_unref
(
PolKitContext
*
pk_context
);
#endif
/* LIBPOLKIT_CONTEXT_H */
libpolkit/libpolkit-privilege.c
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-privilege.c : privilege
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-privilege.h"
struct
PolKitPrivilege_s
{
};
PolKitPrivilege
*
libpolkit_privilege_new
(
void
)
{
return
NULL
;
}
PolKitPrivilege
*
libpolkit_privilege_ref
(
PolKitPrivilege
*
privilege
)
{
return
privilege
;
}
void
libpolkit_privilege_set_privilege_id
(
PolKitPrivilege
*
privilege
,
const
char
*
privilege_id
)
{
}
gboolean
libpolkit_privilege_get_privilege_id
(
PolKitPrivilege
*
privilege
,
char
**
out_privilege_id
)
{
return
FALSE
;
}
void
libpolkit_privilege_unref
(
PolKitPrivilege
*
privilege
)
{
}
libpolkit/libpolkit-privilege.h
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-privilege.h : privileges
*
* 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
*
**************************************************************************/
#ifndef LIBPOLKIT_PRIVILEGE_H
#define LIBPOLKIT_PRIVILEGE_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct
PolKitPrivilege_s
;
typedef
struct
PolKitPrivilege_s
PolKitPrivilege
;
PolKitPrivilege
*
libpolkit_privilege_new
(
void
);
PolKitPrivilege
*
libpolkit_privilege_ref
(
PolKitPrivilege
*
privilege
);
void
libpolkit_privilege_set_privilege_id
(
PolKitPrivilege
*
privilege
,
const
char
*
privilege_id
);
gboolean
libpolkit_privilege_get_privilege_id
(
PolKitPrivilege
*
privilege
,
char
**
out_privilege_id
);
void
libpolkit_privilege_unref
(
PolKitPrivilege
*
privilege
);
#endif
/* LIBPOLKIT_PRIVILEGE_H */
libpolkit/libpolkit-resource.c
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-resource.c : resources
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-resource.h"
struct
PolKitResource_s
{
};
PolKitResource
*
libpolkit_resource_new
(
void
)
{
return
NULL
;
}
PolKitResource
*
libpolkit_resource_ref
(
PolKitResource
*
resource
)
{
return
resource
;
}
void
libpolkit_resource_set_resource_type
(
PolKitResource
*
resource
,
const
char
*
resource_type
)
{
}
void
libpolkit_resource_set_resource_id
(
PolKitResource
*
resource
,
const
char
*
resource_id
)
{
}
gboolean
libpolkit_resource_get_resource_type
(
PolKitResource
*
resource
,
char
**
out_resource_type
)
{
return
FALSE
;
}
gboolean
libpolkit_resource_get_resource_id
(
PolKitResource
*
resource
,
char
**
out_resource_id
)
{
return
FALSE
;
}
void
libpolkit_resource_unref
(
PolKitResource
*
resource
)
{
}
libpolkit/libpolkit-resource.h
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-resource.h : resources
*
* 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
*
**************************************************************************/
#ifndef LIBPOLKIT_RESOURCE_H
#define LIBPOLKIT_RESOURCE_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct
PolKitResource_s
;
typedef
struct
PolKitResource_s
PolKitResource
;
PolKitResource
*
libpolkit_resource_new
(
void
);
PolKitResource
*
libpolkit_resource_ref
(
PolKitResource
*
resource
);
void
libpolkit_resource_set_resource_type
(
PolKitResource
*
resource
,
const
char
*
resource_type
);
void
libpolkit_resource_set_resource_id
(
PolKitResource
*
resource
,
const
char
*
resource_id
);
gboolean
libpolkit_resource_get_resource_type
(
PolKitResource
*
resource
,
char
**
out_resource_type
);
gboolean
libpolkit_resource_get_resource_id
(
PolKitResource
*
resource
,
char
**
out_resource_id
);
void
libpolkit_resource_unref
(
PolKitResource
*
resource
);
#endif
/* LIBPOLKIT_RESOURCE_H */
libpolkit/libpolkit-seat.c
0 → 100644
View file @
96e73f52
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-seat.c : seat
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-seat.h"
struct
PolKitSeat_s
{
};
PolKitSeat
*
libpolkit_seat_new
(
void
)
{
return
NULL
;
}
PolKitSeat
*
libpolkit_seat_ref
(
PolKitSeat
*
seat
)
{
return
seat
;
}
void
libpolkit_seat_set_ck_objref
(
PolKitSeat
*
seat
,
const
char
*
ck_objref
)