Merge pull request #7494 from poettering/nspawn-cgroups

some nspawn cgroup fixes + dissecting and testing love
This commit is contained in:
Lennart Poettering
2017-12-05 18:53:24 +01:00
committed by GitHub
16 changed files with 271 additions and 69 deletions
+16
View File
@@ -673,6 +673,22 @@ bool fstype_can_discard(const char *fstype) {
"xfs");
}
bool fstype_can_uid_gid(const char *fstype) {
/* All file systems that have a uid=/gid= mount option that fixates the owners of all files and directories,
* current and future. */
return STR_IN_SET(fstype,
"adfs",
"fat",
"hfs",
"hpfs",
"iso9660",
"msdos",
"ntfs",
"vfat");
}
int repeat_unmount(const char *path, int flags) {
bool done = false;
+1
View File
@@ -52,6 +52,7 @@ bool fstype_is_network(const char *fstype);
bool fstype_is_api_vfs(const char *fstype);
bool fstype_is_ro(const char *fsype);
bool fstype_can_discard(const char *fstype);
bool fstype_can_uid_gid(const char *fstype);
const char* mode_to_inaccessible_node(mode_t mode);
+3 -1
View File
@@ -882,7 +882,9 @@ int systemd_installation_has_version(const char *root, unsigned minimal_version)
* for Gentoo which does a merge without making /lib a symlink.
*/
"lib/systemd/libsystemd-shared-*.so\0"
"usr/lib/systemd/libsystemd-shared-*.so\0") {
"lib64/systemd/libsystemd-shared-*.so\0"
"usr/lib/systemd/libsystemd-shared-*.so\0"
"usr/lib64/systemd/libsystemd-shared-*.so\0") {
_cleanup_strv_free_ char **names = NULL;
_cleanup_free_ char *path = NULL;
+23 -5
View File
@@ -734,16 +734,20 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz) {
return obuf;
}
char *strextend(char **x, ...) {
va_list ap;
size_t f, l;
char *strextend_with_separator(char **x, const char *separator, ...) {
bool need_separator;
size_t f, l, l_separator;
char *r, *p;
va_list ap;
assert(x);
l = f = strlen_ptr(*x);
va_start(ap, x);
need_separator = !isempty(*x);
l_separator = strlen_ptr(separator);
va_start(ap, separator);
for (;;) {
const char *t;
size_t n;
@@ -753,22 +757,29 @@ char *strextend(char **x, ...) {
break;
n = strlen(t);
if (need_separator)
n += l_separator;
if (n > ((size_t) -1) - l) {
va_end(ap);
return NULL;
}
l += n;
need_separator = true;
}
va_end(ap);
need_separator = !isempty(*x);
r = realloc(*x, l+1);
if (!r)
return NULL;
p = r + f;
va_start(ap, x);
va_start(ap, separator);
for (;;) {
const char *t;
@@ -776,10 +787,17 @@ char *strextend(char **x, ...) {
if (!t)
break;
if (need_separator && separator)
p = stpcpy(p, separator);
p = stpcpy(p, t);
need_separator = true;
}
va_end(ap);
assert(p == r + l);
*p = 0;
*x = r;
+3 -1
View File
@@ -179,7 +179,9 @@ char *strreplace(const char *text, const char *old_string, const char *new_strin
char *strip_tab_ansi(char **p, size_t *l);
char *strextend(char **x, ...) _sentinel_;
char *strextend_with_separator(char **x, const char *separator, ...) _sentinel_;
#define strextend(x, ...) strextend_with_separator(x, NULL, __VA_ARGS__)
char *strrep(const char *s, unsigned n);