lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
September 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
11 participants
255 discussions
Start a n
N
ew thread
Testcommit
by Lars Michelsen
Module: check_mk Branch: master Commit: 78a504fa8ca62396f9634982333fe7bf6edc3765 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=78a504fa8ca623…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Sep 1 11:53:39 2017 +0200 Testcommit Change-Id: Ib9efc440c412f3060e7aced9cdb631c1a598f1a9 --- ChangeLog.in | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.in b/ChangeLog.in index 0eba577..3ba7a5b 100644 --- a/ChangeLog.in +++ b/ChangeLog.in @@ -4802,3 +4802,4 @@ * setup.sh does not overwrite check_mk.cfg but installs the new default file as check_mk.cfg-1.0.19 * Put hosts into default hostgroup if none is configured +
7 years, 3 months
1
0
0
0
Testcommit
by Lars Michelsen
Module: check_mk Branch: master Commit: 6695cbedccbef0bd817c149d92736b64955824d9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6695cbedccbef0…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Sep 1 11:54:01 2017 +0200 Testcommit Change-Id: I48d923b8ffa1ae694a0aad707b16e924cc3a979e --- ChangeLog.in | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.in b/ChangeLog.in index 3ba7a5b..0eba577 100644 --- a/ChangeLog.in +++ b/ChangeLog.in @@ -4802,4 +4802,3 @@ * setup.sh does not overwrite check_mk.cfg but installs the new default file as check_mk.cfg-1.0.19 * Put hosts into default hostgroup if none is configured -
7 years, 3 months
1
0
0
0
python-ad: Fix precompiled yacc table module
by Lars Michelsen
Module: check_mk Branch: master Commit: a8e0ab68c053d0ae41e90863d33bd4f4dd14364f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8e0ab68c053d0…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Sep 1 11:29:33 2017 +0200 python-ad: Fix precompiled yacc table module Change-Id: I7493a4262da4efa537e60257ba21e40ca6ef5c49 --- .../patches/0011-python-ad-fix-ldapfilter_tab.dif | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/omd/packages/python-modules/patches/0011-python-ad-fix-ldapfilter_tab.dif b/omd/packages/python-modules/patches/0011-python-ad-fix-ldapfilter_tab.dif new file mode 100644 index 0000000..dcb1d00 --- /dev/null +++ b/omd/packages/python-modules/patches/0011-python-ad-fix-ldapfilter_tab.dif @@ -0,0 +1,69 @@ +diff -Nur dest/python-ad-0.9.orig/lib/ad/protocol/ldapfilter_tab.py dest/python-ad-0.9/lib/ad/protocol/ldapfilter_tab.py +--- dest/python-ad-0.9.orig/lib/ad/protocol/ldapfilter_tab.py 2008-11-02 14:42:22.000000000 +0100 ++++ dest/python-ad-0.9/lib/ad/protocol/ldapfilter_tab.py 2017-09-01 11:27:31.790588493 +0200 +@@ -1,42 +1,43 @@ + + # ldapfilter_tab.py + # This file is automatically generated. Do not edit. ++_tabversion = '3.10' + + _lr_method = 'LALR' + +-_lr_signature = 'o;C\x91;G\xcc[\x06G;\xa3\xa3R\xb9\x14' +- ++_lr_signature = 'LPAREN RPAREN EQUALS AND OR NOT LTE GTE APPROX PRESENT STRINGfilter : LPAREN and RPAREN\n | LPAREN or RPAREN\n | LPAREN not RPAREN\n | LPAREN item RPAREN\n and : AND filterlistor : OR filterlistnot : NOT filterfilterlist : filter\n | filter filterlist\n item : STRING EQUALS STRING\n | STRING LTE STRING\n | STRING GTE STRING\n | STRING APPROX STRING\n | STRING PRESENT\n ' ++ + _lr_action_items = {'AND':([2,],[4,]),'APPROX':([5,],[14,]),'RPAREN':([3,7,9,10,11,12,13,18,19,20,21,22,23,24,25,26,27,28,],[11,20,22,23,-1,-5,-8,-14,-6,-4,-7,-3,-2,-9,-13,-12,-10,-11,]),'STRING':([2,14,15,16,17,],[5,25,26,27,28,]),'LTE':([5,],[17,]),'GTE':([5,],[15,]),'EQUALS':([5,],[16,]),'LPAREN':([0,4,6,8,11,13,20,22,23,],[2,2,2,2,-1,2,-4,-3,-2,]),'NOT':([2,],[8,]),'OR':([2,],[6,]),'PRESENT':([5,],[18,]),'$end':([1,11,20,22,23,],[0,-1,-4,-3,-2,]),} + +-_lr_action = { } ++_lr_action = {} + for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): +- if not _lr_action.has_key(_x): _lr_action[_x] = { } ++ if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y + del _lr_action_items + + _lr_goto_items = {'and':([2,],[3,]),'filterlist':([4,6,13,],[12,19,24,]),'filter':([0,4,6,8,13,],[1,13,13,21,13,]),'item':([2,],[7,]),'not':([2,],[9,]),'or':([2,],[10,]),} + +-_lr_goto = { } ++_lr_goto = {} + for _k, _v in _lr_goto_items.items(): +- for _x,_y in zip(_v[0],_v[1]): +- if not _lr_goto.has_key(_x): _lr_goto[_x] = { } ++ for _x, _y in zip(_v[0], _v[1]): ++ if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y + del _lr_goto_items + _lr_productions = [ +- ("S'",1,None,None,None), +- ('filter',3,'p_filter','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',108), +- ('filter',3,'p_filter','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',109), +- ('filter',3,'p_filter','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',110), +- ('filter',3,'p_filter','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',111), +- ('and',2,'p_and','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',116), +- ('or',2,'p_or','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',120), +- ('not',2,'p_not','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',124), +- ('filterlist',1,'p_filterlist','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',128), +- ('filterlist',2,'p_filterlist','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',129), +- ('item',3,'p_item','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',137), +- ('item',3,'p_item','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',138), +- ('item',3,'p_item','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',139), +- ('item',3,'p_item','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',140), +- ('item',2,'p_item','/home/geertj/Projects/python-ad/lib/ad/protocol/ldapfilter.py',141), ++ ("S' -> filter","S'",1,None,None,None), ++ ('filter -> LPAREN and RPAREN','filter',3,'p_filter','ldapfilter.py',108), ++ ('filter -> LPAREN or RPAREN','filter',3,'p_filter','ldapfilter.py',109), ++ ('filter -> LPAREN not RPAREN','filter',3,'p_filter','ldapfilter.py',110), ++ ('filter -> LPAREN item RPAREN','filter',3,'p_filter','ldapfilter.py',111), ++ ('and -> AND filterlist','and',2,'p_and','ldapfilter.py',116), ++ ('or -> OR filterlist','or',2,'p_or','ldapfilter.py',120), ++ ('not -> NOT filter','not',2,'p_not','ldapfilter.py',124), ++ ('filterlist -> filter','filterlist',1,'p_filterlist','ldapfilter.py',128), ++ ('filterlist -> filter filterlist','filterlist',2,'p_filterlist','ldapfilter.py',129), ++ ('item -> STRING EQUALS STRING','item',3,'p_item','ldapfilter.py',137), ++ ('item -> STRING LTE STRING','item',3,'p_item','ldapfilter.py',138), ++ ('item -> STRING GTE STRING','item',3,'p_item','ldapfilter.py',139), ++ ('item -> STRING APPROX STRING','item',3,'p_item','ldapfilter.py',140), ++ ('item -> STRING PRESENT','item',2,'p_item','ldapfilter.py',141), + ]
7 years, 3 months
1
0
0
0
Make access of column data const-correct.
by Sven Panne
Module: check_mk Branch: master Commit: 3e6e484d4b640ae1f7fc660a3306193031f4c71e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e6e484d4b640a…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Sep 1 09:35:17 2017 +0200 Make access of column data const-correct. This is an important step: The compiler statically verifies that the Livestatus threads don't accidentally modify the contents of table columns. Change-Id: Ib5a21f41b49fbb6c793f2c007d222de474c8a6f7 --- livestatus/src/Column.h | 4 ++-- livestatus/src/CommentColumn.cc | 5 +++-- livestatus/src/DowntimeColumn.cc | 5 +++-- livestatus/src/OffsetStringHostMacroColumn.cc | 4 ++-- livestatus/src/OffsetStringHostMacroColumn.h | 4 ++-- livestatus/src/OffsetStringServiceMacroColumn.cc | 4 ++-- livestatus/src/OffsetStringServiceMacroColumn.h | 4 ++-- livestatus/src/TableColumns.cc | 4 ++-- livestatus/src/TableColumns.h | 4 ++-- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/livestatus/src/Column.h b/livestatus/src/Column.h index 1d51a10..a1494dc 100644 --- a/livestatus/src/Column.h +++ b/livestatus/src/Column.h @@ -55,8 +55,8 @@ public: std::string description() const { return _description; } template <typename T> - T *columnData(Row row) const { - return static_cast<T *>(shiftPointer(row)); + const T *columnData(Row row) const { + return static_cast<const T *>(shiftPointer(row)); } virtual ColumnType type() const = 0; diff --git a/livestatus/src/CommentColumn.cc b/livestatus/src/CommentColumn.cc index 914ffb9..f7074f7 100644 --- a/livestatus/src/CommentColumn.cc +++ b/livestatus/src/CommentColumn.cc @@ -87,9 +87,10 @@ vector<CommentData> CommentColumn::comments_for_row(Row row) const { if (auto data = columnData<void>(row)) { return _is_service ? _mc->comments_for_service( - reinterpret_cast<MonitoringCore::Service *>(data)) + reinterpret_cast<const MonitoringCore::Service *>( + data)) : _mc->comments_for_host( - reinterpret_cast<MonitoringCore::Host *>(data)); + reinterpret_cast<const MonitoringCore::Host *>(data)); } return {}; } diff --git a/livestatus/src/DowntimeColumn.cc b/livestatus/src/DowntimeColumn.cc index 8c096e6..a36d0cc 100644 --- a/livestatus/src/DowntimeColumn.cc +++ b/livestatus/src/DowntimeColumn.cc @@ -81,9 +81,10 @@ vector<DowntimeData> DowntimeColumn::downtimes_for_row(Row row) const { if (auto data = columnData<void>(row)) { return _is_service ? _mc->downtimes_for_service( - reinterpret_cast<MonitoringCore::Service *>(data)) + reinterpret_cast<const MonitoringCore::Service *>( + data)) : _mc->downtimes_for_host( - reinterpret_cast<MonitoringCore::Host *>(data)); + reinterpret_cast<const MonitoringCore::Host *>(data)); } return {}; } diff --git a/livestatus/src/OffsetStringHostMacroColumn.cc b/livestatus/src/OffsetStringHostMacroColumn.cc index a079a08..34efd80 100644 --- a/livestatus/src/OffsetStringHostMacroColumn.cc +++ b/livestatus/src/OffsetStringHostMacroColumn.cc @@ -25,10 +25,10 @@ #include "OffsetStringHostMacroColumn.h" #include "Row.h" -host *OffsetStringHostMacroColumn::getHost(Row row) const { +const host *OffsetStringHostMacroColumn::getHost(Row row) const { return columnData<host>(row); } -service *OffsetStringHostMacroColumn::getService(Row /*unused*/) const { +const service *OffsetStringHostMacroColumn::getService(Row /*unused*/) const { return nullptr; } diff --git a/livestatus/src/OffsetStringHostMacroColumn.h b/livestatus/src/OffsetStringHostMacroColumn.h index f144f9e..32eef88 100644 --- a/livestatus/src/OffsetStringHostMacroColumn.h +++ b/livestatus/src/OffsetStringHostMacroColumn.h @@ -39,8 +39,8 @@ public: int extra_extra_offset) : OffsetStringMacroColumn(name, description, offset, indirect_offset, extra_offset, extra_extra_offset) {} - host *getHost(Row row) const override; - service *getService(Row row) const override; + const host *getHost(Row row) const override; + const service *getService(Row row) const override; }; #endif // OffsetStringHostMacroColumn_h diff --git a/livestatus/src/OffsetStringServiceMacroColumn.cc b/livestatus/src/OffsetStringServiceMacroColumn.cc index f5c53ae..865774d 100644 --- a/livestatus/src/OffsetStringServiceMacroColumn.cc +++ b/livestatus/src/OffsetStringServiceMacroColumn.cc @@ -25,13 +25,13 @@ #include "OffsetStringServiceMacroColumn.h" #include "Row.h" -host *OffsetStringServiceMacroColumn::getHost(Row row) const { +const host *OffsetStringServiceMacroColumn::getHost(Row row) const { if (auto svc = getService(row)) { return svc->host_ptr; } return nullptr; } -service *OffsetStringServiceMacroColumn::getService(Row row) const { +const service *OffsetStringServiceMacroColumn::getService(Row row) const { return columnData<service>(row); } diff --git a/livestatus/src/OffsetStringServiceMacroColumn.h b/livestatus/src/OffsetStringServiceMacroColumn.h index 9e31e08..0a162fc 100644 --- a/livestatus/src/OffsetStringServiceMacroColumn.h +++ b/livestatus/src/OffsetStringServiceMacroColumn.h @@ -39,8 +39,8 @@ public: int extra_extra_offset) : OffsetStringMacroColumn(name, description, offset, indirect_offset, extra_offset, extra_extra_offset) {} - host *getHost(Row row) const override; - service *getService(Row row) const override; + const host *getHost(Row row) const override; + const service *getService(Row row) const override; }; #endif // OffsetStringServiceMacroColumn_h diff --git a/livestatus/src/TableColumns.cc b/livestatus/src/TableColumns.cc index 49fc726..a26d409 100644 --- a/livestatus/src/TableColumns.cc +++ b/livestatus/src/TableColumns.cc @@ -62,7 +62,7 @@ void TableColumns::answerQuery(Query *query) { } } -string TableColumns::getValue(Column *column, +string TableColumns::getValue(const Column *column, ColumnsColumn::Type colcol) const { static const char *typenames[8] = {"int", "float", "string", "list", "time", "dict", "blob", "null"}; @@ -80,7 +80,7 @@ string TableColumns::getValue(Column *column, return ""; } -string TableColumns::tableNameOf(Column *column) const { +string TableColumns::tableNameOf(const Column *column) const { for (auto table : _tables) { if (table->any_column( [&](shared_ptr<Column> c) { return c.get() == column; })) { diff --git a/livestatus/src/TableColumns.h b/livestatus/src/TableColumns.h index 750a8ef..ef4b5f0 100644 --- a/livestatus/src/TableColumns.h +++ b/livestatus/src/TableColumns.h @@ -45,8 +45,8 @@ public: void answerQuery(Query *query) override; void addTable(Table *); - std::string getValue(Column *column, ColumnsColumn::Type colcol) const; - std::string tableNameOf(Column *column) const; + std::string getValue(const Column *column, ColumnsColumn::Type colcol) const; + std::string tableNameOf(const Column *column) const; }; #endif // TableColumns_h
7 years, 3 months
1
0
0
0
Make access of row data const-correct.
by Sven Panne
Module: check_mk Branch: master Commit: 39643f27f6339e442a5d24258462f4c953e1f9bb URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=39643f27f6339e…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Sep 1 09:53:39 2017 +0200 Make access of row data const-correct. Again, this is an important step: The compiler statically verifies that the Livestatus threads don't accidentally modify the contents of table rows. Change-Id: Ifeb9d5bb882113f4434ba1ace6dcb73fdd5c5279 --- livestatus/src/Column.cc | 15 ++++++++------- livestatus/src/Column.h | 2 +- livestatus/src/Row.h | 8 ++++---- livestatus/src/Table.h | 2 +- livestatus/src/TableColumns.h | 3 ++- livestatus/src/TableEventConsole.cc | 4 ++-- livestatus/src/TableEventConsole.h | 14 ++++++++------ livestatus/src/auth.cc | 13 +++++++------ livestatus/src/auth.h | 2 +- 9 files changed, 34 insertions(+), 29 deletions(-) diff --git a/livestatus/src/Column.cc b/livestatus/src/Column.cc index a0b14de..f8b7789 100644 --- a/livestatus/src/Column.cc +++ b/livestatus/src/Column.cc @@ -42,16 +42,17 @@ Column::Column(string name, string description, int indirect_offset, , _extra_extra_offset(extra_extra_offset) {} namespace { -void *shift(void *data, int offset) { - return (data == nullptr || offset < 0) ? data - : *offset_cast<void *>(data, offset); +const void *shift(const void *data, int offset) { + return (data == nullptr || offset < 0) + ? data + : *offset_cast<const void *>(data, offset); } } // namespace -void *Column::shiftPointer(Row row) const { - return shift( - shift(shift(row.rawData<void>(), _indirect_offset), _extra_offset), - _extra_extra_offset); +const void *Column::shiftPointer(Row row) const { + return shift(shift(shift(row.rawData<const void>(), _indirect_offset), + _extra_offset), + _extra_extra_offset); } unique_ptr<Filter> Column::createFilter(RelationalOperator /*unused*/, diff --git a/livestatus/src/Column.h b/livestatus/src/Column.h index a1494dc..749f9d2 100644 --- a/livestatus/src/Column.h +++ b/livestatus/src/Column.h @@ -81,7 +81,7 @@ private: int _extra_offset; int _extra_extra_offset; - void *shiftPointer(Row row) const; + const void *shiftPointer(Row row) const; }; #endif // Column_h diff --git a/livestatus/src/Row.h b/livestatus/src/Row.h index 507aee3..59401c2 100644 --- a/livestatus/src/Row.h +++ b/livestatus/src/Row.h @@ -30,18 +30,18 @@ class Row { public: // Here we basically forget the actual type of the row... - explicit Row(void *ptr) : _ptr(ptr) {} + explicit Row(const void *ptr) : _ptr(ptr) {} // ... and here we reconstruct it, hopefully in a correct way. :-/ template <typename T> - T *rawData() const { - return static_cast<T *>(_ptr); + const T *rawData() const { + return static_cast<const T *>(_ptr); } bool isNull() const { return _ptr == nullptr; } private: - void *_ptr; + const void *_ptr; }; #endif // Row_h diff --git a/livestatus/src/Table.h b/livestatus/src/Table.h index 56529fa..5ae2b60 100644 --- a/livestatus/src/Table.h +++ b/livestatus/src/Table.h @@ -94,7 +94,7 @@ public: virtual Row findObject(const std::string &objectspec); template <typename T> - T *rowData(Row row) const { + const T *rowData(Row row) const { return row.rawData<T>(); } diff --git a/livestatus/src/TableColumns.h b/livestatus/src/TableColumns.h index ef4b5f0..2ac5ce8 100644 --- a/livestatus/src/TableColumns.h +++ b/livestatus/src/TableColumns.h @@ -45,7 +45,8 @@ public: void answerQuery(Query *query) override; void addTable(Table *); - std::string getValue(const Column *column, ColumnsColumn::Type colcol) const; + std::string getValue(const Column *column, + ColumnsColumn::Type colcol) const; std::string tableNameOf(const Column *column) const; }; diff --git a/livestatus/src/TableEventConsole.cc b/livestatus/src/TableEventConsole.cc index 6b495a8..bded8c6 100644 --- a/livestatus/src/TableEventConsole.cc +++ b/livestatus/src/TableEventConsole.cc @@ -132,7 +132,7 @@ bool TableEventConsole::isAuthorizedForEvent(Row row, contact *ctc) { } bool TableEventConsole::isAuthorizedForEventViaContactGroups( - MonitoringCore::Contact *ctc, ECRow *row, bool &result) { + MonitoringCore::Contact *ctc, const ECRow *row, bool &result) { auto col = static_pointer_cast<ListEventConsoleColumn>( column("event_contact_groups")); if (col->isNone(row)) { @@ -148,7 +148,7 @@ bool TableEventConsole::isAuthorizedForEventViaContactGroups( } bool TableEventConsole::isAuthorizedForEventViaHost( - MonitoringCore::Contact *ctc, ECRow *row, bool &result) { + MonitoringCore::Contact *ctc, const ECRow *row, bool &result) { if (MonitoringCore::Host *hst = row->_host) { return (result = core()->host_has_contact(hst, ctc), true); } diff --git a/livestatus/src/TableEventConsole.h b/livestatus/src/TableEventConsole.h index 79acae7..1cc66b6 100644 --- a/livestatus/src/TableEventConsole.h +++ b/livestatus/src/TableEventConsole.h @@ -72,7 +72,7 @@ protected: const std::function<T(std::string)> &f) : _column(column), _default_value(default_value), _f(f) {} - std::string getRaw(ECRow *row) const { + std::string getRaw(const ECRow *row) const { return row == nullptr ? "" : row->_map.at(_column.name()); } @@ -157,9 +157,11 @@ protected: : mk::split(x.substr(1), '\001'); }) {} - bool isNone(ECRow *row) { return _ecc.getRaw(row) == "\002"; } + bool isNone(const ECRow *row) const { + return _ecc.getRaw(row) == "\002"; + } - _column_t getValue(Row row) { return _ecc.getValue(row); } + _column_t getValue(Row row) const { return _ecc.getValue(row); } void output(Row row, RowRenderer &r, const contact * /* auth_user */) const override { @@ -198,9 +200,9 @@ protected: private: bool isAuthorizedForEventViaContactGroups(MonitoringCore::Contact *ctc, - ECRow *row, bool &result); - bool isAuthorizedForEventViaHost(MonitoringCore::Contact *ctc, ECRow *row, - bool &result); + const ECRow *row, bool &result); + bool isAuthorizedForEventViaHost(MonitoringCore::Contact *ctc, + const ECRow *row, bool &result); }; #endif // TableEventConsole_h diff --git a/livestatus/src/auth.cc b/livestatus/src/auth.cc index 22a6410..a9b36c1 100644 --- a/livestatus/src/auth.cc +++ b/livestatus/src/auth.cc @@ -36,19 +36,20 @@ bool host_has_contact(const host *hst, const contact *ctc) { const_cast<contact *>(ctc)) != 0; } -bool service_has_contact(MonitoringCore *mc, const host *hst, service *svc, - const contact *ctc) { +bool service_has_contact(MonitoringCore *mc, const host *hst, + const service *svc, const contact *ctc) { // Older Nagios headers are not const-correct... :-P - return is_contact_for_service(svc, const_cast<contact *>(ctc)) != 0 || - is_escalated_contact_for_service(svc, const_cast<contact *>(ctc)) != - 0 || + return is_contact_for_service(const_cast<service *>(svc), + const_cast<contact *>(ctc)) != 0 || + is_escalated_contact_for_service(const_cast<service *>(svc), + const_cast<contact *>(ctc)) != 0 || (mc->serviceAuthorization() == AuthorizationKind::loose && host_has_contact(hst, ctc)); } } // namespace bool is_authorized_for(MonitoringCore *mc, const contact *ctc, const host *hst, - service *svc) { + const service *svc) { return ctc != unknown_auth_user() && (svc == nullptr ? host_has_contact(hst, ctc) : service_has_contact(mc, hst, svc, ctc)); diff --git a/livestatus/src/auth.h b/livestatus/src/auth.h index 15a25f3..1a10c66 100644 --- a/livestatus/src/auth.h +++ b/livestatus/src/auth.h @@ -43,7 +43,7 @@ inline contact *unknown_auth_user() { contact *unknown_auth_user(); class MonitoringCore; bool is_authorized_for(MonitoringCore *mc, const contact *ctc, const host *hst, - service *svc); + const service *svc); #endif #endif // auth_h
7 years, 3 months
1
0
0
0
← Newer
1
...
23
24
25
26
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Results per page:
10
25
50
100
200