Rowland penny
2020-Dec-01 22:46 UTC
[Samba] Strange logs: check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
On 01/12/2020 22:35, Jeremy Allison wrote:> On Tue, Dec 01, 2020 at 10:32:32PM +0000, Rowland penny via samba wrote: >> On 01/12/2020 22:23, Andrew Bartlett wrote: >>> On Tue, 2020-12-01 at 14:19 -0800, Jeremy Allison via samba wrote: >>>> On Tue, Dec 01, 2020 at 10:08:34PM +0000, Rowland penny via samba >>>> wrote: >>>> >>>>> could this have anything to do with it: >>>>> >>>>> 4.12.0 >>>>> Default: usershare max shares = 0 >>>>> >>>>> 4.13.2 >>>>> Default: usershare max shares = 100 >>>> Good catch. Yes, that would cause >>>> the usershare load path to be executed >>>> now whereas it wasn't before. >>> Even if we didn't change the default, Debian does.? But the code should >>> work of course, be it enabled by default or by the administrator... >>> >>> Andrew Bartlett >> >> Yes, it is Debian, just found this out by downloading the relevant >> file from Louis's repo, they appear to be turning usershares on >> without actually setting up usershares. I would suggest the code >> would work if usershares were actually set up correctly, I have used >> usershares in the past and I don't remember syslog getting spammed. > > Well I still don't know why he's seeing syslog spam from > an empty usershare directory. That shouldn't happen even > if the code is going down the usershare path now.He is not alone, I didn't know I had a problem until I checked syslog, my lines are bit different: Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.671948,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. Permission denied Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.676259,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.680641,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.687020,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.689004,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.797171,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.799966,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.802785,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.805444,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:14:26 raspberrypi smbd[21036]: [2020/12/01 09:14:26.891225,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:26 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. Permission denied Dec? 1 09:14:27 raspberrypi smbd[21036]: [2020/12/01 09:14:27.007528,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:27 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:14:27 raspberrypi smbd[21036]: [2020/12/01 09:14:27.011952,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:27 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:14:27 raspberrypi smbd[21036]: [2020/12/01 09:14:27.019275,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:27 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:14:27 raspberrypi smbd[21036]: [2020/12/01 09:14:27.023257,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:14:27 raspberrypi smbd[21036]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.602306,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. Permission denied Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.606630,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.609381,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.613345,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.616161,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.628951,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.631745,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.634465,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:32 raspberrypi smbd[21090]: [2020/12/01 09:32:32.638399,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:32 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or directory Dec? 1 09:32:33 raspberrypi smbd[21090]: [2020/12/01 09:32:33.136664,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:33 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. Permission denied Dec? 1 09:32:33 raspberrypi smbd[21090]: [2020/12/01 09:32:33.141394,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:33 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:32:33 raspberrypi smbd[21090]: [2020/12/01 09:32:33.145025,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:33 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:32:33 raspberrypi smbd[21090]: [2020/12/01 09:32:33.148401,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:33 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory Dec? 1 09:32:33 raspberrypi smbd[21090]: [2020/12/01 09:32:33.152002,? 0] ../../source3/param/loadparm.c:3422(process_usershare_file) Dec? 1 09:32:33 raspberrypi smbd[21090]:?? process_usershare_file: stat of /var/lib/samba/usershares/sharename failed. No such file or directory The messages are quite true, the files do not exist, this is on 4.13.2 running as a Unix domain member. I cannot see anything in git that has changed that could cause this and do not remember seeing anything in syslog like this before. in this instance, they are only warnings, so why are they debug 0 ? Rowland
Jeremy Allison
2020-Dec-01 22:52 UTC
[Samba] Strange logs: check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
On Tue, Dec 01, 2020 at 10:46:05PM +0000, Rowland penny via samba wrote:> >He is not alone, I didn't know I had a problem until I checked syslog, >my lines are bit different: > >Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.671948,? >0] ../../source3/param/loadparm.c:3422(process_usershare_file) >Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: >stat of /var/lib/samba/usershares/profiles.v6 failed. Permission >deniedThe only thing inside /var/lib/samba/usershares/ should be usershare file definitions, owned by the user who created them. What is: /var/lib/samba/usershares/profiles.v6 and why is it there ?>The messages are quite true, the files do not exist, this is on 4.13.2 >running as a Unix domain member. I cannot see anything in git that has >changed that could cause this and do not remember seeing anything in >syslog like this before. in this instance, they are only warnings, so >why are they debug 0 ?I chose debug zero because usershare files are *dangerous* if misconfigured. Might grant access that should not be allowed. Default value for max usershares as shipped by us should be zero. Let distro's change that if they wish. If there are strange files in /var/lib/samba/usershares you need to do something about it and remove them :-). That's why the debug 0. But why are they there and what is in those files ?
Jeremy Allison
2020-Dec-01 22:55 UTC
[Samba] Strange logs: check_usershare_stat: file /var/lib/samba/usershares/ owned by uid 0 is not a regular file
On Tue, Dec 01, 2020 at 10:46:05PM +0000, Rowland penny via samba wrote:>On 01/12/2020 22:35, Jeremy Allison wrote: >>On Tue, Dec 01, 2020 at 10:32:32PM +0000, Rowland penny via samba wrote: >>>On 01/12/2020 22:23, Andrew Bartlett wrote: >>>>On Tue, 2020-12-01 at 14:19 -0800, Jeremy Allison via samba wrote: >>>>>On Tue, Dec 01, 2020 at 10:08:34PM +0000, Rowland penny via samba >>>>>wrote: >>>>> >>>>>>could this have anything to do with it: >>>>>> >>>>>>4.12.0 >>>>>>Default: usershare max shares = 0 >>>>>> >>>>>>4.13.2 >>>>>>Default: usershare max shares = 100 >>>>>Good catch. Yes, that would cause >>>>>the usershare load path to be executed >>>>>now whereas it wasn't before. >>>>Even if we didn't change the default, Debian does.? But the code should >>>>work of course, be it enabled by default or by the administrator... >>>> >>>>Andrew Bartlett >>> >>>Yes, it is Debian, just found this out by downloading the relevant >>>file from Louis's repo, they appear to be turning usershares on >>>without actually setting up usershares. I would suggest the code >>>would work if usershares were actually set up correctly, I have >>>used usershares in the past and I don't remember syslog getting >>>spammed. >> >>Well I still don't know why he's seeing syslog spam from >>an empty usershare directory. That shouldn't happen even >>if the code is going down the usershare path now. > >He is not alone, I didn't know I had a problem until I checked syslog, >my lines are bit different: > >Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.671948,? >0] ../../source3/param/loadparm.c:3422(process_usershare_file) >Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: >stat of /var/lib/samba/usershares/profiles.v6 failed. Permission >deniedHang on a minute - the above says "Permission denied" for "/var/lib/samba/usershares/profiles.v6" That means the directory scanner found something inside: /var/lib/samba/usershares>Dec? 1 09:14:25 raspberrypi smbd[21036]: [2020/12/01 09:14:25.676259,? >0] ../../source3/param/loadparm.c:3422(process_usershare_file) >Dec? 1 09:14:25 raspberrypi smbd[21036]:?? process_usershare_file: >stat of /var/lib/samba/usershares/profiles.v6 failed. No such file or >directoryNow it says "No such file or directory" for "/var/lib/samba/usershares/profiles.v6" Which is right ?