Skip to contentSkip to conversation

Does anyone actually use -smb

Qemu-devel Anthony Liguori 6 participants 15 messages May 4, 2009 – May 5, 2009

lore
Share & tools
lore
#0 lore raw

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

Would anyone be opposed to removing this?

Signature · 3 lines
Regards,

Anthony Liguori
#1 lore raw
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

Quoted 3 lines

Would anyone be opposed to removing this?

No reason to do so IMHO. It's very simple to use, much simpler than having to configure a full samba server on the host, which would include user/password management.

Jan

#2 lore raw
Quoted 7 lines · Jan Kiszka
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

Quoted 9 lines
Quoted 2 lines

Would anyone be opposed to removing this?

No reason to do so IMHO. It's very simple to use, much simpler than having to configure a full samba server on the host, which would include user/password management.

Jan

BTW, I'm sitting on a large rework of all the slirp-related command line options + a fully-configurable slirp (not yet multi-instance, but that may come as well). Is your question motivated by some slirp-affecting work, or just cleanup considerations?

Jan

#3 lore raw
In reply to Jan Kiszka
Quoted 10 lines · Jan Kiszka
Quoted 3 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

Quoted 8 lines
Quoted 3 lines

Would anyone be opposed to removing this?

No reason to do so IMHO. It's very simple to use, much simpler than having to configure a full samba server on the host, which would include user/password management.

But you have to run qemu as root, and you can only use -smb with one guest at a time? Is that correct?

Regards,

Anthony Liguori

Quoted 3 lines

Jan

#4 lore raw
Quoted 16 lines · Anthony Liguori
Quoted 15 lines · Jan Kiszka
Quoted 4 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

Quoted 3 lines

Would anyone be opposed to removing this?

Quoted 7 lines
Quoted 4 lines

No reason to do so IMHO. It's very simple to use, much simpler than having to configure a full samba server on the host, which would include user/password management.

But you have to run qemu as root, and you can only use -smb with one guest at a time? Is that correct?

Nope, I'm running it as dumb user. I haven't tried multiple qemu instances, wait... works as well.

Jan

#5 lore raw
In reply to Jan Kiszka
Quoted 6 lines · Jan Kiszka
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

(I forget which files were hard-coded, or which distro I hit that on. Either CentOS, Debian or Ubuntu. Files were something like /var/lib/samba/{locking,connections}.tdb, perhaps?)

Because of those paths, non-root wasn't possible and running it as root caused it to try to clobber some files which interfered with a non-QEMU ("native") Samba running on the same machine for normal file service.

I guess if you have a private build of Samba you can avoid this problem, but even then I'm wondering how you ensure different Samba instances don't interfere with each other, as there is nowhere in smb.conf to specify an alternate location for those files normally in /var/lib/samba.

Jan, do you do anything special for -smb or does it just work? What distro and distro version are you using?

Thanks,
-- Jamie

#6 lore raw
Quoted 11 lines · Jamie Lokier
Quoted 5 lines · Jan Kiszka
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

Quoted 8 lines

(I forget which files were hard-coded, or which distro I hit that on. Either CentOS, Debian or Ubuntu. Files were something like /var/lib/samba/{locking,connections}.tdb, perhaps?)

Because of those paths, non-root wasn't possible and running it as root caused it to try to clobber some files which interfered with a non-QEMU ("native") Samba running on the same machine for normal file service.

I ran strace -e open and only caught this:

[pid 28902] open("/var/log/samba/log.smbd", O_WRONLY|O_CREAT|O_APPEND, 0644) = -1 EACCES (Permission denied)

But that would only be a problem if I ran qemu as root. Hmm, wait, I can fix it by specifying the file like this:

log file=/tmp/qemu-smb.28902/log.%m

Will write a patch for qemu.

Quoted 9 lines

I guess if you have a private build of Samba you can avoid this problem, but even then I'm wondering how you ensure different Samba instances don't interfere with each other, as there is nowhere in smb.conf to specify an alternate location for those files normally in /var/lib/samba.

Jan, do you do anything special for -smb or does it just work? What distro and distro version are you using?

OpenSUSE 11.0 with samba-3.2.4-4.3 and 11.1 with samba-3.2.7-11.2.1.

Maybe you should file a bug at your distro if its version doesn't behave according to its docs.

Jan

#7 lore raw
Quoted 22 lines · Jan Kiszka
Quoted 10 lines · Jamie Lokier
Quoted 5 lines · Jan Kiszka
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

