संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
3. सीमाएं अडजस्ट करें
सैंडबॉक्स नीति, सैंडबॉक्स को खास सिस्टम कॉल करने से रोकती है. इस तरह, वह हमले की सरफ़ेस को कम करती है. हालांकि, कोई हमलावर किसी प्रोसेस को हमेशा के लिए चलाकर, अनचाहे असर डाल सकता है. इसके अलावा, वह रैम और अन्य संसाधनों को खत्म कर सकता है.
इस जोखिम का समाधान करने के लिए, Sandboxee डिफ़ॉल्ट रूप से सख्त निष्पादन सीमाओं के तहत काम करता है. अगर इन डिफ़ॉल्ट सीमाओं की वजह से आपके प्रोग्राम को सही तरीके से पूरा करने में समस्याएं आती हैं, तो आपके पास sandbox2::Limits
क्लास का इस्तेमाल करके, एक्सक्यूटर ऑब्जेक्ट पर limits()
को कॉल करके इनमें बदलाव करने का विकल्प होता है.
नीचे दिया गया कोड स्निपेट, सीमा को घटाने या बढ़ाने के कुछ उदाहरण दिखाता है. सभी उपलब्ध विकल्पों को limits.h हेडर फ़ाइल में शामिल किया गया है.
// Restrict the address space size of the sandboxee to 4 GiB.
executor->limits()->set_rlimit_as(4ULL << 30);
// Kill sandboxee with SIGXFSZ if it writes more than 1 GiB to the filesystem.
executor->limits()->set_rlimit_fsize(1ULL << 30);
// Number of file descriptors which can be used by the sandboxee.
executor->limits()->set_rlimit_nofile(1ULL << 10);
// The sandboxee is not allowed to create core files.
executor->limits()->set_rlimit_core(0);
// Maximum 300s of real CPU time.
executor->limits()->set_rlimit_cpu(300);
// Maximum 120s of wall time.
executor->limits()->set_walltime_limit(absl::Seconds(120));
sandbox2::Limits
क्लास के इस्तेमाल के उदाहरण के लिए, टूल का उदाहरण देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2023-12-06 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2023-12-06 (UTC) को अपडेट किया गया."],[[["Sandboxee execution is restricted by default to minimize potential harm from malicious code."],["Sandbox2 provides the `Limits` class to adjust resource limits like address space size, file size, and CPU time, allowing customization for specific program needs."],["Developers can fine-tune resource constraints using methods like `set_rlimit_as` or `set_rlimit_cpu` for more control over the Sandboxee's behavior."],["Refer to the `limits.h` header file for detailed documentation on all available limit options and their functionalities."]]],[]]