Consistentency with RLIMIT_* constant name
authorEli Zrihen <ezrihen@gmail.com>
Tue, 20 Jul 2021 12:20:47 +0000 (15:20 +0300)
committerEli Zrihen <ezrihen@gmail.com>
Tue, 20 Jul 2021 12:20:47 +0000 (15:20 +0300)
cmdline.cc
config.cc
config.proto

index 79b1053a0d72ac09c6ad5dbd986baf69ef5d8bbc..91a3662703f26f187800116a7b89a780684f2909 100644 (file)
@@ -109,9 +109,9 @@ struct custom_option custom_opts[] = {
     { { "rlimit_nofile", required_argument, NULL, 0x0205 }, "RLIMIT_NOFILE, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 32)" },
     { { "rlimit_nproc", required_argument, NULL, 0x0206 }, "RLIMIT_NPROC, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 'soft')" },
     { { "rlimit_stack", required_argument, NULL, 0x0207 }, "RLIMIT_STACK in MB, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 'soft')" },
-    { { "rlimit_mlock", required_argument, NULL, 0x0209 }, "RLIMIT_MEMLOCK in KB, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 'soft')" },
-    { { "rlimit_rtpr", required_argument, NULL, 0x0210 }, "RLIMIT_RTPRIO, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 0)" },
-    { { "rlimit_msgq", required_argument, NULL, 0x0211 }, "RLIMIT_MSGQUEUE in bytes, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 128)" },
+    { { "rlimit_memlock", required_argument, NULL, 0x0209 }, "RLIMIT_MEMLOCK in KB, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 'soft')" },
+    { { "rlimit_rtprio", required_argument, NULL, 0x0210 }, "RLIMIT_RTPRIO, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 0)" },
+    { { "rlimit_msgqueue", required_argument, NULL, 0x0211 }, "RLIMIT_MSGQUEUE in bytes, 'max' or 'hard' for the current hard limit, 'def' or 'soft' for the current soft limit, 'inf' for RLIM64_INFINITY (default: 128)" },
     { { "disable_rlimits", no_argument, NULL, 0x0208 }, "Disable all rlimits, default to limits set by parent" },
     { { "persona_addr_compat_layout", no_argument, NULL, 0x0301 }, "personality(ADDR_COMPAT_LAYOUT)" },
     { { "persona_mmap_page_zero", no_argument, NULL, 0x0302 }, "personality(MMAP_PAGE_ZERO)" },
index 2b84ae45364d2debd42a9c4187497bbcc3009dcd..40b742591de4056dfa8f219004bfee6ed6f9569e 100644 (file)
--- a/config.cc
+++ b/config.cc
@@ -159,9 +159,9 @@ static bool configParseInternal(nsjconf_t* nsjconf, const nsjail::NsJailConfig&
        nsjconf->rl_stack = configRLimit(
            RLIMIT_STACK, njc.rlimit_stack_type(), njc.rlimit_stack(), 1024UL * 1024UL);
        nsjconf->rl_mlock = configRLimit(
-           RLIMIT_MEMLOCK, njc.rlimit_mlock_type(), njc.rlimit_mlock(), 1024UL);
-       nsjconf->rl_rtpr = configRLimit(RLIMIT_RTPRIO, njc.rlimit_rtpr_type(), njc.rlimit_rtpr());
-       nsjconf->rl_msgq = configRLimit(RLIMIT_MSGQUEUE, njc.rlimit_msgq_type(), njc.rlimit_msgq());
+           RLIMIT_MEMLOCK, njc.rlimit_memlock_type(), njc.rlimit_memlock(), 1024UL);
+       nsjconf->rl_rtpr = configRLimit(RLIMIT_RTPRIO, njc.rlimit_rtprio_type(), njc.rlimit_rtprio());
+       nsjconf->rl_msgq = configRLimit(RLIMIT_MSGQUEUE, njc.rlimit_msgqueue_type(), njc.rlimit_msgqueue());
 
        nsjconf->disable_rl = njc.disable_rl();
 
index 54f2e7024c926b9dc6d2b7e516bd9ac119d7f1e3..f803e09a4bb0997e08e27ffa39170bb28be15745 100644 (file)
@@ -158,12 +158,12 @@ message NsJailConfig {
     optional uint64 rlimit_stack = 40 [default = 8];
     optional RLimit rlimit_stack_type = 41 [default = SOFT];
     /* In KB, use the soft limit value by default */
-    optional uint64 rlimit_mlock = 88 [default = 64];
-    optional RLimit rlimit_mlock_type = 89 [default = SOFT];
-    optional uint64 rlimit_rtpr =  90 [default = 0];
-    optional RLimit rlimit_rtpr_type = 91 [default = VALUE];
-    optional uint64 rlimit_msgq =  92 [default = 1024];
-    optional RLimit rlimit_msgq_type = 93 [default = VALUE];
+    optional uint64 rlimit_memlock = 88 [default = 64];
+    optional RLimit rlimit_memlock_type = 89 [default = SOFT];
+    optional uint64 rlimit_rtprio =  90 [default = 0];
+    optional RLimit rlimit_rtprio_type = 91 [default = VALUE];
+    optional uint64 rlimit_msgqueue =  92 [default = 1024];
+    optional RLimit rlimit_msgqueue_type = 93 [default = VALUE];
 
     /* Disable all rlimits, default to limits set by parent */
     optional bool disable_rl = 84 [default = false];