Quoted 8 lines

(I forget which files were hard-coded, or which distro I hit that on. Either CentOS, Debian or Ubuntu. Files were something like /var/lib/samba/{locking,connections}.tdb, perhaps?)

Because of those paths, non-root wasn't possible and running it as root caused it to try to clobber some files which interfered with a non-QEMU ("native") Samba running on the same machine for normal file service.

I ran strace -e open and only caught this:

Quoted 7 lines

[pid 28902] open("/var/log/samba/log.smbd", O_WRONLY|O_CREAT|O_APPEND, 0644) = -1 EACCES (Permission denied)

But that would only be a problem if I ran qemu as root. Hmm, wait, I can fix it by specifying the file like this:

log file=/tmp/qemu-smb.28902/log.%m

Nope, this makes no difference. smbd still starts with accessing /var/log/samba/log.smbd, writes a few lines into it (if it has access permissions), then parses smb.conf, and finally switches over to the specified log file. But that's a non-issue for the typical use case of -smb: unprivileged qemu.

Jan

#9 lore raw
In reply to Jan Kiszka
Quoted 4 lines · Jan Kiszka

OpenSUSE 11.0 with samba-3.2.4-4.3 and 11.1 with samba-3.2.7-11.2.1.

Maybe you should file a bug at your distro if its version doesn't behave according to its docs.

But it does behave according to its docs.

The Samba docs "man smbd" list a lot of files in /var/lib/samba, for which there is no smb.conf option to change the path.

I've just looked at RHEL 4.6 (ancient - samba-3.0.25b) and Ubuntu 9.04 (new - samba-2:3.3.2-1ubuntu3), which I happen to have.

Quoted 1 line

From "man smbd", does yours not have these?

Samba stores it´s data in several TDB (Trivial Database) files, usually located in /var/lib/samba.

(*) information persistent across restarts (but not necessarily important to backup).

account_policy.tdb*
NT account policy settings such as pw expiration, etc...

brlock.tdb
byte range locks

browse.dat
browse lists

connections.tdb
share connections (used to enforce max connections, etc...)

gencache.tdb
generic caching db

group_mapping.tdb*
group mapping information

locking.tdb
share modes & oplocks

login_cache.tdb*
bad pw attempts

messages.tdb
Samba messaging system

netsamlogon_cache.tdb*
cache of user net_info_3 struct from net_samlogon() request (as a domain member)

ntdrivers.tdb*
installed printer drivers

ntforms.tdb*
installed printer forms

ntprinters.tdb*
installed printer information

printing/
directory containing tdb per print queue of cached lpq output

registry.tdb
Windows registry skeleton (connect via regedit.exe)

sessionid.tdb
session information (e.g. support for ´utmp = yes´)

share_info.tdb*
share acls

winbindd_cache.tdb
winbindd´s cache of user lists, etc...

winbindd_idmap.tdb*
winbindd´s local idmap db

wins.dat*
wins database when ´wins support = yes´

Most of them correspond to features which are disabled for QEMU, but some aren't.

I'm only talking about this because I've tried to use QEMU "-smb" in the last year and couldn't get it working. It looked like I needed to reconfigure and recompile Samba from source to use it.

-- Jamie

#12 lore raw
In reply to Jan Kiszka
Quoted 21 lines · Jan Kiszka
Quoted 11 lines · Jamie Lokier
Quoted 5 lines · Jan Kiszka
Quoted 2 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

Quoted 8 lines

(I forget which files were hard-coded, or which distro I hit that on. Either CentOS, Debian or Ubuntu. Files were something like /var/lib/samba/{locking,connections}.tdb, perhaps?)

Because of those paths, non-root wasn't possible and running it as root caused it to try to clobber some files which interfered with a non-QEMU ("native") Samba running on the same machine for normal file service.

Quoted 4 lines

I ran strace -e open and only caught this:

[pid 28902] open("/var/log/samba/log.smbd", O_WRONLY|O_CREAT|O_APPEND, 0644) = -1 EACCES (Permission denied)

Is that just starting Samba, or accessing a share from a Windows guest and doing some file accesses with locking?

-- Jamie

#8 lore raw
In reply to Jan Kiszka

Well, I use Samba from time to time.

But I found out that it not always works.
I used KVM-85, while -smb parameter works fine on my Fedora 7 machine it totally fails on my Fedora 10 machine.

Guest is Windows XP.

I dunno why, it may be version of samba on Host, or anything else.

