chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename formats-util.h to format-util.h
[elogind.git]
/
src
/
login
/
logind-user.c
diff --git
a/src/login/logind-user.c
b/src/login/logind-user.c
index cd198c8d2623205ae116448897cff284e1ca4710..c1fd75a829e553add73bcd3e0185adb67447d4ca 100644
(file)
--- a/
src/login/logind-user.c
+++ b/
src/login/logind-user.c
@@
-26,12
+26,13
@@
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
+#include "cgroup-util.h"
#include "clean-ipc.h"
#include "conf-parser.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "clean-ipc.h"
#include "conf-parser.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
-#include "format
s
-util.h"
+#include "format-util.h"
#include "fs-util.h"
#include "hashmap.h"
#include "label.h"
#include "fs-util.h"
#include "hashmap.h"
#include "label.h"
@@
-362,14
+363,12
@@
static int user_mkdir_runtime_path(User *u) {
r = mount("tmpfs", u->runtime_path, "tmpfs", MS_NODEV|MS_NOSUID, t);
if (r < 0) {
r = mount("tmpfs", u->runtime_path, "tmpfs", MS_NODEV|MS_NOSUID, t);
if (r < 0) {
- if (errno != EPERM) {
+ if (errno != EPERM
&& errno != EACCES
) {
r = log_error_errno(errno, "Failed to mount per-user tmpfs directory %s: %m", u->runtime_path);
goto fail;
}
r = log_error_errno(errno, "Failed to mount per-user tmpfs directory %s: %m", u->runtime_path);
goto fail;
}
- /* Lacking permissions, maybe
- * CAP_SYS_ADMIN-less container? In this case,
- * just use a normal directory. */
+ log_debug_errno(errno, "Failed to mount per-user tmpfs directory %s, assuming containerized execution, ignoring: %m", u->runtime_path);
r = chmod_and_chown(u->runtime_path, 0700, u->uid, u->gid);
if (r < 0) {
r = chmod_and_chown(u->runtime_path, 0700, u->uid, u->gid);
if (r < 0) {
@@
-942,7
+941,17
@@
int config_parse_user_tasks_max(
assert(rvalue);
assert(data);
assert(rvalue);
assert(data);
- /* First, try to parse as percentage */
+ if (isempty(rvalue)) {
+ *m = system_tasks_max_scale(DEFAULT_USER_TASKS_MAX_PERCENTAGE, 100U);
+ return 0;
+ }
+
+ if (streq(rvalue, "infinity")) {
+ *m = CGROUP_LIMIT_MAX;
+ return 0;
+ }
+
+ /* Try to parse as percentage */
r = parse_percent(rvalue);
if (r >= 0)
k = system_tasks_max_scale(r, 100U);
r = parse_percent(rvalue);
if (r >= 0)
k = system_tasks_max_scale(r, 100U);