]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: fix array sizes for capability map
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 22 May 2017 02:26:16 +0000 (02:26 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 22 May 2017 02:32:12 +0000 (02:32 +0000)
incorrect array sizes causing out of bounds read and potentially
incorrect capability settings

introduced in 1b322039

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/privs.c

index decd4bb7db94319d81d1078e745fe46d08b342b2..c25310c8d3a8ce60086fe0c18e9c16a19a317703 100644 (file)
@@ -105,7 +105,7 @@ static struct
 #ifdef HAVE_LCAPS /* Quagga -> Linux capabilities mappings */
   [ZCAP_SETID] =       { 2, (pvalue_t []) { CAP_SETGID,
                                              CAP_SETUID                }, },
-  [ZCAP_BIND] =                { 2, (pvalue_t []) { CAP_NET_BIND_SERVICE       }, },
+  [ZCAP_BIND] =                { 1, (pvalue_t []) { CAP_NET_BIND_SERVICE       }, },
   [ZCAP_NET_ADMIN] =   { 1, (pvalue_t []) { CAP_NET_ADMIN              }, },
   [ZCAP_NET_RAW] =     { 1, (pvalue_t []) { CAP_NET_RAW                }, },
   [ZCAP_CHROOT] =      { 1, (pvalue_t []) { CAP_SYS_CHROOT,            }, },
@@ -130,7 +130,7 @@ static struct
   [ZCAP_CHROOT] =      { 1, (pvalue_t []) { PRIV_PROC_CHROOT           }, },
   [ZCAP_NICE] =        { 1, (pvalue_t []) { PRIV_PROC_PRIOCNTL         }, },
   [ZCAP_PTRACE] =      { 1, (pvalue_t []) { PRIV_PROC_SESSION          }, },
-  [ZCAP_DAC_OVERRIDE] = { 2, (pvalue_t []) { PRIV_FILE_DAC_EXECUTE, 
+  [ZCAP_DAC_OVERRIDE] = { 5, (pvalue_t []) { PRIV_FILE_DAC_EXECUTE,
                                              PRIV_FILE_DAC_READ,
                                              PRIV_FILE_DAC_SEARCH,
                                              PRIV_FILE_DAC_WRITE,