test09: use tmpdir for mounting

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
implement chmod

This allows a user to change permissions on cgroup files which he
owns.  For instance lxc will use this to set g+w on the base tasks
file.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
frontend.c: use nih_error_steal so we can nih_dbus_error_raise()

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
assign alloc result to d

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
chmod_main: allow empty file and file with '.'

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
proxy: don't unref message in *_main

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
pass proxy credentials to _main functions

This is always the credentials on the socket.  For a straight dbus call
it will always be identical to the requestor credential.  When a
requestor goes through a proxy, it can be different.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
add api_version dbus property

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
use memmove for overlapping region

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Add MovePidAbs method

This is the only way for a task (which must either be root in the
proxy's namespace, or root and in the cgmanager's pid namespace)
to escape upward from his current cgroup.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
rename req_cgroup to cgroup

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
check for sane cgroup in all methods

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgproxy: fix --check-master logic

if cgproxy has already run, then we have to check against
/sys/fs/cgroup/cgmanager.lower/sock, not /sys/fs/cgroup/cgmanager/sock

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
bump api version to 2

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
bump package version to 0.19

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
add manpages

Actually implement them using help2man.  To support this, add
descriptions in cg{proxy,manager}.man.add, and make cgproxy
allow running of --help without being root.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Makefile.am: fix help2man command

pass -s 8 to specify admin tools section, and use $(HELP2MAN)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
proxy: support running in top namespace

In that case /sys/fs/cgroup/cgmanager is not a mount, so
we have to rename it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
travis: Add help2man

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
add .spec for rpm build, minor packaging fixes

- use pkginclude_HEADERS so that make install puts the header in
  /usr/include/cgmanager/cgmanger-client.h instead of directly in
  /usr/include. We'll need to fix the path used in lxc.

- put libcgmanager.pc in $(libdir) see here for why:
  https://lists.linuxcontainers.org/pipermail/lxc-devel/2012-September/002643.html

- fix make -j by adding cgmanager and cgproxy as deps for building
  their manpage since help2man runs them to generate it

- add libnih and libnih-dbus to .pc as requires so
  pkg-config --libs libcgmanger outputs them

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>