Skip to content

Commit

Permalink
ksmbd-tools: document duplicate key-value handling
Browse files Browse the repository at this point in the history
The config parser has always ignored duplicate key-values. This may
very well be surprising to users so document it. Let's also document
how duplicate sections are handled, which conversely is typical, and
improve some wording.

Signed-off-by: Atte Heikkilä <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
atheik authored and namjaejeon committed Oct 31, 2024
1 parent e8f8966 commit b59d6f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ksmbd.conf.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ A value may be a list of multiple values separated by commas, tabs, and spaces.
For a list of users, all users in a system group are given by giving the group name prefixed with an at (\fB@\fR).
A value may have a number suffix, which is either \fBK\fR, \fBM\fR, \fBG\fR, \fBT\fR, \fBP\fR, or \fBE\fR.
A semicolon (\fB;\fR) or a hash (\fB#\fR) marks the beginning of a comment which continues until the end of the line.
If a section has the same name as a previous section, it is a continuation of that previous section, i.e. they are the same section.
A duplicate parameter in a section has its value updated only if its previous value was empty.
.SH SHARES
Each section name, except that of the \fBglobal\fR section, defines a shared resource, commonly referred to as a share.
A section name, which is the share name, must be UTF-8, [1, 64) bytes, and is case-insensitive. \" KSMBD_REQ_MAX_SHARE_NAME
Users that may be allowed to connect to a share are those that are present in \fBksmbdpwd.db\fR(5) user database.
A share may limit which users are allowed to connect to a particular share.
A share may limit which users are allowed to connect to it.
When connected to a share, the user is mapped to a system user and underlying filesystem permissions are enforced.
By default, this mapping is done by name, but it may also be done by mapping all users connected to the share to a single system user and group.
When connecting as a user not in the user database, only guest sessions may work.
Expand Down

5 comments on commit b59d6f2

@atheik
Copy link
Member Author

@atheik atheik commented on b59d6f2 Nov 4, 2024

Choose a reason for hiding this comment

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

In the commit message, it would have been better to say that the config parser has always intended to ignore duplicate ("multiple") key-values. The intention was clearly there at 2.0.1, but the functionality was broken until commit e5396bd.

This is now a documented incompatibility with Samba's smb.conf. If compatibility is desired, then this behavior should be changed before this documentation reaches users. I will not be contributing that change. This behavior of ignoring duplicate key-values is at least consistent with the other config parser oddities. For example, the long-standing bug at namjaejeon#197 (comment), which was fixed (in a Samba incompatible way) in commit 75ec1bc.

@namjaejeon
Copy link
Member

Choose a reason for hiding this comment

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

@atheik Okay, Should we add the description to next release note for this ?

@atheik
Copy link
Member Author

@atheik atheik commented on b59d6f2 Nov 6, 2024

Choose a reason for hiding this comment

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

@namjaejeon,

Description about what? The fix to the long-standing bug?

@namjaejeon
Copy link
Member

@namjaejeon namjaejeon commented on b59d6f2 Nov 7, 2024

Choose a reason for hiding this comment

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

@atheik No, Do we need to add description for about incompatibility with Samba's smb.conf ?

@atheik
Copy link
Member Author

@atheik atheik commented on b59d6f2 Nov 7, 2024

Choose a reason for hiding this comment

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

@namjaejeon,

What change to smb.conf compatibility was there?

Please sign in to comment.