Skip to content

Commit

Permalink
ksmbd-tools: mountd: check rpc_{lsarpc,samr}_init return value
Browse files Browse the repository at this point in the history
While here, add some missing checks in rpc_samr_init().

Signed-off-by: Marios Makassikis <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Marios Makassikis authored and namjaejeon committed Nov 11, 2022
1 parent 1ee5f7b commit 68e8234
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mountd/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,10 @@ int rpc_init(void)
if (!pipes_table)
return -ENOMEM;
g_rw_lock_init(&pipes_table_lock);
rpc_samr_init();
rpc_lsarpc_init();
if (rpc_samr_init())
return -ENOMEM;
if (rpc_lsarpc_init())
return -ENOMEM;
return 0;
}

Expand Down
6 changes: 4 additions & 2 deletions mountd/rpc_samr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,10 @@ int rpc_samr_init(void)
return -ENOMEM;

domain_name = g_ascii_strup(hostname, strlen(hostname));
rpc_samr_add_domain_entry(domain_name);
rpc_samr_add_domain_entry("Builtin");
if (rpc_samr_add_domain_entry(domain_name))
return -ENOMEM;
if (rpc_samr_add_domain_entry("Builtin"))
return -ENOMEM;
g_rw_lock_init(&ch_table_lock);
return 0;
}
Expand Down

0 comments on commit 68e8234

Please sign in to comment.