ksmbd: fix incorrect handling of iterate_dir
Namjae Jeon
maintainerPATCH v2 1/1 ksmbd: fix incorrect handling of iterate_dir
if iterate_dir() returns non-negative value, caller has to treat it as normal and check there is any error while populating dentry information. ksmbd doesn't have to do anything because ksmbd already checks too small OutputBufferLength to store one file information.
And because ctx->pos is set to file->f_pos when iterative_dir is called, remove restart_ctx(). And if iterate_dir() return -EIO, which mean directory entry is corrupted, return STATUS_FILE_CORRUPT_ERROR error response.
This patch fixes some failure of SMB2_QUERY_DIRECTORY, which happens when ntfs3 is local filesystem.
---
v2:
- remove unneeded restart_ctx().
- If directory entry is corrupted, return STATUS_FILE_CORRUPT_ERROR error response.
fs/ksmbd/smb2pdu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
fs/ksmbd/smb2pdu.c +4 -10
@@ -3809,11 +3809,6 @@ static int __query_dir(struct dir_context *ctx, const char *name, int namlen,return 0 ; } -static void restart_ctx (struct dir_context *ctx) -{ - ctx->pos =0 ; -} -static int verify_info_level (int info_level) {switch (info_level) {
@@ -3921,7 +3916,6 @@ int smb2_query_dir(struct ksmbd_work *work)if (srch_flag &SMB2_REOPEN || srch_flag &SMB2_RESTART_SCANS ) {ksmbd_debug (SMB ,"Restart directory scan\n" );generic_file_llseek (dir_fp->filp,0 ,SEEK_SET ); -restart_ctx (&dir_fp->readdir_data.ctx); }memset (&d_info,0 ,sizeof (struct ksmbd_dir_info ));
@@ -3968,11 +3962,9 @@ int smb2_query_dir(struct ksmbd_work *work)*/ if (!d_info.out_buf_len && !d_info.num_entry) goto no_buf_len; -if (rc ==0 ) -restart_ctx (&dir_fp->readdir_data.ctx); -if (rc == -ENOSPC ) +if (rc >0 || rc == -ENOSPC ) rc =0 ; -if (rc) +else if (rc) goto err_out; d_info.wptr = d_info.rptr;
@@ -4029,6 +4021,8 @@ int smb2_query_dir(struct ksmbd_work *work) rsp->hdr.Status =STATUS_NO_MEMORY ; else if (rc == -EFAULT) rsp->hdr.Status = STATUS_INVALID_INFO_CLASS; + else if (rc == -EIO) + rsp->hdr.Status = STATUS_FILE_CORRUPT_ERROR;if (!rsp->hdr.Status) rsp->hdr.Status =STATUS_UNEXPECTED_IO_ERROR ;
Signature · 1 line
2.25.1
Namjae Jeon
maintainerPATCH v3 1/1 ksmbd: update documentation
configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method.
---
v3:
- replace CIFS with SMB3 clients.
- update ksmbd built-in case.
- replace smb.conf leftover with ksmbd.conf.
- use full name of utils in ksmbd-tools instead of <foo>.
- fix the warnings from make htlmdocs build reported by kernel test robot.
v2:
- rename smb.conf to ksmbd.conf.
- add how to set ksmbd module in menuconfig
- remove --syscondir option for configure, instead change ksmbd directory to /usr/local/etc/ksmbd.
- change the prompt to '$'.
Documentation/filesystems/cifs/ksmbd.rst | 40 +++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-)
Documentation/filesystems/cifs/ksmbd.rst +29 -11
@@ -118,26 +118,44 @@ ksmbd/nfsd interoperability Planned for future. The features that ksmbd How to run ========== -1. Download ksmbd-tools and compile them. - - https://github.com/cifsd-team/ksmbd-tools +1. Download ksmbd-tools(https://github.com/cifsd-team/ksmbd-tools/releases) and + compile them. + + - Refer README(https://github.com/cifsd-team/ksmbd-tools/blob/master/README.md) + to know how to use ksmbd.mountd/adduser/addshare/control utils + + $ ./autogen.sh + $ ./configure --with-rundir=/run + $ make && sudo make install 2. Create user/password for SMB share. - # mkdir /etc/ksmbd/ - # ksmbd.adduser -a <Enter USERNAME for SMB share access> + - See ksmbd.adduser manpage. + + $ man ksmbd.adduser + $ sudo ksmbd.adduser -a <Enter USERNAME for SMB share access> + +3. Create /usr/local/etc/ksmbd/ksmbd.conf file, add SMB share in ksmbd.conf file. -3. Create /etc/ksmbd/smb.conf file, add SMB share in smb.conf file - - Refer smb.conf.example and - https://github.com/cifsd-team/ksmbd-tools/blob/master/Documentation/configuration.txt + - Refer ksmbd.conf.example in ksmbd-utils, See ksmbd.conf manpage + for details to configure shares. -4. Insert ksmbd.ko module + $ man ksmbd.conf - # insmod ksmbd.ko +4. Insert ksmbd.ko module after build your kernel. No need to load module + if ksmbd is built into the kernel. + + - Set ksmbd in menuconfig(e.g. $ make menuconfig) + [*] Network File Systems ---> + <M> SMB3 server support (EXPERIMENTAL) + + $ sudo modprobe ksmbd.ko 5. Start ksmbd user space daemon - # ksmbd.mountd -6. Access share from Windows or Linux using CIFS + $ sudo ksmbd.mountd + +6. Access share from Windows or Linux SMB3 clients (cifs.ko or smbclient of samba) Shutdown KSMBD ==============
Signature · 1 line
2.25.1
Tom Talpey
reviewerRe: [PATCH v3] ksmbd: update documentation
Quoted 43 lines · Namjae Jeon
configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method.
Reviewed-by Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v3:
- replace CIFS with SMB3 clients.
- update ksmbd built-in case.
- replace smb.conf leftover with ksmbd.conf.
- use full name of utils in ksmbd-tools instead of <foo>.
- fix the warnings from make htlmdocs build reported by kernel test robot.
v2:
- rename smb.conf to ksmbd.conf.
- add how to set ksmbd module in menuconfig
- remove --syscondir option for configure, instead change ksmbd directory to/usr/local/etc/ksmbd.
- change the prompt to '$'.Documentation/filesystems/cifs/ksmbd.rst | 40 +++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-)Documentation/filesystems/cifs/ksmbd.rst +9
-2@@ -118,26 +118,44 @@ ksmbd/nfsd interoperability Planned for future. The features that ksmbd How to run ========== -1. Download ksmbd-tools and compile them. - - https://github.com/cifsd-team/ksmbd-tools +1. Download ksmbd-tools(https://github.com/cifsd-team/ksmbd-tools/releases) and + compile them. + + - Refer README(https://github.com/cifsd-team/ksmbd-tools/blob/master/README.md) + to know how to use ksmbd.mountd/adduser/addshare/control utils + + $ ./autogen.sh + $ ./configure --with-rundir=/run + $ make && sudo make install
Documentation/filesystems/cifs/ksmbd.rst ksmbd/nfsd interoperability Planned for future. The features that ksmbd · line 138
Quoted 10 lines
Documentation/filesystems/cifs/ksmbd.rst +6
-22. Create user/password for SMB share. - # mkdir /etc/ksmbd/ - # ksmbd.adduser -a <Enter USERNAME for SMB share access> + - See ksmbd.adduser manpage. + + $ man ksmbd.adduser + $ sudo ksmbd.adduser -a <Enter USERNAME for SMB share access> + +3. Create /usr/local/etc/ksmbd/ksmbd.conf file, add SMB share in ksmbd.conf file.
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to /usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.
Also, doesn't this file need to exist before step 2??
Tom.
Quoted 29 lines
Documentation/filesystems/cifs/ksmbd.rst +14
-7-3. Create /etc/ksmbd/smb.conf file, add SMB share in smb.conf file - - Refer smb.conf.example and - https://github.com/cifsd-team/ksmbd-tools/blob/master/Documentation/configuration.txt + - Refer ksmbd.conf.example in ksmbd-utils, See ksmbd.conf manpage + for details to configure shares. -4. Insert ksmbd.ko module + $ man ksmbd.conf - # insmod ksmbd.ko +4. Insert ksmbd.ko module after build your kernel. No need to load module + if ksmbd is built into the kernel. + + - Set ksmbd in menuconfig(e.g. $ make menuconfig) + [*] Network File Systems ---> + <M> SMB3 server support (EXPERIMENTAL) + + $ sudo modprobe ksmbd.ko 5. Start ksmbd user space daemon - # ksmbd.mountd -6. Access share from Windows or Linux using CIFS + $ sudo ksmbd.mountd + +6. Access share from Windows or Linux SMB3 clients (cifs.ko or smbclient of samba) Shutdown KSMBD ==============
Namjae Jeon
maintainerRe: [PATCH v3] ksmbd: update documentation
2022-09-13 8:38 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 50 lines · Namjae Jeon
Quoted 49 lines
configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method.
Reviewed-by Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v3:
- replace CIFS with SMB3 clients.
- update ksmbd built-in case.
- replace smb.conf leftover with ksmbd.conf.
- use full name of utils in ksmbd-tools instead of <foo>.
- fix the warnings from make htlmdocs build reported by kernel test robot.
v2:
- rename smb.conf to ksmbd.conf.
- add how to set ksmbd module in menuconfig
- remove --syscondir option for configure, instead change ksmbd directory to/usr/local/etc/ksmbd.
- change the prompt to '$'.Documentation/filesystems/cifs/ksmbd.rst | 40 +++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-)Documentation/filesystems/cifs/ksmbd.rst +0
-0@@ -118,26 +118,44 @@ ksmbd/nfsd interoperability Planned for future.The features that ksmbd
How to run
==========-1. Download ksmbd-tools and compile them.
Documentation/filesystems/cifs/ksmbd.rst +1
-1- - https://github.com/cifsd-team/ksmbd-tools +1. Downloadksmbd-tools(https://github.com/cifsd-team/ksmbd-tools/releases) and
Documentation/filesystems/cifs/ksmbd.rst +3
-0+ compile them. + + - ReferREADME(https://github.com/cifsd-team/ksmbd-tools/blob/master/README.md)
Documentation/filesystems/cifs/ksmbd.rst +5
-0+ to know how to use ksmbd.mountd/adduser/addshare/control utils + + $ ./autogen.sh + $ ./configure --with-rundir=/run + $ make && sudo make install 2. Create user/password for SMB share.
Quoted 14 lines
Quoted 9 lines
Documentation/filesystems/cifs/ksmbd.rst +6
-2- # mkdir /etc/ksmbd/ - # ksmbd.adduser -a <Enter USERNAME for SMB share access> + - See ksmbd.adduser manpage. + + $ man ksmbd.adduser + $ sudo ksmbd.adduser -a <Enter USERNAME for SMB share access> + +3. Create /usr/local/etc/ksmbd/ksmbd.conf file, add SMB share inksmbd.conf file.
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to
/usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.
To avoid conflicts with the existing distribution package, the default location as far as I know is /usr/local/etc. And it can be changed with --sysconfdir. It is same with samba.
Quoted 2 lines
Also, doesn't this file need to exist before step 2??
Ah, Yes. Will switch them.
Thanks for your review!
Quoted 37 lines
Tom.
Quoted 32 lines
-3. Create
/etc/ksmbd/smb.conffile, add SMB share in smb.conf fileDocumentation/filesystems/cifs/ksmbd.rst +0
-2- - Refer smb.conf.example and -https://github.com/cifsd-team/ksmbd-tools/blob/master/Documentation/configuration.txt
Documentation/filesystems/cifs/ksmbd.rst +4
-2+ - Refer ksmbd.conf.example in ksmbd-utils, See ksmbd.conf manpage + for details to configure shares. -4. Insert ksmbd.ko module + $ man ksmbd.conf - # insmod ksmbd.ko +4. Insert ksmbd.ko module after build your kernel. No need to loadmodule
Documentation/filesystems/cifs/ksmbd.rst +10
-2+ if ksmbd is built into the kernel. + + - Set ksmbd in menuconfig(e.g. $ make menuconfig) + [*] Network File Systems ---> + <M> SMB3 server support (EXPERIMENTAL) + + $ sudo modprobe ksmbd.ko 5. Start ksmbd user space daemon - # ksmbd.mountd -6. Access share from Windows or Linux using CIFS + $ sudo ksmbd.mountd + +6. Access share from Windows or Linux SMB3 clients (cifs.ko or smbclientof samba)
Shutdown KSMBD
==============
Tom Talpey
reviewerRe: [PATCH v3] ksmbd: update documentation
Quoted 65 lines · Namjae Jeon
2022-09-13 8:38 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 50 lines · Namjae Jeon
Quoted 49 lines
configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method.
Reviewed-by Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v3:
- replace CIFS with SMB3 clients.
- update ksmbd built-in case.
- replace smb.conf leftover with ksmbd.conf.
- use full name of utils in ksmbd-tools instead of <foo>.
- fix the warnings from make htlmdocs build reported by kernel test robot.
v2:
- rename smb.conf to ksmbd.conf.
- add how to set ksmbd module in menuconfig
- remove --syscondir option for configure, instead change ksmbd directory to/usr/local/etc/ksmbd.
- change the prompt to '$'.Documentation/filesystems/cifs/ksmbd.rst | 40 +++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-)Documentation/filesystems/cifs/ksmbd.rst +0
-0@@ -118,26 +118,44 @@ ksmbd/nfsd interoperability Planned for future.The features that ksmbd
How to run
==========-1. Download ksmbd-tools and compile them.
Documentation/filesystems/cifs/ksmbd.rst +1
-1- - https://github.com/cifsd-team/ksmbd-tools +1. Downloadksmbd-tools(https://github.com/cifsd-team/ksmbd-tools/releases) and
Documentation/filesystems/cifs/ksmbd.rst +3
-0+ compile them. + + - ReferREADME(https://github.com/cifsd-team/ksmbd-tools/blob/master/README.md)
Documentation/filesystems/cifs/ksmbd.rst +5
-0+ to know how to use ksmbd.mountd/adduser/addshare/control utils + + $ ./autogen.sh + $ ./configure --with-rundir=/run + $ make && sudo make install 2. Create user/password for SMB share.Quoted 14 lines
Quoted 9 lines
Documentation/filesystems/cifs/ksmbd.rst +6
-2- # mkdir /etc/ksmbd/ - # ksmbd.adduser -a <Enter USERNAME for SMB share access> + - See ksmbd.adduser manpage. + + $ man ksmbd.adduser + $ sudo ksmbd.adduser -a <Enter USERNAME for SMB share access> + +3. Create /usr/local/etc/ksmbd/ksmbd.conf file, add SMB share inksmbd.conf file.
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to
/usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.
Quoted 3 lines
To avoid conflicts with the existing distribution package, the default location as far as I know is
/usr/local/etc. And it can be changed with --sysconfdir. It is same with samba.
I totally disagree with this. The kernel server is part of, well, the kernel, and loading the kernel should not depend on a path like /usr/local/etc. Also, nothing I know, including Samba, is deployed with such a directory in my experience. I find smb.conf in /etc/samba.
Where are the ksmbd.<foo> helpers installed by default? /usr/local/sbin? On my standard Ubuntu install (and presumably Debian?) they are in /sbin.
Tom.
Quoted 42 lines
Quoted 1 line
Also, doesn't this file need to exist before step 2??
Ah, Yes. Will switch them.
Thanks for your review!
Quoted 37 lines
Tom.
Quoted 32 lines
-3. Create
/etc/ksmbd/smb.conffile, add SMB share in smb.conf fileDocumentation/filesystems/cifs/ksmbd.rst +0
-2- - Refer smb.conf.example and -https://github.com/cifsd-team/ksmbd-tools/blob/master/Documentation/configuration.txt
Documentation/filesystems/cifs/ksmbd.rst +4
-2+ - Refer ksmbd.conf.example in ksmbd-utils, See ksmbd.conf manpage + for details to configure shares. -4. Insert ksmbd.ko module + $ man ksmbd.conf - # insmod ksmbd.ko +4. Insert ksmbd.ko module after build your kernel. No need to loadmodule
Documentation/filesystems/cifs/ksmbd.rst +10
-2+ if ksmbd is built into the kernel. + + - Set ksmbd in menuconfig(e.g. $ make menuconfig) + [*] Network File Systems ---> + <M> SMB3 server support (EXPERIMENTAL) + + $ sudo modprobe ksmbd.ko 5. Start ksmbd user space daemon - # ksmbd.mountd -6. Access share from Windows or Linux using CIFS + $ sudo ksmbd.mountd + +6. Access share from Windows or Linux SMB3 clients (cifs.ko or smbclientof samba)
Shutdown KSMBD ==============
Namjae Jeon
maintainerRe: [PATCH v3] ksmbd: update documentation
2022-09-14 4:02 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 69 lines · Namjae Jeon
Quoted 68 lines
2022-09-13 8:38 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 67 lines · Namjae Jeon
Quoted 60 lines
configuration.txt in ksmbd-tools moved to ksmbd.conf manpage. update it and more detailed ksmbd-tools build method.
Reviewed-by Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v3:
- replace CIFS with SMB3 clients.
- update ksmbd built-in case.
- replace smb.conf leftover with ksmbd.conf.
- use full name of utils in ksmbd-tools instead of <foo>.
- fix the warnings from make htlmdocs build reported by kernel
test
robot.
v2:
- rename smb.conf to ksmbd.conf.
- add how to set ksmbd module in menuconfig
- remove --syscondir option for configure, instead change ksmbd directory to/usr/local/etc/ksmbd.
- change the prompt to '$'.Documentation/filesystems/cifs/ksmbd.rst | 40 +++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-)Documentation/filesystems/cifs/ksmbd.rst +0
-0@@ -118,26 +118,44 @@ ksmbd/nfsd interoperability Planned forfuture.
The features that ksmbd
How to run
==========-1. Download ksmbd-tools and compile them.
Documentation/filesystems/cifs/ksmbd.rst +1
-1- - https://github.com/cifsd-team/ksmbd-tools +1. Downloadksmbd-tools(https://github.com/cifsd-team/ksmbd-tools/releases) and
Documentation/filesystems/cifs/ksmbd.rst +3
-0+ compile them. + + - ReferREADME(https://github.com/cifsd-team/ksmbd-tools/blob/master/README.md)
Documentation/filesystems/cifs/ksmbd.rst +11
-2+ to know how to use ksmbd.mountd/adduser/addshare/control utils + + $ ./autogen.sh + $ ./configure --with-rundir=/run + $ make && sudo make install 2. Create user/password for SMB share. - # mkdir /etc/ksmbd/ - # ksmbd.adduser -a <Enter USERNAME for SMB share access> + - See ksmbd.adduser manpage. + + $ man ksmbd.adduser + $ sudo ksmbd.adduser -a <Enter USERNAME for SMB share access> + +3. Create /usr/local/etc/ksmbd/ksmbd.conf file, add SMB share inQuoted 1 line
ksmbd.conf file.
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to
/usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.
Quoted 7 lines
Quoted 3 lines
To avoid conflicts with the existing distribution package, the default location as far as I know is
/usr/local/etc. And it can be changed with --sysconfdir. It is same with samba.I totally disagree with this. The kernel server is part of, well, the kernel, and loading the kernel should not depend on a path like
/usr/local/etc.
You should consider ksmbd-tools included ksmbd.mountd also. To start running ksmbd server, ksmbd.mountd should be launched.
Quoted 2 lines
Also, nothing I know, including Samba, is deployed
with such a directory in my experience. I find smb.conf in/etc/samba.
If you build samba by default, it is installed into /usr/local. /etc/samba/ location you are saying is installed by package manager.
Quoted 4 lines
Where are the ksmbd.<foo> helpers installed by default?
/usr/local/sbin? On my standard Ubuntu install (and presumably Debian?) they are in /sbin.
I think that you are confusing binary of ksmbd-tools which installed by package manager.
make & make install in ksmbd-tools directory and can see them in /usr/local/sbin/ .
Quoted 47 lines
Tom.
Quoted 43 lines
Quoted 1 line
Also, doesn't this file need to exist before step 2??
Ah, Yes. Will switch them.
Thanks for your review!
Quoted 38 lines
Tom.
Quoted 33 lines
-3. Create
/etc/ksmbd/smb.conffile, add SMB share in smb.conf fileDocumentation/filesystems/cifs/ksmbd.rst +0
-2- - Refer smb.conf.example and -https://github.com/cifsd-team/ksmbd-tools/blob/master/Documentation/configuration.txt
Documentation/filesystems/cifs/ksmbd.rst +4
-2+ - Refer ksmbd.conf.example in ksmbd-utils, See ksmbd.conf manpage + for details to configure shares. -4. Insert ksmbd.ko module + $ man ksmbd.conf - # insmod ksmbd.ko +4. Insert ksmbd.ko module after build your kernel. No need to loadmodule
Documentation/filesystems/cifs/ksmbd.rst +10
-2+ if ksmbd is built into the kernel. + + - Set ksmbd in menuconfig(e.g. $ make menuconfig) + [*] Network File Systems ---> + <M> SMB3 server support (EXPERIMENTAL) + + $ sudo modprobe ksmbd.ko 5. Start ksmbd user space daemon - # ksmbd.mountd -6. Access share from Windows or Linux using CIFS + $ sudo ksmbd.mountd + +6. Access share from Windows or Linux SMB3 clients (cifs.ko orsmbclient
of samba)Shutdown KSMBD ==============
Re: [PATCH v3] ksmbd: update documentation
In reply to Tom TalpeyQuoted 7 lines · Tom Talpey
Quoted 6 lines · Namjae Jeon
2022-09-13 8:38 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 5 lines
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to
/usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.
Quoted 7 lines
Quoted 3 lines
To avoid conflicts with the existing distribution package, the default location as far as I know is
/usr/local/etc. And it can be changed with --sysconfdir. It is same with samba.I totally disagree with this. The kernel server is part of, well, the kernel, and loading the kernel should not depend on a path like
/usr/local/etc.
I really don't understand what this means. The dependency to the sysconfdir path isn't ksmbd's, it's ksmbd-tools'.
Quoted 2 lines
Also, nothing I know, including Samba, is deployed
with such a directory in my experience. I find smb.conf in/etc/samba.
Yes, that is because your distribution builds it for you. If you build it yourself, and don't want to collide with your distribution's packaged version of it, then you choose some prefix other than /usr.
Quoted 4 lines
Where are the ksmbd.<foo> helpers installed by default?
/usr/local/sbin? On my standard Ubuntu install (and presumably Debian?) they are in /sbin.
Yes, the GNU autoconf default sbindir is /usr/local/sbin since the default prefix is /usr/local. It is distinct from the sbindir your distribution's packages use. Your /sbin is (likely) a symlink to /usr/sbin and the distribution's packages install in the /usr prefix. The /etc sysconfdir is associated with the /usr prefix. You can also check what FHS has to say about /usr/local if you'd like.
Namjae's way of running configure is correct. It's either this or colliding with file paths used by the packaged ksmbd-tools, which isn't a good idea.
Quoted 14 lines
Tom.
Quoted 10 lines
Quoted 1 line
Also, doesn't this file need to exist before step 2??
Ah, Yes. Will switch them.
Thanks for your review!
Quoted 5 lines
Tom.
Tom Talpey
reviewerRe: [PATCH v3] ksmbd: update documentation
Quoted 12 lines · Atte Heikkilä
Quoted 11 lines · Tom Talpey
Quoted 9 lines · Namjae Jeon
2022-09-13 8:38 GMT+09:00, Tom Talpey <[email protected]>:
Quoted 5 lines
I missed this in the v2 match - are you intentionally moving the ksmbd.conf file to
/usr/local/etc? That seems a very mysterious location. Nothing on my vanilla installed system places anything in there.To avoid conflicts with the existing distribution package, the default location as far as I know is
/usr/local/etc. And it can be changed with --sysconfdir. It is same with samba.
Quoted 6 lines
Quoted 3 lines
I totally disagree with this. The kernel server is part of, well, the kernel, and loading the kernel should not depend on a path like
/usr/local/etc.I really don't understand what this means. The dependency to the sysconfdir path isn't ksmbd's, it's ksmbd-tools'.
But ksmbd depends on the ksmbd-tools to provide the configuration to the kernel module, and to manage the service. So, the user/admin will view them as one subsystem.
Quoted 6 lines
Quoted 2 lines
Also, nothing I know, including Samba, is deployed
with such a directory in my experience. I find smb.conf in/etc/samba.Yes, that is because your distribution builds it for you. If you build it yourself, and don't want to collide with your distribution's packaged version of it, then you choose some prefix other than /usr.
I understand that. My point is that distributions have already built ksmbd-tools with sysconfdir==/etc, which IMO is appropriate and correct.
Quoted 11 lines
Quoted 3 lines
Where are the ksmbd.<foo> helpers installed by default?
/usr/local/sbin? On my standard Ubuntu install (and presumably Debian?) they are in /sbin.Yes, the GNU autoconf default sbindir is
/usr/local/sbinsince the default prefix is/usr/local. It is distinct from the sbindir your distribution's packages use. Your /sbin is (likely) a symlink to/usr/sbinand the distribution's packages install in the /usr prefix. The /etc sysconfdir is associated with the /usr prefix. You can also check what FHS has to say about/usr/localif you'd like.
Quoted 2 lines
Namjae's way of running configure is correct. It's either this or colliding with file paths used by the packaged ksmbd-tools, which isn't a good idea.
Ok, so if overriding the default sysconfdir builds the manpage output to follow, we're good here. Out of step, perhaps, but good.
Tom.
Quoted 16 lines
Quoted 15 lines
Tom.
Quoted 10 lines
Quoted 1 line
Also, doesn't this file need to exist before step 2??
Ah, Yes. Will switch them.
Thanks for your review!
Quoted 5 lines
Tom.