qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] [PULL] slirp: Fixes for latest smbd versions
@ 2012-05-01 22:18 Jan Kiszka
  2012-05-01 22:18 ` [Qemu-devel] [PATCH 1/2] slirp: don't use "smb ports = 0" option Jan Kiszka
  2012-05-01 22:18 ` [Qemu-devel] [PATCH 2/2] Declare state directory in smb.conf Jan Kiszka
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2012-05-01 22:18 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel; +Cc: Nikolaus Rath

The following changes since commit 65074706b9353bae7307fcfcbbf63a36f6896aa7:

  linux-user: Fix undefined HOST_LONG_SIZE on PPC hosts (2012-05-01 23:44:43 +0400)

are available in the git repository at:
  git://git.kiszka.org/qemu.git queues/slirp


CC: Nikolaus Rath <Nikolaus@rath.org>

Nikolaus Rath (2):
  slirp: don't use "smb ports = 0" option
  Declare state directory in smb.conf

 net/slirp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

-- 
1.7.3.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] slirp: don't use "smb ports = 0" option
  2012-05-01 22:18 [Qemu-devel] [PATCH 0/2] [PULL] slirp: Fixes for latest smbd versions Jan Kiszka
@ 2012-05-01 22:18 ` Jan Kiszka
  2012-05-01 22:18 ` [Qemu-devel] [PATCH 2/2] Declare state directory in smb.conf Jan Kiszka
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2012-05-01 22:18 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel; +Cc: Nikolaus Rath

From: Nikolaus Rath <Nikolaus@rath.org>

The "smb ports = 0" option causes recent samba versions to crash. It was
introduced in commit 157777ef3e with log message "Samba 3 support".
However, a value of 0 has never been officially supported by smb and is
also not necessary: if stdin is a socket, smb does not try to listen on
any ports and uses just stdin. This is necessary to support inetd based
operation (otherwise smbd would always fail when called from inetd,
because inetd already listens on the SMB port). Since samba has
supported inetd operation since pre-3.x, it should be safe to rely on
this feature. I have tested it with Samba 3.6.4 -- communication works
fine, and smbd is not listening on any ports.

I suspect the "smb ports = 0" hack may have been introduced when someone
tested the qemu generated samba config from the command line with "smbd
-i" and found it to fail (because then stdin isn't a socket).

Signed-off-by: Nikolaus Rath <Nikolaus@rath.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 net/slirp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/slirp.c b/net/slirp.c
index 18e07ba..f49043b 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -507,7 +507,6 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
     fprintf(f,
             "[global]\n"
             "private dir=%s\n"
-            "smb ports=0\n"
             "socket address=127.0.0.1\n"
             "pid directory=%s\n"
             "lock directory=%s\n"
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] Declare state directory in smb.conf
  2012-05-01 22:18 [Qemu-devel] [PATCH 0/2] [PULL] slirp: Fixes for latest smbd versions Jan Kiszka
  2012-05-01 22:18 ` [Qemu-devel] [PATCH 1/2] slirp: don't use "smb ports = 0" option Jan Kiszka
@ 2012-05-01 22:18 ` Jan Kiszka
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2012-05-01 22:18 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel; +Cc: Nikolaus Rath

From: Nikolaus Rath <Nikolaus@rath.org>

The smb.conf generated by the userspace networking does not include a state directory
directive. Samba therefore falls back to the default value. Since the user generally
does not have write access to this path, smbd immediately crashes.

The "state directory" option was added in Samba 3.4.0 (commit
http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).

This patch adds the missing option.

Signed-off-by: Nikolaus Rath <Nikolaus@rath.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 net/slirp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/slirp.c b/net/slirp.c
index f49043b..96f5032 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -510,6 +510,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
             "socket address=127.0.0.1\n"
             "pid directory=%s\n"
             "lock directory=%s\n"
+            "state directory=%s\n"
             "log file=%s/log.smbd\n"
             "smb passwd file=%s/smbpasswd\n"
             "security = share\n"
@@ -522,6 +523,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
             s->smb_dir,
             s->smb_dir,
             s->smb_dir,
+            s->smb_dir,
             exported_dir
             );
     fclose(f);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-01 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 22:18 [Qemu-devel] [PATCH 0/2] [PULL] slirp: Fixes for latest smbd versions Jan Kiszka
2012-05-01 22:18 ` [Qemu-devel] [PATCH 1/2] slirp: don't use "smb ports = 0" option Jan Kiszka
2012-05-01 22:18 ` [Qemu-devel] [PATCH 2/2] Declare state directory in smb.conf Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).