summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-07-24 21:43:44 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-07-24 21:43:44 +0000
commitf982b8155ec0acbd2bd873d53869c692cc948e45 (patch)
treedac8d793a782c724cc81a9a881fd1cd8a08080c5
parent431ca10ae7ca970d65f15fe0a1115ee749a97433 (diff)
downloadillumos-joyent-f982b8155ec0acbd2bd873d53869c692cc948e45.tar.gz
OS-4544 cgroup release_agent argument path should start with /
-rw-r--r--usr/src/uts/common/brand/lx/cgroups/cgrps_vfsops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/src/uts/common/brand/lx/cgroups/cgrps_vfsops.c b/usr/src/uts/common/brand/lx/cgroups/cgrps_vfsops.c
index b2ffa02418..0a505a8f2e 100644
--- a/usr/src/uts/common/brand/lx/cgroups/cgrps_vfsops.c
+++ b/usr/src/uts/common/brand/lx/cgroups/cgrps_vfsops.c
@@ -56,7 +56,8 @@
* file exists in each cgroup dir. If that file contains a '1' then the agent
* is run when that group becomes empty. The agent is passed a path string of
* the cgroup, relative to the file system mount point (e.g. a mount on
- * /sys/fs/cgroups/systemd with a sub-cgroup of foo/bar gets the arg foo/bar).
+ * /sys/fs/cgroups/systemd with a sub-cgroup of /sys/fs/cgroups/systemd/foo/bar
+ * gets the arg /foo/bar).
*
* Cgroup membership is implemented via hooks into the lx brand code. When
* the cgroup file system loads it installs callbacks for:
@@ -879,12 +880,12 @@ cgrp_rel_agent_event(cgrp_mnt_t *cgm, cgrp_node_t *cn)
cgrp_get_dirname(cn, nm, sizeof (nm));
DTRACE_PROBE1(cgrp__dir__name, char *, nm);
if (*argstr == '\0') {
- (void) strlcpy(argstr, nm, MAXPATHLEN);
+ (void) snprintf(argstr, MAXPATHLEN, "/%s", nm);
} else {
tmp = oldstr;
oldstr = argstr;
argstr = tmp;
- (void) snprintf(argstr, MAXPATHLEN, "%s/%s", nm,
+ (void) snprintf(argstr, MAXPATHLEN, "/%s%s", nm,
oldstr);
}