Set proper level value, within valid range [0,2], for MSG_PROFILELEVEL.
Fixes a bug in existing code where return 'level' my be in non-valid
values 3 or 7.
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
struct server_id src,
DATA_BLOB *data)
{
- int level;
+ int level;
if (data->length != sizeof(level)) {
DEBUG(0, ("got invalid profile message\n"));
struct server_id src,
DATA_BLOB *data)
{
- int level;
-
- level = 1;
- if (smbprofile_state.config.do_count) {
- level += 2;
- }
- if (smbprofile_state.config.do_times) {
- level += 4;
+ int level;
+
+ if (!smbprofile_state.config.do_count) {
+ level = 0;
+ } else if (!smbprofile_state.config.do_times) {
+ level = 1;
+ } else {
+ level = 2;
}
DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %u\n",