A ksmbd uci config option no longer being written to ksmbd.conf

The problem is that force group = hc_shared is no longer making it into the /var/etc/ksmbd/ksmbd.conf config from the uci config file. This worked for me in OpenWrt 21.02.

In the file /etc/config/ksmbd I have, among other shares, the following:

config share
        option name 'hc_shared'
        option path 'hc_shared'
        option read_only 'no'
        option users 'user_a user_b'
        option force_group 'hc_shared'
        option guest_ok 'no'
        option create_mask '0660'
        option dir_mask '0770'

Which, in /var/etc/ksmbd/ksmbd.conf translates into (notice the missing "force group"):

[hc_shared]
        path = hc_shared
        valid users = user_a user_b
        create mask = 0660
        directory mask = 0770
        read only = no
        guest ok = no

uci show ksmbd.@share[5] returns:

ksmbd.cfg07b538=share
ksmbd.cfg07b538.name='hc_shared'
ksmbd.cfg07b538.path='hc_shared'
ksmbd.cfg07b538.read_only='no'
ksmbd.cfg07b538.users='user_a user_b'
ksmbd.cfg07b538.force_group='hc_shared'
ksmbd.cfg07b538.guest_ok='no'
ksmbd.cfg07b538.create_mask='0660'
ksmbd.cfg07b538.dir_mask='0770'

I'm running OpenWrt 23.05.2 on a Linksys WRT-1200AC.

I'd be inclined to think I'm doing something wrong, except this worked in 21.02. Is it my config? If it's not, is there a way I can force that one parameter through even if uci doesn't want to?

Thank you,
Chris

Are you sure? I cannot find any hint that /etc/init.d/ksmbd translated a force_group UCI option into force group= in the conf file, in 21.02 or, really, ever.

Is it possible you added the setting manually to the conf file at one point? If the conf file already exists, it will not be recreated or overwritten by UCI config settings. But since somewhen between 21.02 and 23.05 the conf file name changed from /etc/ksmbd/smb.conf to /etc/ksmbd/ksmbd.conf it would be recreated now without your manual additions.

2 Likes

Oooh, I think you're dead-on here. I don't remember what I did originally and assumed UCI had always just passed through all the things I configured.

Many thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.