From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CgV9N-0004r7-OY for qemu-devel@nongnu.org; Mon, 20 Dec 2004 16:33:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CgV9M-0004qQ-Dl for qemu-devel@nongnu.org; Mon, 20 Dec 2004 16:33:05 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CgV9M-0004qN-AC for qemu-devel@nongnu.org; Mon, 20 Dec 2004 16:33:04 -0500 Received: from [62.52.27.101] (helo=lnxc-641.srv.mediaways.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CgUyp-0003Xh-VQ for qemu-devel@nongnu.org; Mon, 20 Dec 2004 16:22:12 -0500 From: Bernhard Huafbauer Subject: Re: [Qemu-devel] SAMBA support in QEMU Date: Mon, 20 Dec 2004 22:14:55 +0100 References: <413BA018.60601@bellard.org> <200412191619.00159.huafbauer@compuserve.de> <41C6118B.3000201@bellard.org> In-Reply-To: <41C6118B.3000201@bellard.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200412202214.56513.huafbauer@compuserve.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, I found nothing about disabling the opening of the ports in the man page of the smb.conf. The only thing I have found to prevent smbd to open a port is to give a config file with one of these lines: smb ports=" " smb ports=' ' smb ports=0 the samba source file /source/smbd/server.c line 242 (version 3.0.2a-SUSE) look like this: ... for (ptr=ports; next_token(&ptr, tok, NULL, sizeof(tok)); ) { unsigned port = atoi(tok); if (port == 0) continue; s = fd_listenset[num_sockets] = open_socket_in(SOCK_STREAM, port, 0, ifip->s_addr, True); ... ... for (ptr=ports; next_token(&ptr, tok, NULL, sizeof(tok)); ) { unsigned port = atoi(tok); if (port == 0) continue; /* open an incoming socket */ s = open_socket_in(SOCK_STREAM, port, 0, ... Interesting the comparison to 0 and the continue ... so setting it to 0 would be best the way? with this setting a smbd called by hand doesn't open any port except this DGRAM thing bernhard@wombl:/tmp/qemu-smb.8091> ps aux | grep smbd | grep -v grep bernhard 10087 0.0 0.5 9912 2800 ? Ss 21:16 0:00 /usr/sbin/smbd -s /tmp/qemu-smb.8091/smb.conf bernhard@wombl:/tmp/qemu-smb.8091> netstat -anp | grep 10087 unix 2 [ ] DGRAM 23644 10087/smbd when running qemu with this setting and accessing \\10.0.2.4\qemu bernhard@wombl:/tmp> ps aux | grep smbd bernhard 11976 0.0 0.0 0 0 ? Z 22:02 0:00 [smbd] bernhard 12012 0.0 0.0 0 0 ? Z 22:03 0:00 [smbd] bernhard 12045 0.1 0.6 10984 3492 ? S 22:03 0:00 /usr/sbin/smbd -s /tmp/qemu-smb.11876/smb.conf bernhard 12064 0.0 0.1 2648 736 pts/1 S+ 22:04 0:00 grep smbd and sometimes somthing like this (?): bernhard@wombl:/tmp> netstat -anp | grep 12045 tcp 0 0 127.0.0.1:1357 127.0.0.1:1356 VERBUNDEN 12045/smbd udp 0 0 127.0.0.1:1156 0.0.0.0:* 12045/smbd (As a sidenote: the smb_exit cleans not all of the temp directory there is still a directory printing so the last rmdir call fails and a /tmp/qemu-smb.10542/printing/ remains.) Regards Bernhard Am Montag, 20. Dezember 2004 00:40 schrieb Fabrice Bellard: > Hi, > > It would be cleaner to find a way to disable the access to the port 445 > (it seems to be an uneeded feature for QEMU and your patch may not work > if several instances of QEMU are launched). Can you look at the SAMBA > documentation to see if there is an option to do that ? > > Fabrice. > > Bernhard Huafbauer wrote: > > Hello, > > > > With this little changes to the samba configuration > > file I was able to access the share from the guest os > > (winxp-oem-german-nosp, samba 3.0.2a-SUSE) > > > > Don't know how it would affect some samba 2.x installations ... > > > > The entry smb ports is because smbd wants to open port 445 > > (an I'm not allowed to as user). > > > > Regards, > > Bernhard > > > > Am Donnerstag, 9. Dezember 2004 22:34 schrieb Adrian Smarzewski: > > > >>David Still wrote: > >> > >>>This could also be why SAMBA support does not appear to work on Mac OS > >>>X. Version 10.3.6 appears to use SAMBA version 3.0.5. > >> > >>3.0 was released more than year ago I think... > >>Maybe It's more important to support 3.0.x than 2.x now. > >> > > > > > > bernhard@wombl:~/projekte/software/qemu> diff -Nru orig/qemu-cvs/qemu/vl.c qemu-cvs/qemu/vl.c > > --- orig/qemu-cvs/qemu/vl.c 2004-12-17 21:10:34.000000000 +0100 > > +++ qemu-cvs/qemu/vl.c 2004-12-19 15:44:27.501826076 +0100 > > @@ -1535,6 +1535,9 @@ > > } > > fprintf(f, > > "[global]\n" > > + "private dir=%s\n" > > + "smb ports=2445 2139\n" > > + "socket address=127.0.0.1\n" > > "pid directory=%s\n" > > "lock directory=%s\n" > > "log file=%s/log.smbd\n" > > @@ -1548,6 +1551,7 @@ > > smb_dir, > > smb_dir, > > smb_dir, > > + smb_dir, > > exported_dir > > ); > > fclose(f); > > > > > > _______________________________________________ > > Qemu-devel mailing list > > Qemu-devel@nongnu.org > > http://lists.nongnu.org/mailman/listinfo/qemu-devel > > > > > > > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel >