<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>

                    Often Misused: File System(umask)

                    ABSTRACT

                    由參數 umask() 指定的掩碼常常很容易與 chmod() 的參數混淆。

                    EXPLANATION

                    umask() man page 以錯誤的指令開始:

                    "umask sets the umask to mask & 0777"

                    盡管這種行為可以更好地遵從 chmod() 的用法,這種情況下,由用戶提供的參數指定在特定文件上啟用的位數,但事實上 umask() 的行為恰恰相反:umask() 將 umask 設為 ~mask & 0777

                    umask() man page 接下來描述了 umask() 的正確使用方法:

                    open() 用 umask 為新建文件設置初始化權限。具體的說,它會關閉 umask 從 mode 參數傳遞到 open(2)的權限(例如,umask 的通用默認值 022 會導致以權限 0666 & ~022 = 0644 = rw-r--r-- 創建新文件,而在正常情況下,mode 應該為 0666)。”

                    REFERENCES

                    [1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A5 Buffer Overflow

                    [2] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3590.1 CAT I

                    [3] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3590.1 CAT I

                    [4] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 249, CWE ID 560

                    [5] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.1

                    [6] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.2

                    [7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.5


                    Copyright 2013 Fortify Software - All rights reserved.
                    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
                    desc.semantic.cpp.often_misused_file_system.umask

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频