Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: audit OPT_INT/OPT_UINT and handle incorrect signed uint #10835

Closed
wants to merge 24 commits into from

Conversation

oliveiradan
Copy link
Contributor

Changes proposed to address issue: BUG #14934
http://tracker.ceph.com/issues/14934

Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
… only

Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
@ghost
Copy link

ghost commented Nov 23, 2016

needs rebasing

@liewegas
Copy link
Member

needs rebase

@@ -480,7 +480,7 @@ int main(int argc, const char **argv)
<< std::endl;
exit(-err);
}
if (stats.avail_percent <= g_conf->mon_data_avail_crit) {
if (static_cast<uint32_t>(stats.avail_percent) <= g_conf->mon_data_avail_crit) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -946,83 +952,177 @@ int md_config_t::set_val_impl(const char *val, const config_option *opt)

int md_config_t::set_val_raw(const char *val, const config_option *opt)
{
const int CEPH_SETTING_SAFE = 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliveiradan Why local variable is taken as caps?
Conventionally we take macros as this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitkumar50 , that was when I started working on Ceph (that's an old PR) and I used it as a way to identify a constant. However, as it ended up getting old and a rebase was needed, I ended up not touching it (once it is a pretty big change) 'till we were certain this PR would still be useful or not. Should this PR still be interesting, I will rebase and rework whatever is needed.

Thanks,

@liewegas
Copy link
Member

This is obsolete with the new options framework. What we probably want instead is to translate this into min/max values in options.cc

@liewegas liewegas closed this Sep 13, 2017
@oliveiradan oliveiradan deleted the wip-14934 branch December 10, 2018 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants