Bug#727756: qemu: Broken -smb with latest SAMBA package. (Unsupported security=share option)
Quoted 8 lines · Michael Büsch
Package: qemu
Version: 1.6.0+dfsg-2
Severity: normal
Tags: patchThe smb.conf automatically generated by qemu's -smb option fails on current samba, because smbd rejects the security=share option with the following warning:
Quoted 7 lines
Quoted 1 line
WARNING: Ignoring invalid value 'share' for parameter 'security'
Which makes it fall back to security=user without guest login. This results in being unable to login to the samba server from the guest OS.
The attached patch fixes this by selecting 'user' explicitly and mapping unknown users to guest logins.
net/slirp.c +2 -1
@@ -529,7 +529,8 @@ static int slirp_smb(SlirpState* s, cons"state directory=%s\n" "log file=%s/log.smbd\n" "smb passwd file=%s/smbpasswd\n" -"security = share\n" +"security = user\n" +"map to guest = Bad User\n" "[qemu]\n" "path=%s\n" "read only=no\n"
Thank you for the report and the patch Michael. Are you sure the result is equivalent? I mean, it *looks* like okay, because [qemu] share definition - which looks like this:
[qemu]
path=%s
read only=no
guest ok=yes
force user=%sexplicitly says that guest is okay, and forces user to the right one. And it should work the same with other versions of samba too.
But samba collected so many semi-conflicting options with years, so I'm not sure anymore.
Also, which users are "bad" -- will it be possible for our user to "clash" with some built-in/known user?
Cc'ing qemu-devel@ because this needs to be resolved upstream too.
Thank you again,
/mjt
Quoted 2 lines · On Sat, 26 Oct 2013 13:19:29 +0400 Michael Tokarev <[email protected]> wrote:
Thank you for the report and the patch Michael. Are you sure the result is equivalent?
Well, I am far from being an SMB expert. So I can't really say whether this is equivalent.
I also posted this patch to the qemu-devel list, but didn't get a reply, yet.
I tested this with a Windows XP client. Without this patch the client will always ask for username and password. Which I am unable to supply (smbpasswd is empty after all).
With this patch applied, the share works without authentication. And this is how it used to work in previous versions, too.
Quoted 3 lines
explicitly says that guest is okay, and forces user to the right one. And it should work the same with other versions of samba too.
I only tried this with smbd from sid.
My guess is that it would work on older versions, too. But that is untested.
Quoted 2 lines
Also, which users are "bad" -- will it be possible for our user to "clash" with some built-in/known user?
'bad" users seem to be users that are not in the smbpasswd file. As qemu creates an empty smbpasswd file, all users probably are "bad". But I'm not sure if there are exceptions to that.
Quoted 2 lines
Cc'ing qemu-devel@ because this needs to be resolved upstream too.
26.10.2013 20:44, Michael Büsch wrote:
[]
Quoted 5 lines
Quoted 2 lines
Also, which users are "bad" -- will it be possible for our user to "clash" with some built-in/known user?
'bad" users seem to be users that are not in the smbpasswd file. As qemu creates an empty smbpasswd file, all users probably are "bad".
That looks right. Are you okay adding your Signed-off-by to the patch you initially submitted? If yes, I'll make a formal patch submission upstream.
Because, well, this bothers several people already.
Thank you!
/mjt
Quoted 3 lines · On Fri, 01 Nov 2013 13:32:49 +0400 Michael Tokarev <[email protected]> wrote:
That looks right. Are you okay adding your Signed-off-by to the patch you initially submitted? If yes, I'll make a formal patch submission upstream.
Here you go.
From: Michael Buesch <[email protected]>
Subject: [PATCH] qemu/slirp: Fix SMB security configuration on newer samba versions
The smb.conf automatically generated by qemu's -smb option fails on current samba, because smbd rejects the security=share option with the following warning:
Quoted 1 line
WARNING: Ignoring invalid value 'share' for parameter 'security'
Which makes it fall back to security=user without guest login. This results in being unable to login to the samba server from the guest OS.
This fixes it by selecting 'user' explicitly and mapping unknown users to guest logins.
---
net/slirp.c +2 -1
@@ -529,7 +529,8 @@ static int slirp_smb(SlirpState* s, cons"state directory=%s\n" "log file=%s/log.smbd\n" "smb passwd file=%s/smbpasswd\n" -"security = share\n" +"security = user\n" +"map to guest = Bad User\n" "[qemu]\n" "path=%s\n" "read only=no\n"
PATCH 1/1 qemu: Broken -smb with latest SAMBA package. (Unsupported security=share option)
Quoted 8 lines · Michael Büsch
Quoted 3 lines · On Fri, 01 Nov 2013 13:32:49 +0400 Michael Tokarev <[email protected]> wrote:
That looks right. Are you okay adding your Signed-off-by to the patch you initially submitted? If yes, I'll make a formal patch submission upstream.
Here you go.
Thank you!
Adding Jan as slirp maintainer, and my
If Jan picks it up, that's fine. If not, I think it can go to the trivial patches queue.
Jan, if you missed context, it is in http://bugs.debian.org/727756
It is not the first time this issue pops up on qemu-devel@
/mjt
From: Michael Buesch <[email protected]>
Subject: [PATCH] qemu/slirp: Fix SMB security configuration on newer samba versions
The smb.conf automatically generated by qemu's -smb option fails on current samba, because smbd rejects the security=share option with the following warning:
Quoted 1 line
WARNING: Ignoring invalid value 'share' for parameter 'security'
Which makes it fall back to security=user without guest login. This results in being unable to login to the samba server from the guest OS.
This fixes it by selecting 'user' explicitly and mapping unknown users to guest logins.
---
net/slirp.c +2 -1
@@ -529,7 +529,8 @@ static int slirp_smb(SlirpState* s, cons"state directory=%s\n" "log file=%s/log.smbd\n" "smb passwd file=%s/smbpasswd\n" -"security = share\n" +"security = user\n" +"map to guest = Bad User\n" "[qemu]\n" "path=%s\n" "read only=no\n"
Re: [Qemu-devel] [PATCH] qemu: Broken -smb with latest SAMBA package. (Unsupported security=share option)
Quoted 10 lines · Michael Tokarev
Quoted 8 lines · Michael Büsch
Quoted 3 lines · On Fri, 01 Nov 2013 13:32:49 +0400 Michael Tokarev <[email protected]> wrote:
That looks right. Are you okay adding your Signed-off-by to the patch you initially submitted? If yes, I'll make a formal patch submission upstream.
Here you go.
Quoted 8 lines
Thank you!
Adding Jan as slirp maintainer, and my
Reviewed-by Michael Tokarev <[email protected]>If Jan picks it up, that's fine. If not, I think it can go to the trivial patches queue.
Works fine, applied to queues/slirp.
But this is not a trivial patch as the fix is not obvious for a reader (unless you know smb.conf semantics by heart).
Jan
Re: [Qemu-devel] [PATCH] qemu: Broken -smb with latest SAMBA package. (Unsupported security=share option)
Quoted 1 line · Jan Kiszka
On 2013-11-01 11:10, Michael Tokarev wrote:
[]
Quoted 4 lines
Quoted 2 lines
If Jan picks it up, that's fine. If not, I think it can go to the trivial patches queue.
Works fine, applied to queues/slirp.
Okay, thank you Jan.
Quoted 2 lines
But this is not a trivial patch as the fix is not obvious for a reader (unless you know smb.conf semantics by heart).
It's trivial for my understanding. If we require that every change going to -trivial should be obvious to everyone, we should just close it right away.
And this area does not have an active maintainer anyway, at least according to MAINTAINERS and ./scripts/get_maintainer.pl.
Thanks,
/mjt
Re: [Qemu-devel] [PATCH] qemu: Broken -smb with latest SAMBA package. (Unsupported security=share option)
Quoted 8 lines · Michael Tokarev
Quoted 1 line · Jan Kiszka
On 2013-11-01 11:10, Michael Tokarev wrote:
[]
Quoted 4 lines
Quoted 2 lines
If Jan picks it up, that's fine. If not, I think it can go to the trivial patches queue.
Works fine, applied to queues/slirp.
Quoted 8 lines
Okay, thank you Jan.
Quoted 2 lines
But this is not a trivial patch as the fix is not obvious for a reader (unless you know smb.conf semantics by heart).
It's trivial for my understanding. If we require that every change going to -trivial should be obvious to everyone, we should just close it right away.
Then we may need -less-trivial, because - to my understanding - -trivial was once set up according to the rule that (most) QEMU hackers should be able to understand that a trivial change is at least mostly harmless.
Quoted 2 lines
And this area does not have an active maintainer anyway, at least according to
MAINTAINERSand./scripts/get_maintainer.pl.
Yeah, I think we have some holes there. That smb configuration conceptually belongs to slirp is right, just not clear documented in our script.
Jan