Create client proxy code and add binaries to clean rule.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Merge pull request #2 from jamesodhunt/master

Various fixes.
Use $CC and $CFLAGS.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Fixed -Wall fluff.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgmanager_get_my_cgroup() fixes.

- Handle NULL controller and value.
- Use NIH memory allocation to avoid crash.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgmanager.c memory management improvements.

- cgmanager_get_pid_cgroup(): Use NIH memory allocation to avoid crash.
- cgmanager_create(): USE NIH memory allocation to simplify memory
  management.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Re-add copyright symbol again.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
start chown command

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

There's not a corresponding client yet.

In the process, commonize some existing code, and switch some things to
nih functions.  (More of that should be coming)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
fix method name in xml

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

Also add an ok return value to the chownCgroup method, and fix the
construction of the '/tasks' path that we want to chown.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
fix unhnadled exception

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
chown_cgroup_path: call chown not itself on procs+tasks

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
fixes to chown

move the chown helper to fs.c

when requestor r requests cgroup /a/b/c to be created, then we chown
all files under /a/b/c to r's uid/gid.  This is because r already had
the rights to write under /a/b, therefore writing to files under
/a/b/c/ is safe.  If r requests chowning /a/b/c to some uid (its own
or any other), then only the directory and proc+tasks files are
chowned.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
drop_newlines: don't recalculate strlen(n)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
add som fn comments to fs.c

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Merge remote-tracking branch 'upstream/master'

Conflicts:
	Makefile
	cgmanager.c
cgmanager_create(): Don't raise double D-Bus error.