All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] handling samba shares in slirp networking
Date: Tue, 17 Jul 2012 22:50:46 +0400	[thread overview]
Message-ID: <5005B406.4080002@msgid.tls.msk.ru> (raw)

Hello.

We're getting more and more various bugreports and questions
about -net user,smb=xxx - about usage of "private" smbd to
share a given directory.

In short: it does not quite work.  Due to alot of various
reasons, most things being wrong/insufficient smb.conf
generated by slirp code.

Looking at the code, I'd say it should be much easier to
do it the other way: to run a script with two parameters --
directory to export, and a share name for the said directory.
This script will create a temporary config/runtime dir,
like qemu slirp code does now, create necessary smb.conf
in there, and run smbd with appropriate options (including,
for example, -l (logdir) and -F (stay in foreground)).

When smbd finishes, the script will remove that temp dir
and exit.

This way, it will be possible to customize the script easily,
to compensate for samba being changed over time, or it even
can check smbd version and generate different configs.

This way, it will also be possible to run custom smbd binary,
or add a debug option, or whatnot.

I propose a new -net user parameter, smbscript=, defaulting
to $libdir/smbscript.

Also, current code has at least 3 more defects.

First, it uses home-grown implementation of socketpair()
function, which should be used instead.

Second, the code does not watch for smbd dying (it
should be possible to do if smbd does not daemonize).

And 3rd, when smbd process we just spawned dies, slirp
code happily redirects samba-related network packets
to HOST smbd.  This is completely wrong.

I can implement at least the main part, but I wanted to
discuss it first.

Comments?

Thanks,

/mjt

             reply	other threads:[~2012-07-17 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 18:50 Michael Tokarev [this message]
2012-07-17 19:25 ` [Qemu-devel] handling samba shares in slirp networking Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5005B406.4080002@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.