quota.c revision bf7dc750b95039981c0e9d728f313d50cf38a156
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch/* Copyright (c) 2005-2017 Dovecot authors, see the included COPYING file */
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen "Quota exceeded (mailbox for user is full)"
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#define QUOTA_LIMIT_SET_PATH DICT_PATH_PRIVATE"quota/limit/"
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen/* How many seconds after the userdb lookup do we still want to execute the
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen quota_over_script. This applies to quota_over_flag_lazy_check=yes and also
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen after unhibernating IMAP connections. */
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen unsigned int i;
2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74cTimo Sirainenunsigned int quota_module_id = 0;
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainenextern struct quota_backend quota_backend_count;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenextern struct quota_backend quota_backend_dict;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenextern struct quota_backend quota_backend_dirsize;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenextern struct quota_backend quota_backend_maildir;
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainenstatic const struct quota_backend *quota_backends[] = {
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenstatic enum quota_alloc_result quota_default_test_alloc(
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen struct quota_transaction_context *ctx, uoff_t size);
10399559650f552a23949772be79eb6a80198c5aTimo Sirainenstatic void quota_over_flag_check_root(struct quota_root *root);
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainenstatic const struct quota_backend *quota_backend_find(const char *name)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen unsigned int i;
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainen for (i = 0; i < N_ELEMENTS(quota_backends); i++) {
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen if (strcmp(quota_backends[i]->name, name) == 0)
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainenstatic int quota_root_add_rules(struct mail_user *user, const char *root_name,
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainen const char **error_r)
bdb0f594a5673a0c5a16b92dc49eb2a8a66bdaceTimo Sirainen unsigned int i;
8f2eb1ee9ec07661bd50275da99b5f351972a49aTimo Sirainen rule_name = t_strconcat(root_name, "_rule", NULL);
eca38954bcf972618f6b85932a3690acbd2b673aTimo Sirainen for (i = 2;; i++) {
8f2eb1ee9ec07661bd50275da99b5f351972a49aTimo Sirainen rule = mail_user_plugin_getenv(user, rule_name);
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainen if (quota_root_add_rule(root_set, rule, &error) < 0) {
a6a6ad107e509cf8952a28f740eb2023284497b9Timo Sirainen *error_r = t_strdup_printf("Invalid rule %s: %s",
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen rule_name = t_strdup_printf("%s_rule%d", root_name, i);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenquota_root_add_warning_rules(struct mail_user *user, const char *root_name,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen const char **error_r)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen unsigned int i;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen rule_name = t_strconcat(root_name, "_warning", NULL);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen for (i = 2;; i++) {
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen rule = mail_user_plugin_getenv(user, rule_name);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (quota_root_add_warning_rule(root_set, rule, &error) < 0) {
37fed1bc1545f7eb1755b61d6a5ac4d083a693b3Timo Sirainen *error_r = t_strdup_printf("Invalid warning rule: %s",
37fed1bc1545f7eb1755b61d6a5ac4d083a693b3Timo Sirainen rule_name = t_strdup_printf("%s_warning%d", root_name, i);
62ff6002b1e37a42303c2c0107f324860232e204Timo Sirainenquota_root_parse_set(struct mail_user *user, const char *root_name,
62ff6002b1e37a42303c2c0107f324860232e204Timo Sirainen const char **error_r)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen *error_r = t_strdup_printf("%s supports only dict backend", name);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen root_set->limit_set = p_strdup(root_set->set->pool, value+5);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenquota_root_settings_init(struct quota_settings *quota_set, const char *root_def,
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen const char **error_r)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen /* <backend>[:<quota root name>[:<backend args>]] */
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen *error_r = t_strdup_printf("Unknown quota backend: %s",
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen root_set = p_new(quota_set->pool, struct quota_root_settings, 1);
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen /* save root's name */
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen root_set->name = p_strdup(quota_set->pool, args);
3350b29fce44f8bc8fa015dad57024a8de301d38Timo Sirainen root_set->args = p_strdup(quota_set->pool, args);
3350b29fce44f8bc8fa015dad57024a8de301d38Timo Sirainen i_debug("Quota root: name=%s backend=%s args=%s",
3350b29fce44f8bc8fa015dad57024a8de301d38Timo Sirainen root_set->name, backend_name, args == NULL ? "" : args);
1f366614aaafcc9496ff85b25988f19c3254ab7cTimo Sirainen p_array_init(&root_set->rules, quota_set->pool, 4);
c224fff79d18480a65e9b4504b891b8ea176f5b1Timo Sirainen p_array_init(&root_set->warning_rules, quota_set->pool, 4);
bdb0f594a5673a0c5a16b92dc49eb2a8a66bdaceTimo Sirainen array_append("a_set->root_sets, &root_set, 1);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenquota_root_add(struct quota_settings *quota_set, struct mail_user *user,
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen const char *env, const char *root_name, const char **error_r)
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen if (quota_root_settings_init(quota_set, env, &root_set, error_r) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen root_set->set_name = p_strdup(quota_set->pool, root_name);
3ccab0bac68040f179a7de45c516cec258e28fdbTimo Sirainen if (quota_root_add_rules(user, root_name, root_set, error_r) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (quota_root_add_warning_rules(user, root_name, root_set, error_r) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (quota_root_parse_set(user, root_name, root_set, error_r) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen set_name = t_strconcat(root_name, "_grace", NULL);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen value = mail_user_plugin_getenv(user, set_name);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (quota_root_parse_grace(root_set, value, error_r) < 0) {
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen *error_r = t_strdup_printf("Invalid %s value '%s': %s",
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainenconst char *quota_alloc_result_errstr(enum quota_alloc_result res,
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen return "Internal quota calculation error";
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen return "Mail size is larger than the maximum size allowed by "
055389c58fa3915e12fb4e72ec86782ce77c5c72Timo Sirainen "server configuration";
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainenint quota_user_read_settings(struct mail_user *user,
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen const char **error_r)
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen unsigned int i;
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen pool = pool_alloconly_create("quota settings", 2048);
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen quota_set = p_new(pool, struct quota_settings, 1);
8d25b6ad05b99e75613cb045a121efd51e6afbb6Timo Sirainen quota_set->test_alloc = quota_default_test_alloc;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen mail_user_plugin_getenv(user, "quota_exceeded_message");
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen quota_set->quota_exceeded_msg = DEFAULT_QUOTA_EXCEEDED_MSG;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen quota_set->vsizes = mail_user_plugin_getenv_bool(user, "quota_vsizes");
c73415e93ecf1c699ef054d2b179b10976fa23f3Timo Sirainen const char *max_size = mail_user_plugin_getenv(user,
c73415e93ecf1c699ef054d2b179b10976fa23f3Timo Sirainen "quota_max_mail_size");
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (settings_get_size(max_size, "a_set->max_mail_size,
76b4207273534f71365bc7f900c23a5160692802Timo Sirainen *error_r = t_strdup_printf("quota_max_mail_size: %s",
76b4207273534f71365bc7f900c23a5160692802Timo Sirainen if (i_strocpy(root_name, "quota", sizeof(root_name)) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen for (i = 2;; i++) {
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen env = mail_user_plugin_getenv(user, root_name);
8d25b6ad05b99e75613cb045a121efd51e6afbb6Timo Sirainen if (quota_root_add(quota_set, user, env, root_name,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen *error_r = t_strdup_printf("Invalid quota root %s: %s",
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (i_snprintf(root_name, sizeof(root_name), "quota%d", i) < 0)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenvoid quota_settings_deinit(struct quota_settings **_quota_set)
8bf42ce5ef783b96a2ded67524173e95e9b45adaTimo Sirainen struct quota_settings *quota_set = *_quota_set;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenstatic void quota_root_deinit(struct quota_root *root)
a75d470c9223a75801418fcdda258885c36317e0Timo Sirainenint quota_root_default_init(struct quota_root *root, const char *args,
a75d470c9223a75801418fcdda258885c36317e0Timo Sirainen const char **error_r)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen const char *const *tmp;
3954326e793bdef1e94e0ad781ed6cc7e48beebbTimo Sirainen else if (strcmp(*tmp, "ignoreunlimited") == 0)
3c63c219ae7854b4f1d44a671a65572aa242cbcfTimo Sirainen "Unknown parameter for backend %s: %s",
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenquota_root_init(struct quota_root_settings *root_set, struct quota *quota,
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen struct quota_root **root_r, const char **error_r)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen root->pool = pool_alloconly_create("quota root", 512);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen root->bytes_limit = root_set->default_rule.bytes_limit;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen root->count_limit = root_set->default_rule.count_limit;
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen array_create(&root->quota_module_contexts, root->pool,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen sizeof(void *), 10);
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen if (root->backend.v.init(root, root_set->args, error_r) < 0) {
b141c303bf09b6ae43e1eb4aac1e1a6b796b9d35Timo Sirainen *error_r = t_strdup_printf("%s quota init failed: %s",
b141c303bf09b6ae43e1eb4aac1e1a6b796b9d35Timo Sirainen if (quota_root_default_init(root, root_set->args, error_r) < 0)
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen if (root_set->default_rule.bytes_limit == 0 &&
b141c303bf09b6ae43e1eb4aac1e1a6b796b9d35Timo Sirainenint quota_init(struct quota_settings *quota_set, struct mail_user *user,
b141c303bf09b6ae43e1eb4aac1e1a6b796b9d35Timo Sirainen unsigned int i, count;
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen root_sets = array_get("a_set->root_sets, &count);
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen for (i = 0; i < count; i++) {
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen ret = quota_root_init(root_sets[i], quota, &root, &error);
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen *error_r = t_strdup_printf("Quota root %s: %s",
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen unsigned int i, count;
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen for (i = 0; i < count; i++)
e5ff2112aea089f3de2badf9b1635677791d1384Timo Sirainen /* deinit quota roots before setting quser->quota=NULL */
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainenstatic int quota_root_get_rule_limits(struct quota_root *root,
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen /* if default rule limits are 0, user has unlimited quota.
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen ignore any specific quota rules */
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen enabled = bytes_limit != 0 || count_limit != 0;
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen (void)mail_namespace_find_unalias(root->quota->user->namespaces,
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen rule = enabled ? quota_root_rule_find(root->set, mailbox_name) : NULL;
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen *bytes_limit_r = bytes_limit <= 0 ? 0 : bytes_limit;
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen *count_limit_r = count_limit <= 0 ? 0 : count_limit;
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainenquota_is_duplicate_namespace(struct quota *quota, struct mail_namespace *ns)
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen unsigned int i, count;
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen namespaces = array_get("a->namespaces, &count);
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen for (i = 0; i < count; i++) {
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen if (mailbox_list_get_root_path(namespaces[i]->list,
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen /* duplicate path */
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) == 0)
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen /* this is inbox=yes namespace, but the earlier one
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen that had the same location was inbox=no. we need to
b5052fbfdbc2678cc8f12899afe55c998f43b740Timo Sirainen include the INBOX also in quota calculations, so we
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen can't just ignore this namespace. but since we've
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen already called backend's namespace_added(), we can't
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen just remove it either. so just mark the old one as
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen unwanted namespace.
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen an alternative would be to do a bit larger change so
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen namespaces wouldn't be added until
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen mail_namespaces_created() hook is called */
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainenvoid quota_add_user_namespace(struct quota *quota, struct mail_namespace *ns)
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen unsigned int i, j, count;
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen /* first check if there already exists a namespace with the exact same
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen path. we don't want to count them twice. */
262eeae35ee285981b37294628ec8d054daa1b23Timo Sirainen /* @UNSAFE: get different backends into one array */
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen backends = t_new(struct quota_backend *, count + 1);
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen for (i = 0; i < count; i++) {
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen if (backends[j]->name == roots[i]->backend.name)
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainenvoid quota_remove_user_namespace(struct mail_namespace *ns)
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen unsigned int i, count;
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen /* no quota for this namespace */
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen namespaces = array_get("a->namespaces, &count);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen for (i = 0; i < count; i++) {
1f366614aaafcc9496ff85b25988f19c3254ab7cTimo Sirainen quota_get_mail_user_quota(box->list->ns->owner) :
1f366614aaafcc9496ff85b25988f19c3254ab7cTimo Sirainen quota_get_mail_user_quota(box->list->ns->user);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenbool quota_root_is_namespace_visible(struct quota_root *root,
efd9d73a7fba2830431aa1186fd65372f6631399Timo Sirainen /* this check works as long as there is only one storage per list */
4307c886579381dbb1897ea1388ae6978c96f560Timo Sirainen if (mailbox_list_get_storage(&list, "", &storage) == 0 &&
efd9d73a7fba2830431aa1186fd65372f6631399Timo Sirainen (storage->class_flags & MAIL_STORAGE_CLASS_FLAG_NOQUOTA) != 0)
4307c886579381dbb1897ea1388ae6978c96f560Timo Sirainenquota_root_is_visible(struct quota_root *root, struct mailbox *box,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen /* we don't want to include this root in quota enforcing */
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (!quota_root_is_namespace_visible(root, box->list->ns))
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen /* a single quota root: don't bother checking further */
3954326e793bdef1e94e0ad781ed6cc7e48beebbTimo Sirainen return root->backend.v.match_box == NULL ? TRUE :
8bf42ce5ef783b96a2ded67524173e95e9b45adaTimo Sirainenstruct quota_root *quota_root_iter_next(struct quota_root_iter *iter)
661998e2ccd772ad92a9d4a75cb712692a8c94b3Timo Sirainen struct quota_root *const *roots, *root = NULL;
8bf42ce5ef783b96a2ded67524173e95e9b45adaTimo Sirainen unsigned int count;
3954326e793bdef1e94e0ad781ed6cc7e48beebbTimo Sirainen roots = array_get(&iter->quota->roots, &count);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen if (!quota_root_is_visible(roots[iter->i], iter->box, FALSE))
iter->i++;
return root;
unsigned int i, count;
return NULL;
for (i = 0; i < count; i++) {
return roots[i];
return NULL;
int ret;
if (ret <= 0)
return ret;
&ignored) < 0)
*limit_r = 0;
if (kilobytes) {
return ctx;
const char *mailbox_name;
unsigned int i, count;
int ret;
for (i = 0; i < count; i++) {
&ignored) < 0) {
if (!ignored)
if (bytes_limit > 0) {
if (ret > 0) {
} else if (ret < 0) {
if (count_limit > 0) {
if (ret > 0) {
} else if (ret < 0) {
args++;
error);
unsigned int i, count;
const char *reason;
if (count == 0)
bytes_before = 0;
count_before = 0;
for (i = 0; i < count; i++) {
&reason)) {
unsigned int i, count;
const char *mailbox_name;
int ret = 0;
(void)mail_namespace_find_unalias(
for (i = 0; i < count; i++) {
} T_END;
return ret;
const char **quota_over_script_r,
const char **quota_over_flag_r,
bool *status_r)
return FALSE;
return FALSE;
return TRUE;
const char *const *resources;
bool quota_over_status;
int ret;
if (ret < 0) {
resources[i]);
(unsigned long long)value,
(unsigned long long)limit);
unsigned int i, count;
const char *name;
for (i = 0; i < count; i++) {
return QUOTA_ALLOC_RESULT_TEMPFAIL;
return QUOTA_ALLOC_RESULT_OK;
return QUOTA_ALLOC_RESULT_OK;
return QUOTA_ALLOC_RESULT_TEMPFAIL;
return ret;
return QUOTA_ALLOC_RESULT_OK;
return QUOTA_ALLOC_RESULT_TEMPFAIL;
return QUOTA_ALLOC_RESULT_TEMPFAIL;
return QUOTA_ALLOC_RESULT_OVER_MAXSIZE;
return QUOTA_ALLOC_RESULT_OK;
unsigned int i, count;
bool ignore;
int ret;
return QUOTA_ALLOC_RESULT_OK;
for (i = 0; i < count; i++) {
&ignore);
if (ret < 0)
return QUOTA_ALLOC_RESULT_TEMPFAIL;
return QUOTA_ALLOC_RESULT_OVER_QUOTA;