qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] c2804e: qemu/slirp: Fix SMB security configur


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] c2804e: qemu/slirp: Fix SMB security configuration on newe...
Date: Wed, 12 Mar 2014 06:30:03 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c2804ee6c0eba19c029bb2950fa2998c16f3ea11
      
https://github.com/qemu/qemu/commit/c2804ee6c0eba19c029bb2950fa2998c16f3ea11
  Author: Michael Buesch <address@hidden>
  Date:   2014-03-12 (Wed, 12 Mar 2014)

  Changed paths:
    M net/slirp.c

  Log Message:
  -----------
  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:

>   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.

Signed-off-by: Michael Buesch <address@hidden>
Reviewed-by: Michael Tokarev <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>


  Commit: 5c1e1890bfa1f6b4bc3f51e368bfd47af1b60db0
      
https://github.com/qemu/qemu/commit/5c1e1890bfa1f6b4bc3f51e368bfd47af1b60db0
  Author: Michael Tokarev <address@hidden>
  Date:   2014-03-12 (Wed, 12 Mar 2014)

  Changed paths:
    M net/slirp.c

  Log Message:
  -----------
  slirp smb with modern win guests when samba is also running on host

After numerous reports that -smb (or -netdev user,smb=foo) not working
with modern windows (win7 and vista are reported as non-working), I
started digging myself.  And found that indeed it doesn't work, and
why.

The thing is that modern win tries to connect to port 445 (microsoft-ds)
first, and if that fails, it falls back to old port 139 (netbios-ssn).

slirp code in qemu only redirects port 139, it does not touch port 445.

So the prob is that if samba is also running on the host, guest will try
to communicate using port 445, and that will succed, but ofcourse guest
will not talk with our samba but with samba running on the host.

If samba is not running on the host, guest will fall back to port 139,
and will reach the redirecting rule and qemu will spawn smbd correctly.

The solution is to redirect both ports (139 and 445), and the fix is
a one-liner, adding second call to slirp_add_exec() at the end of
net/slirp.c:slirp_smb() function (provided below).

But it looks like that is not a proper fix really, since in theory
we should redirect both ports to the SAME, single samba instance,
but I'm not sure this is possible with slirp.  Well, even if two
smbd processes will be run on the same config dir, it should not
be a problem.

The one-liner (not exactly 1 since it touches previous line too) is like
this:

Signed-off-By: Michael Tokarev <address@hidden>

Signed-off-by: Jan Kiszka <address@hidden>


  Commit: 2c3445bb850fbfb4481e9487d8852f10e8c74e4c
      
https://github.com/qemu/qemu/commit/2c3445bb850fbfb4481e9487d8852f10e8c74e4c
  Author: Peter Maydell <address@hidden>
  Date:   2014-03-12 (Wed, 12 Mar 2014)

  Changed paths:
    M net/slirp.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kiszka/queues/slirp' into staging

* remotes/kiszka/queues/slirp:
  slirp smb with modern win guests when samba is also running on host
  qemu/slirp: Fix SMB security configuration on newer samba versions

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/7602e3e4a367...2c3445bb850f

reply via email to

[Prev in Thread] Current Thread [Next in Thread]