cifsd-team / ksmbd-tools

ksmbd kernel server userspace utilities
GNU General Public License v2.0
94 stars 27 forks source link

ksmbd-tools: fix detection of multiple key-value definitions #289

Closed atheik closed 2 years ago

atheik commented 2 years ago

Checking for multiple key-value definitions in add_group_key_value() does not work because `key' at lookup-time points to the last character in the key. Fix this by moving the check after `key' has its proper value extracted with g_strndup(). Also, make the associated logging message clearer.

Signed-off-by: Atte Heikkilä \atteh.mailbox@gmail.com

atheik commented 2 years ago

Here is an example ksmbd.conf:

[test]
        comment = foo
        comment = bar

The key-value definition comment = bar should be ignored.

namjaejeon commented 2 years ago

Applied, Thanks for your patch!