Signature · 1 line
-Alexey Eromenko "Technologov"
#13 lore raw
In reply to Jamie Lokier
Quoted 7 lines · Jamie Lokier
Quoted 5 lines · Jan Kiszka
Quoted 3 lines · Anthony Liguori

It looks to be broken. I don't recall that Samba has every supported running as an unprivileged user to so it would require launching as root.

Quoted 8 lines
Quoted 3 lines

It works perfectly. I even have a patch pending that fixes the zombie issue it causes (more precisely, slirp missed that).

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

Yes, this has been my experience too. I just assumed this was upstream behavior.

Signature · 3 lines
Regards,

Anthony Liguori
#10 lore raw
In reply to Jamie Lokier
Quoted 11 lines · Jamie Lokier
Quoted 4 lines · Jan Kiszka

OpenSUSE 11.0 with samba-3.2.4-4.3 and 11.1 with samba-3.2.7-11.2.1.

Maybe you should file a bug at your distro if its version doesn't behave according to its docs.

But it does behave according to its docs.

The Samba docs "man smbd" list a lot of files in /var/lib/samba, for which there is no smb.conf option to change the path.

Quoted 6 lines

I've just looked at RHEL 4.6 (ancient - samba-3.0.25b) and Ubuntu 9.04 (new - samba-2:3.3.2-1ubuntu3), which I happen to have.

From "man smbd", does yours not have these?

Samba stores it´s data in several TDB (Trivial Database) files, usually

                                                                     ^^^^^^^

Sounds not like it is necessarily set in stone.

Quoted 57 lines

located in /var/lib/samba.

(*) information persistent across restarts (but not necessarily important to backup).

account_policy.tdb*
NT account policy settings such as pw expiration, etc...

brlock.tdb
byte range locks

browse.dat
browse lists

connections.tdb
share connections (used to enforce max connections, etc...)

gencache.tdb
generic caching db

group_mapping.tdb*
group mapping information

locking.tdb
share modes & oplocks

login_cache.tdb*
bad pw attempts

messages.tdb
Samba messaging system

netsamlogon_cache.tdb*
cache of user net_info_3 struct from net_samlogon() request (as a domain member)

ntdrivers.tdb*
installed printer drivers

ntforms.tdb*
installed printer forms

ntprinters.tdb*
installed printer information

printing/
directory containing tdb per print queue of cached lpq output

registry.tdb
Windows registry skeleton (connect via regedit.exe)

sessionid.tdb
session information (e.g. support for ´utmp = yes´)

share_info.tdb*
share acls

Quoted 8 lines

winbindd_cache.tdb
winbindd´s cache of user lists, etc...

winbindd_idmap.tdb*
winbindd´s local idmap db

wins.dat*
wins database when ´wins support = yes´

This is how my /tmp/qemu-smb.x folder looks like when running "smbclient //10.0.2.4/qemu" in the guest:

account_policy.tdb
brlock.tdb
connections.tdb
gencache.tdb
group_mapping.ldb
locking.tdb
log.smbd
messages.tdb
notify.tdb
ntdrivers.tdb
ntforms.tdb
ntprinters.tdb
perfmon
printing
registry.tdb
secrets.tdb
sessionid.tdb
share_info.tdb
smb.conf
smbpasswd

Quoted 7 lines

Most of them correspond to features which are disabled for QEMU, but some aren't.

I'm only talking about this because I've tried to use QEMU "-smb" in the last year and couldn't get it working. It looked like I needed to reconfigure and recompile Samba from source to use it.

Would be interesting to know if that makes a difference for you.

Jan

#14 lore raw
In reply to Anthony Liguori
Quoted 7 lines · Anthony Liguori
Quoted 4 lines

I've been unable to use it for a year or so due to Samba having hard-coded directory paths, pointing into /var/lib/samba, which cannot be overridden in the config file smb.conf.

Yes, this has been my experience too. I just assumed this was upstream behavior.

I think we should regard this as a regression in samba, and submit a bug report or a patch. It doesn't make sense for a program like samba only to work as a single instance.

Signature · 1 line
error compiling committee.c: too many arguments to function
#11 lore raw
In reply to Jan Kiszka
Quoted 7 lines · Jan Kiszka
Quoted 4 lines

From "man smbd", does yours not have these?

Samba stores it´s data in several TDB (Trivial Database) files, usually

                                                                     ^^^^^^^

Sounds not like it is necessarily set in stone.

To me it sounds like a build option :)

Signature · 1 line
error compiling committee.c: too many arguments to function