summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README17
-rw-r--r--docs/INSTALL.txt318
-rw-r--r--docs/MIRRORS31
-rw-r--r--docs/OS2.txt57
-rw-r--r--docs/README.OS281
-rw-r--r--docs/Warp.txt99
-rw-r--r--docs/announce6
-rw-r--r--docs/manpages/nmbd.84
-rw-r--r--docs/manpages/samba.74
-rw-r--r--docs/manpages/smbclient.111
-rw-r--r--docs/samba.faq538
-rw-r--r--docs/samba.lsm4
-rw-r--r--docs/textdocs/BUGS.txt15
-rw-r--r--docs/textdocs/DIAGNOSIS.txt8
-rw-r--r--docs/textdocs/HINTS.txt2
-rw-r--r--docs/textdocs/Support.txt41
-rw-r--r--docs/textdocs/UNIX-SMB.txt3
-rw-r--r--examples/misc/extra_smbstatus33
-rw-r--r--examples/misc/wall.perl76
-rw-r--r--source/.cvsignore10
-rw-r--r--source/change-log3
-rw-r--r--source/client/client.c69
-rw-r--r--source/cvs.log757
-rw-r--r--source/include/charset.h4
-rw-r--r--source/include/includes.h28
-rw-r--r--source/include/local.h3
-rw-r--r--source/include/version.h2
-rw-r--r--source/lib/system.c2
-rw-r--r--source/lib/util.c100
-rw-r--r--source/libsmb/smbencrypt.c2
-rw-r--r--source/loadparm.h160
-rw-r--r--source/params.h45
-rw-r--r--source/passdb/smbpass.c4
-rw-r--r--source/pcap.h35
-rw-r--r--source/reply.h60
-rw-r--r--source/smbd/dir.c13
-rw-r--r--source/smbd/ipc.c3
-rw-r--r--source/smbd/mangle.c4
-rw-r--r--source/smbd/password.c24
-rw-r--r--source/smbd/quotas.c330
-rw-r--r--source/smbd/server.c316
-rw-r--r--source/smbd/trans2.c2
-rw-r--r--source/smbpass.h50
-rw-r--r--source/sockspy.c302
-rw-r--r--source/utils/smbpasswd.c18
-rw-r--r--source/utils/status.c10
46 files changed, 3250 insertions, 454 deletions
diff --git a/README b/README
index b7ef5d55957..84bc00b2ef1 100644
--- a/README
+++ b/README
@@ -35,7 +35,8 @@ CONTRIBUTIONS
If you want to contribute to the development of the software then
please join the mailing list. I accept patches (preferably in
-"diff -u" format) and am always glad to receive feedback or suggestions.
+"diff -u" format, see docs/BUGS.txt for more details) and am always glad to
+receive feedback or suggestions.
You could also send hardware/software/money/jewelry or pizza
vouchers directly to me. The pizza vouchers would be especially
@@ -49,7 +50,7 @@ we get. If noone tells us they like it then we'll probably move onto
something else.
Andrew Tridgell
-Email: samba-bugs@anu.edu.au
+Email: samba-bugs@samba.anu.edu.au
3 Ballow Crescent
Macgregor, A.C.T.
@@ -70,18 +71,18 @@ FTP SITE
--------
The main anonymous ftp distribution site for this software is
-nimbus.anu.edu.au in the directory pub/tridge/samba/.
+samba.anu.edu.au in the directory pub/samba/.
MAILING LIST
------------
There is a mailing list for discussion of Samba. To subscribe send
-mail to listproc@anu.edu.au with a body of "subscribe samba Your Name"
+mail to listproc@samba.anu.edu.au with a body of "subscribe samba Your Name"
To send mail to everyone on the list mail to samba@listproc.anu.edu.au
There is also an announcement mailing list where I announce new
-versions. To subscribe send mail to listproc@anu.edu.au with a body
+versions. To subscribe send mail to listproc@samba.anu.edu.au with a body
of "subscribe samba-announce Your Name". All announcements also go to
the samba list.
@@ -102,7 +103,11 @@ WEB SITE
A Samba WWW site has been setup with lots of useful info. Connect to:
-http://lake.canberra.edu.au/pub/samba/
+http://samba.canberra.edu.au/pub/samba/
+
+As well as general information and documentation, this also has searchable
+archives of the mailing list and a user survey that shows who else is using
+this package. Have you registered with the survey yet? :-)
It is maintained by Paul Blackman (thanks Paul!). You can contact him
at ictinus@lake.canberra.edu.au.
diff --git a/docs/INSTALL.txt b/docs/INSTALL.txt
new file mode 100644
index 00000000000..b91367cd59a
--- /dev/null
+++ b/docs/INSTALL.txt
@@ -0,0 +1,318 @@
+HOW TO INSTALL AND TEST SAMBA
+=============================
+
+
+STEP 0. Read the man pages. They contain lots of useful info that will
+help to get you started. If you don't know how to read man pages then
+try something like:
+
+ nroff -man smbd.8 | more
+
+STEP 1. Building the binaries
+
+To do this, first edit the file source/Makefile. You will find that
+the Makefile has an entry for most unixes and you need to uncomment
+the one that matches your operating system.
+
+You should also edit the section at the top of the Makefile which
+determines where things will be installed. You need to get this right
+before compilation as Samba needs to find some things at runtime
+(smbrun in particular). There are also settings for where you want
+your log files etc. Make sure you get these right, and that the
+directories exist.
+
+Then type "make". This will create the binaries.
+
+Once it's successfully compiled you can use "make install" to install
+the binaries and manual pages. You can separately install the binaries
+and/or man pages using "make installbin" and "make installman".
+
+Note that if you are upgrading for a previous version of Samba you
+might like to know that the old versions of the binaries will be
+renamed with a ".old" extension. You can go back to the previous
+version with "make revert" if you find this version a disaster!
+
+STEP 2. The all important step
+
+At this stage you must fetch yourself a coffee or other drink you find
+stimulating. Getting the rest of the install right can sometimes be
+tricky, so you will probably need it.
+
+If you have installed samba before then you can skip this step.
+
+STEP 3. Create the smb configuration file.
+
+There are sample configuration files in the examples subdirectory in
+the distribution. I suggest you read them carefully so you can see how
+the options go together in practice. See the man page for all the
+options.
+
+The simplest useful configuration file would be something like this:
+
+[homes]
+ workgroup = MYGROUP
+ guest ok = no
+ read only = no
+
+which would allow connections by anyone with an account on the server,
+using either their login name or "homes" as the service name. (Note
+that I also set the workgroup that Samba is part of. See BROWSING.txt
+for defails)
+
+Note that "make install" will not install a smb.conf file. You need to
+create it yourself. You will also need to create the path you specify
+in the Makefile for the logs etc, such as /usr/local/samba.
+
+Make sure you put the smb.conf file in the same place you specified in
+the Makefile.
+
+STEP 4. Test your config file with testparm
+
+It's important that you test the validity of your smb.conf file using
+the testparm program. If testparm runs OK then it will list the loaded
+services. If not it will give an error message.
+
+Make sure it runs OK and that the services look resonable before
+proceeding.
+
+STEP 5. Starting the smbd and nmbd.
+
+You must choose to start smbd and nmbd either as daemons or from
+inetd. Don't try to do both! Either you can put them in inetd.conf
+and have them started on demand by inetd, or you can start them as
+daemons either from the command line or in /etc/rc.local. See the man
+pages for details on the command line options.
+
+The main advantage of starting smbd and nmbd as a daemon is that they
+will respond slightly more quickly to an initial connection
+request. This is, however, unlilkely to be a problem.
+
+Step 5a. Starting from inetd.conf
+
+NOTE; The following will be different if you use NIS or NIS+ to
+distributed services maps.
+
+Look at your /etc/services. What is defined at port 139/tcp. If
+nothing is defined then add a line like this:
+
+netbios-ssn 139/tcp
+
+similarly for 137/udp you should have an entry like:
+
+netbios-ns 137/udp
+
+Next edit your /etc/inetd.conf and add two lines something like this:
+
+netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
+netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
+
+The exact syntax of /etc/inetd.conf varies between unixes. Look at the
+other entries in inetd.conf for a guide.
+
+NOTE: Some unixes already have entries like netbios_ns (note the
+underscore) in /etc/services. You must either edit /etc/services or
+/etc/inetd.conf to make them consistant.
+
+NOTE: On many systems you may need to give the nmbd a -B parameter to
+specify the broadcast address of your interface. Run ifconfig as root
+if you don't know what the broadcast is for your net. nmbd tries to
+determine it at run time, but fails on some unixes. See the section on
+"testing nmbd" for a method of finding if you need to do this.
+
+!!!WARNING!!! Many unixes only accept around 5 parameters on the
+command line in inetd. This means you shouldn't use spaces between the
+options and arguments, or you should use a script, and start the
+script from inetd.
+
+Restart inetd, perhaps just send it a HUP. If you have installed an
+earlier version of nmbd then you may need to kill nmbd as well.
+
+Step 5b. Alternative: starting it as a daemon
+
+To start the server as a daemon you should create a script something
+like this one, perhaps calling it "startsmb"
+
+#!/bin/sh
+/usr/local/samba/bin/smbd -D
+/usr/local/samba/bin/nmbd -D
+
+then make it executable with "chmod +x startsmb"
+
+You can then run startsmb by hand or execute it from /etc/rc.local
+
+To kill it send a kill signal to the processes nmbd and smbd.
+
+
+
+STEP 7. Try listing the shares available on your server
+
+smbclient -L yourhostname
+
+Your should get back a list of shares available on your server. If you
+don't then something is incorrectly setup. Note that this method can
+also be used to see what shares are available on other LanManager
+clients (such as WfWg).
+
+If you choose user level security then you may find that Samba requests
+a password before it will list the shares. See the smbclient docs for
+details. (you can force it to list the shares without a password by
+adding the option -U% to the command line. This will not work with
+non-Samba servers)
+
+STEP 8. try connecting with the unix client. eg:
+
+smbclient '\\yourhostname\aservice'
+
+Typically the "yourhostname" would be the name of the host where you
+installed smbd. The "aservice" is any service you have defined in the
+smb.conf file. Try your user name if you just have a [homes] section
+in smb.conf.
+
+For example if your unix host is bambi and your login name is fred you
+would type:
+
+smbclient '\\bambi\fred'
+
+NOTE: The number of slashes to use depends on the type of shell you
+use. You may need '\\\\bambi\\fred' with some shells.
+
+STEP 9. Try connecting from a dos/WfWg/Win95/NT/os-2 client. Try
+mounting disks. eg:
+
+net use d: \\servername\service
+
+Try printing. eg:
+
+net use lpt1: \\servername\spoolservice
+print filename
+
+Celebrate, or send me a bug report!
+
+WHAT IF IT DOESN'T WORK?
+========================
+
+If nothing works and you start to think "who wrote this pile of trash"
+then I suggest you do step 2 again (and again) till you calm down.
+
+Then you might read the file DIAGNOSIS.txt and the FAQ. If you are
+still stuck then try the mailing list or newsgroup (look in the README
+for details). Samba has been successfully installed at thousands of
+sites worldwide, so maybe someone else has hit your problem and has
+overcome it. You could also use the WWW site to scan back issues of
+the samba-digest.
+
+When you fix the problem PLEASE send me some updates to the
+documentation (or source code) so that the next person will find it
+easier.
+
+DIAGNOSING PROBLEMS
+===================
+
+If you have instalation problems then go to DIAGNOSIS.txt to try to
+find the problem.
+
+SCOPE IDs
+=========
+
+By default Samba uses a blank scope ID. This means all your windows
+boxes must also have a blank scope ID. If you really want to use a
+non-blank scope ID then you will need to use the -i <scope> option to
+nmbd, smbd, and smbclient. All your PCs will need to have the same
+setting for this to work. I do not recommend scope IDs.
+
+
+CHOOSING THE PROTOCOL LEVEL
+===========================
+
+The SMB protocol has many dialects. Currently Samba supports 4, called
+CORE, COREPLUS, LANMAN1, LANMAN2 and NT1.
+
+You can choose what protocols to support in the smb.conf file. The
+default is NT1 and that is the best for the vast majority of sites.
+
+In older versions of Samba you may have found it necessary to use
+COREPLUS. The limitations that led to this have mostly been fixed. It
+is now less likely that you will want to use less than LANMAN1. The
+only remaining advantage of COREPLUS is that for some obscure reason
+WfWg preserves the case of passwords in this protocol, whereas under
+LANMAN1, LANMAN2 or NT1 it uppercases all passwords before sending them,
+forcing you to use the "password level=" option in some cases.
+
+The main advantage of LANMAN2 and NT1 is support for long filenames with some
+clients (eg: smbclient, Windows NT or Win95).
+
+See the smb.conf manual page for more details.
+
+Note: To support print queue reporting you may find that you have to
+use TCP/IP as the default protocol under WfWg. For some reason if you
+leave Netbeui as the default it may break the print queue reporting on
+some systems. It is presumably a WfWg bug.
+
+
+PRINTING FROM UNIX TO A CLIENT PC
+=================================
+
+To use a printer that is available via a smb-based server from a unix
+host you will need to compile the smbclient program. You then need to
+install the script "smbprint". Read the instruction in smbprint for
+more details.
+
+There is also a SYSV style script that does much the same thing called
+smbprint.sysv. It contains instructions.
+
+
+LOCKING
+=======
+
+One area which sometimes causes trouble is locking.
+
+There are two types of locking which need to be performed by a SMB
+server. The first is "record locking" which allows a client to lock a
+range of bytes in a open file. The second is the "deny modes" that are
+specified when a file is open.
+
+Samba supports "record locking" using the fcntl() unix system
+call. This is often implemented using rpc calls to a rpc.lockd process
+running on the system that owns the filesystem. Unfortunately many
+rpc.lockd implementations are very buggy, particularly when made to
+talk to versions from other vendors. It is not uncommon for the
+rpc.lockd to crash.
+
+There is also a problem translating the 32 bit lock requests generated
+by PC clients to 31 bit requests supported by most
+unixes. Unfortunately many PC applications (typically OLE2
+applications) use byte ranges with the top bit set as semaphore
+sets. Samba attempts translation to support these types of
+applications, and the translation has proved to be quite successful.
+
+Strictly a SMB server should check for locks before every read and
+write call on a file. Unfortunately with the way fcntl() works this
+can be slow and may overstress the rpc.lockd. It is also almost always
+unnecessary as clients are supposed to independently make locking
+calls before reads and writes anyway if locking is important to
+them. By default Samba only makes locking calls when explicitly asked
+to by a client, but if you set "strict locking = yes" then it will
+make lock checking calls on every read and write.
+
+You can also disable by range locking completely using "locking =
+no". This is useful for those shares that don't support locking or
+don't need it (such as cdroms). In this case Samba fakes the return
+codes of locking calls to tell clients that everything is OK.
+
+The second class of locking is the "deny modes". These are set by an
+application when it opens a file to determine what types of access
+should be allowed simultaneously with it's open. A client may ask for
+DENY_NONE, DENY_READ, DENY_WRITE or DENY_ALL. There are also special
+compatability modes called DENY_FCB and DENY_DOS.
+
+You can disable share modes using "share modes = no". This may be
+useful on a heavily loaded server as the share modes code is very
+slow.
+
+
+MAPPING USERNAMES
+=================
+
+If you have different usernames on the PCs and the unix server then
+take a look at the "username map" option. See the smb.conf man page
+for details.
diff --git a/docs/MIRRORS b/docs/MIRRORS
new file mode 100644
index 00000000000..2feb9ba90e8
--- /dev/null
+++ b/docs/MIRRORS
@@ -0,0 +1,31 @@
+The main Samba site is samba.anu.edu.au in pub/samba/. Contact
+samba-bugs@samba.anu.edu.au for help with this site.
+
+Mirror sites include:
+
+ftp://nimbus.anu.edu.au/pub/tridge/samba
+ftp://sunsite.auc.dk/pub/unix/networking/samba/
+ftp://src.doc.ic.ac.uk/packages/samba/
+ftp://ftp.warwick.ac.uk/pub/linux/sunsite.unc-mirror/system/Network/samba/
+ftp://sunsite.unc.edu/pub/Linux/system/Network/samba/
+ftp://ftp.choc.apana.org.au/pub/samba/
+ftp://ftp.uni-trier.de/pub/unix/network/samba/
+ftp://ftp.spectrum.titan.com/pub/samba/
+ftp://ftp.demon.co.uk/pub/unix/unix/samba/
+ftp://sunsite.mff.cuni.cz/Net/Protocols/Samba/
+
+There are several others. Give archie a try.
+
+SCO binaries available from:
+ftp://ftp.markv.com/pub/samba (built by lance@fox.com)
+
+AIX and DEC OSF/1 binaries are available from:
+ftp://151.99.220.5/pub/samba (built by davide.migliavacca@inferentia.inet.it)
+
+QNX binaries and source code:
+ftp://quics.qnx.com/usr/free/staging/samba
+
+Http sites include:
+
+http://samba.canberra.edu.au/pub/samba
+http://www.choc.apana.org.au/pub/samba
diff --git a/docs/OS2.txt b/docs/OS2.txt
new file mode 100644
index 00000000000..7d678a4bfb5
--- /dev/null
+++ b/docs/OS2.txt
@@ -0,0 +1,57 @@
+This describes how to use smbclient to connect to an OS/2 server.
+Knowing this allows you to use a OS/2 printer from unix.
+
+Author: riiber@oslonett.no
+
+
+How to login to an OS/2 server
+-------------------------------
+
+Sample setup for OS/2 server running LanMan 2.2:
+
+ OS/2 Server Name : \\OBV11
+ OS/2 User Account : ARNE
+ OS/2 Password : xxx
+ OS/2 shared service 1 : LASER02
+ OS/2 Shared service 2 : PCPROGS
+ Samba NetBIOS name : KLATREMUS
+
+First, the two servers were started with the commands
+smbd and nmbd -n KLATREMUS.
+
+Command to connect to a the shared printer LASER02 on the OS/2 server:
+n
+ smbclient '\\OBV11\LASER02' xxx -n ARNE -U ARNE -P
+
+and to connect to the shared drive 'PCPROGS':
+
+ smbclient '\\OBV11\PCPROGS' xxx -n ARNE -U ARNE
+
+
+If login to the OS/2 server fails:
+----------------------------------
+
+The remarkable OS/2 server requires NetBIOS name to be equal to User name.
+This was the only combination of (NetBIOS name, User name) that allowed login.
+
+Password xxx must be in upper case, case in user name is unimportant.
+
+The OS/2 server responds with "Bad password - name/password pair"
+if the password is illegal (in lowercase, for example).
+
+If correct user name and password, but invalid NetBIOS name is given,
+it responds with "... SMBtcon failed. ERRDOS - 65".
+
+The OS/2 server can disable login from a list of workstations (PCs)
+corresponding to the NetBIOS name (-n option). I set it up to
+allow login from any workstation.
+
+
+
+(I experimented quite a lot with the -U and -n options, printed and browsed
+the MS SMB protocol docs and the RFC's, then read some comp.protocols.smb,
+got some tips, tried some "stupid" command line options,
+and at last I got it working!)
+
+-Arne-
+
diff --git a/docs/README.OS2 b/docs/README.OS2
new file mode 100644
index 00000000000..a464dd9946c
--- /dev/null
+++ b/docs/README.OS2
@@ -0,0 +1,81 @@
+Samba 1.9.15p8 for OS/2 : REQUIRES emx 0.9b.
+
+
+Please read the file README, which contains general information about
+the configuration and use of Samba.
+
+
+Notes specific to OS/2 port:
+============================
+
+Filenames have been shortened to 8.3 in case anyone is using FAT.
+Files affected are:
+smb.conf -> smb.cfg smbclient -> smbclnt.exe
+smbstatus -> smbstat.exe nmblookup -> nmblook.exe
+
+As I only use HPFS, I can't guarantee this will work on FAT systems,
+although I have tried to stick to 8.3 filenames. I have noticed some
+temporary files being created with long filenames by smbd when I tried
+printing (which does not work yet anyway). nmbd will not be able to
+create browse lists on FAT systems, as it uses temporary files with
+long file names.
+
+smb.cfg should be in the directory smbd is started from. The path to
+smb.cfg is a compile time option, so if you are compiling from source
+you can set this to an absolute path to remove this restriction.
+
+User home directories not supported. This doesn't make much sense on
+OS/2. I haven't actually disabled anything, so if you try setting
+this up, behaivour is undefined.
+
+Password support is incomplete (I have found a crypt() routine, but
+lack of passwd file support in the EMX libraries make support difficult
+without major changes).
+
+Printing does not appear to be working. OS/2's lpq gives output in a
+different format than the versions of lpq already supported by samba.
+This will be easy to accomodate, but there is not much point until I can
+get lpr working properly.
+
+
+
+Source is available from the Samba WWW site :
+
+http://samba.canberra.edu.au/pub/samba/
+
+EMX 0.9b is available from hobbes.nmsu.edu, ftp.cdrom.com, ftp.leo.org and
+other OS/2 FTP sites. emxrt.zip contains the required libraries.
+
+Bugs:
+=====
+
+Known problems:
+===============
+
+Printing does not work. I have tried using REXX scripts with path info
+built in, and watched the processes startup properly but nothing comes
+out of the printer (remote via lpr in this case).
+If you can get it going, please let me know how you did it.
+
+The output from OS/2's lpq.exe is not understood by smbd, so all querys
+about the print queue say it is empty. Printing doesn't work anyway,
+so I have not attempted to fix this yet.
+
+Temporary files are created with long filenames (when printing, and updating
+browse list)
+
+Bug reports for the OS/2 port should be sent to Jason Rumney <jasonr@pec.co.nz>.
+
+Change log:
+===========
+
+Changes from release 1 to release 2.
+
+nmblookup (nmblook.exe) is included, and works.
+
+An attempt at password support was made using the gnuufc crypt routines,
+but then I found that a lot of functions in the EMX libraries to do with
+passwd files don't actually do anything.
+
+Browse lists should now work if you use HPFS and set your lock directory
+to an absolute pathname.
diff --git a/docs/Warp.txt b/docs/Warp.txt
new file mode 100644
index 00000000000..9b8e6782ba5
--- /dev/null
+++ b/docs/Warp.txt
@@ -0,0 +1,99 @@
+Here is some advice from maxfield@ctelcom.uucp.netcom.com (Wade Maxfie
+to use Samba with OS/2 Warp.
+
+Note that you may also find ftp://ftp.cdrom.com/pub/os2/new/os2net.faq
+useful.
+
+
+
+ Can I use Samba with Warp?
+
+ Yes. The MSClient software at ftp.microsoft.com in the Bussys
+(lanman os2 directory) will work, sort of. It is version 2.2c.
+
+ First, uncloack os2ver. (attrib -h -r -s c:\os2ver). It is a
+text file. change netwksta.xxx to 20=netwksta.sys. Also add
+20=setup.exe. Another change will be needed, a .vdd file. I remember
+it came up during the installation as being a wrong version. I wrote
+the name down, changed os2ver to include it, and restarted the
+installation.
+
+ Here is a copy of my os2ver
+
+setup.exe
+netbios.os2
+nwifs.ifs
+netwksta.sys
+nwreq.sys
+netbios.sys
+ipx.sys
+netvdd.sys
+
+Re-cloak os2ver. (attrib +h +r +s c:\os2ver)
+
+Run the installation from an OS/2 Box. Note that your mouse wont work,
+use the TAB key to move around, enter to select hilighted items.
+
+Here is a copy of my Config.sys file regarding the Laman entries.
+Note even though the version is 2.2c, it reports 2.2a in the text.
+
+REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN 2.
+DEVICE=C:\LANMAN\DRIVERS\PROTMAN\PROTMAN.OS2 /i:C:\LANMAN
+DEVICE=C:\LANMAN\DRIVERS\ETHERNET\Ns2000\Ns2000.OS2
+RUN=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\starttcp.exe
+RUN=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\startnb.exe
+DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\tcpdrv.os2
+DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\nbdrv.os2
+DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\nmdrv.os2
+DEVICE=C:\LANMAN\arpa\sockdrv.os2
+DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\NETBEUI\NETBEUI.OS2
+DEVICE=C:\LANMAN\NETPROG\RDRHELP.SYS
+IFS=C:\LANMAN\NETPROG\NETWKSTA.SYS /i:C:\LANMAN
+DEVICE=C:\LANMAN\NETPROG\NETVDD.SYS
+REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN 2.
+
+
+ If you have an NE2000 card, don't reboot, or you'll be sorry.
+enable the automatic backup mechanism for recovering old config.sys and
+other files in OS/2. It paid for itself during this installation nightm
+before I knew better!)
+
+ Next, (or perhaps before this), if you have an NE2000 adaptor,
+get the ns2000 files from hobbes.nmsu.edu (in ns2000.zip). I manually
+patched protocol.ini to refer to that adaptor, and copied it into my
+c:\lanman directory. Note that I also modified the driver to be loaded
+in the config.sys to the ns2000.os2. It might install as an "other"
+adaptor.
+
+ A command file "startup.cmd" is placed in c:\. This file is
+automatically run when OS/2 Warp starts.
+Here is a copy of my startup file. Note that Warp sometimes fails to
+login properly to the server. I solve this by checking for the
+existance of a file, and rerunning the loing if that file fails to
+exist.
+
+@REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN
+NET START WORKSTATION
+:relogin
+NET LOGON maxfield mypassword /y
+rem net use f: \\packard90\d$
+rem net use g: \\linuxone\cdromsdir
+rem net use h: \\linuxone\public
+:doOver
+if not exist f:\wildcat\wildcat.exe goto relogin
+@REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN
+exit
+
+ Finally, the system expects to be on a domain with a domain
+server. BTW, TCP/IP and NetBeui allow simultaneous communication with
+Os/2 lanserver 4.0, and Samba. (Note: Lanserver 4.0 won't yet to
+TCP/IP. (Well,it might, but it crashes before I get to that point, so I
+havent' been able to enable it))
+
+I have not yet tried with only a SAMBA server on the domain.
+
+ I would be glad to try to answer any questions at above e-mail
+address, if I can.
+
+wade
+
diff --git a/docs/announce b/docs/announce
index f761320f43e..78775aa5ca3 100644
--- a/docs/announce
+++ b/docs/announce
@@ -93,8 +93,8 @@ on who did what bits.
Where can I get it?
-------------------
-The package is available via anonymous ftp from nimbus.anu.edu.au in
-the directory pub/tridge/samba/.
+The package is available via anonymous ftp from samba.anu.edu.au in
+the directory pub/samba/.
What about SMBServer?
---------------------
@@ -123,7 +123,7 @@ There is also often quite a bit of discussion about Samba on the
newsgroup comp.protocols.smb.
A WWW site with lots of Samba info can be found at
-http://lake.canberra.edu.au/pub/samba/
+http://samba.canberra.edu.au/pub/samba/
Andrew Tridgell (Contact: samba-bugs@anu.edu.au)
January 1995
diff --git a/docs/manpages/nmbd.8 b/docs/manpages/nmbd.8
index e42f194cdee..72e45b9d54b 100644
--- a/docs/manpages/nmbd.8
+++ b/docs/manpages/nmbd.8
@@ -56,10 +56,6 @@ is by default the name of the host it is running on, but this can be overriden
with the
.B -n
option (see "OPTIONS" below). Using the
-.B -S
-option (see "OPTIONS" below), it can also be instructed to respond with IP
-information about other hosts, provided they are locatable via the
-gethostbyname() call, or they are in a netbios hosts file.
Nmbd can also be used as a WINS (Windows Internet Name Server)
server. It will do this automatically by default. What this basically
diff --git a/docs/manpages/samba.7 b/docs/manpages/samba.7
index 0c81f736b6e..bea20555e73 100644
--- a/docs/manpages/samba.7
+++ b/docs/manpages/samba.7
@@ -45,7 +45,7 @@ encouraged to distribute copies of the Samba suite, but please keep it
intact.
The latest version of the Samba suite can be obtained via anonymous
-ftp from nimbus.anu.edu.au in the directory pub/tridge/samba/. It is
+ftp from samba.anu.edu.au in the directory pub/samba/. It is
also available on several mirror sites worldwide.
You may also find useful information about Samba on the newsgroup
@@ -54,7 +54,7 @@ the mailing list are given in the README file that comes with Samba.
If you have access to a WWW viewer (such as Netscape or Mosaic) then
you will also find lots of useful information, including back issues
-of the Samba mailing list, at http://lake.canberra.edu.au/pub/samba/
+of the Samba mailing list, at http://samba.canberra.edu.au/pub/samba/
.SH AUTHOR
diff --git a/docs/manpages/smbclient.1 b/docs/manpages/smbclient.1
index 5590e01296e..be3a953266f 100644
--- a/docs/manpages/smbclient.1
+++ b/docs/manpages/smbclient.1
@@ -36,6 +36,9 @@ smbclient \- ftp-like Lan Manager client program
.B -n
.I netbios name
] [
+.B -W
+.I workgroup
+] [
.B -O
.I socket options
] [
@@ -323,6 +326,14 @@ uppercase) as its netbios name. This parameter allows you to override
the host name and use whatever netbios name you wish.
.RE
+.B -W
+.I workgroup
+
+.RS 3
+Override what workgroup is used for the connection. This may be needed
+to connect to some servers.
+.RE
+
.B -p
.I port number
.RS 3
diff --git a/docs/samba.faq b/docs/samba.faq
new file mode 100644
index 00000000000..e58c88bc18f
--- /dev/null
+++ b/docs/samba.faq
@@ -0,0 +1,538 @@
+
+ Frequently Asked Questions
+
+ about the
+
+ SAMBA Suite
+
+ (FAQ version 1.9.15a, Samba version 1.09.15)
+
+-------------------------------------------------------------------------------
+
+This FAQ was originally prepared by Karl Auer (Karl.Auer@anu.edu.au) and is
+currently maintained by Paul Blackman (ictinus@lake.canberra.edu.au).
+
+As Karl originally said, 'this FAQ was prepared with lots of help from numerous
+net.helpers', and that's the way I'd like to keep it. So if you find anything
+that you think should be in here don't hesitate to contact me.
+
+Thanks to Karl for the work he's done, and continuing thanks to Andrew Tridgell
+for developing Samba.
+
+Note: This FAQ is (and probably always will be) under construction. Some
+sections exist only as optimistic entries in the Contents page.
+
+-------------------------------------------------------------------------------
+
+Contents
+
+ * SECTION ONE: General information
+ All about Samba - what it is, how to get it, related sources of
+ information.
+ * SECTION TWO: Compiling and installing Samba on a Unix host
+ Common problems that arise when building and installing Samba under
+ Unix.
+ * SECTION THREE: Common client problems
+ Common problems that arise when trying to communicate from a client
+ computer to a Samba server. All problems which have symptoms you see
+ at the client end will be in this section.
+ * SECTION FOUR: Specific client problems
+ This section covers problems that are specific to certain clients,
+ such as Windows for Workgroups or Windows NT. Please check Section
+ Three first!
+ * SECTION FIVE: Specific client application problems
+ This section covers problems that are specific to certain products,
+ such as Windows for Workgroups or Windows NT. Please check Sections
+ Three and Four first!
+ * SECTION SIX: Miscellaneous
+ All the questions that aren't classifiable into any other section.
+
+
+===============================================================================
+SECTION ONE: General information
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 1: What is Samba?
+
+Samba is a suite of programs which work together to allow clients to access
+to a server's filespace and printers via the SMB (Session Message Block)
+protocol. Initially written for Unix, Samba now also runs on Netware, OS/2 and
+AmigaDOS.
+
+In practice, this means that you can redirect disks and printers to Unix disks
+and printers from Lan Manager clients, Windows for Workgroups 3.11 clients,
+Windows NT clients, Linux clients and OS/2 clients. There is also a generic
+Unix client program supplied as part of the suite which allows Unix users to
+use an ftp-like interface to access filespace and printers on any other SMB
+servers. This gives the capability for these operating systems to behave much
+like a LAN Server or Windows NT Server machine, only with added functionality
+and flexibility designed to make life easier for administrators.
+
+The components of the suite are (in summary):
+
+ * smbd, the SMB server. This handles actual connections from clients,
+ doing all the file, permission and username work
+ * nmbd, the Netbios name server, which helps clients locate servers,
+ doing the browsing work and managing domains as this capability is
+ being built into Samba
+ * smbclient, the Unix-hosted client program
+ * smbrun, a little 'glue' program to help the server run external
+ programs
+ * testprns, a program to test server access to printers
+ * testparms, a program to test the Samba configuration file for
+ correctness
+ * smb.conf, the Samba configuration file
+ * smbprint, a sample script to allow a Unix host to use smbclient to
+ print to an SMB server
+ * documentation! DON'T neglect to read it - you will save a great deal
+ of time!
+
+The suite is supplied with full source (of course!) and is GPLed.
+
+The primary creator of the Samba suite is Andrew Tridgell. Later versions
+incorporate much effort by many net.helpers. The man pages and this FAQ were
+originally written by Karl Auer.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 2: What is the current version of Samba?
+
+At time of writing, the current version was 1.9.15. If you want to be sure
+check the bottom of the change-log file.
+(ftp://samba.anu.edu.au/pub/samba/alpha/change-log)
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 3: Where can I get it?
+
+The Samba suite is available via anonymous ftp from samba.anu.edu.au. The
+latest and greatest versions of the suite are in the directory:
+
+/pub/samba/
+
+Development (read "alpha") versions, which are NOT necessarily stable and which
+do NOT necessarily have accurate documentation, are available in the directory:
+
+/pub/samba/alpha
+
+Note that binaries are NOT included in any of the above. Samba is distributed
+ONLY in source form, though binaries may be available from other sites. Recent
+versions of some Linux distributions, for example, do contain Samba binaries
+for that platform.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 4: What platforms are supported?
+
+Many different platforms have run Samba successfully. The platforms most widely
+used and thus best tested are Linux and SunOS.
+
+At time of writing, the Makefile claimed support for:
+
+ * SunOS
+ * Linux with shadow passwords
+ * Linux without shadow passwords
+ * SOLARIS
+ * SOLARIS 2.2 and above (aka SunOS 5)
+ * SVR4
+ * ULTRIX
+ * OSF1 (alpha only)
+ * OSF1 with NIS and Fast Crypt (alpha only)
+ * OSF1 V2.0 Enhanced Security (alpha only)
+ * AIX
+ * BSDI
+ * NetBSD
+ * NetBSD 1.0
+ * SEQUENT
+ * HP-UX
+ * SGI
+ * SGI IRIX 4.x.x
+ * SGI IRIX 5.x.x
+ * FreeBSD
+ * NeXT 3.2 and above
+ * NeXT OS 2.x
+ * NeXT OS 3.0
+ * ISC SVR3V4 (POSIX mode)
+ * ISC SVR3V4 (iBCS2 mode)
+ * A/UX 3.0
+ * SCO with shadow passwords.
+ * SCO with shadow passwords, without YP.
+ * SCO with TCB passwords
+ * SCO 3.2v2 (ODT 1.1) with TCP passwords
+ * intergraph
+ * DGUX
+ * Apollo Domain/OS sr10.3 (BSD4.3)
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 5: How can I find out more about Samba?
+
+There are two mailing lists devoted to discussion of Samba-related matters.
+There is also the newsgroup, comp.protocols.smb, which has a great deal of
+discussion on Samba. There is also a WWW site 'SAMBA Web Pages' at
+http://samba.canberra.edu.au/pub/samba/samba.html, under which there is a
+comprehensive survey of Samba users. Another useful resource is the hypertext
+archive of the Samba mailing list.
+
+Send email to listproc@anu.edu.au. Make sure the subject line is blank, and
+include the following two lines in the body of the message:
+
+ subscribe samba Firstname Lastname
+ subscribe samba-announce Firstname Lastname
+
+Obviously you should substitute YOUR first name for "Firstname" and YOUR last
+name for "Lastname"! Try not to send any signature stuff, it sometimes confuses
+the list processor.
+
+The samba list is a digest list - every eight hours or so it regurgitates a
+single message containing all the messages that have been received by the list
+since the last time and sends a copy of this message to all subscribers.
+
+If you stop being interested in Samba, please send another email to
+listproc@anu.edu.au. Make sure the subject line is blank, and include the
+following two lines in the body of the message:
+
+ unsubscribe samba
+ unsubscribe samba-announce
+
+The From: line in your message MUST be the same address you used when you
+subscribed.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 6: Something's gone wrong - what should I do?
+
+[#] *** IMPORTANT! *** [#]
+DO NOT post messages on mailing lists or in newsgroups until you have carried
+out the first three steps given here!
+
+Firstly, see if there are any likely looking entries in this FAQ! If you have
+just installed Samba, have you run through the checklist in DIAGNOSIS.txt? It
+can save you a lot of time and effort.
+
+Secondly, read the man pages for smbd, nmbd and smb.conf, looking for topics
+that relate to what you are trying to do.
+
+Thirdly, if there is no obvious solution to hand, try to get a look at the log
+files for smbd and/or nmbd for the period during which you were having
+problems. You may need to reconfigure the servers to provide more extensive
+debugging information - usually level 2 or level 3 provide ample debugging
+info. Inspect these logs closely, looking particularly for the string "Error:".
+
+Fourthly, if you still haven't got anywhere, ask the mailing list or newsgroup.
+In general nobody minds answering questions provided you have followed the
+preceding steps. It might be a good idea to scan the archives of the mailing
+list, which are available through the Samba web site described in the previous
+section.
+
+If you successfully solve a problem, please mail the FAQ maintainer a succinct
+description of the symptom, the problem and the solution, so I can incorporate
+it in the next version.
+
+If you make changes to the source code, _please_ submit these patches so that
+everyone else gets the benefit of your work. This is one of the most important
+aspects to the maintainence of Samba. Send all patches to
+samba-bugs@samba.anu.edu.au, not Andrew Tridgell or any other individual.
+
+===============================================================================
+SECTION TWO: Compiling and installing Samba on a Unix host
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+===============================================================================
+SECTION THREE: Common client problems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 1: I can't see the Samba server in any browse lists!
+
+*** Until the FAQ can be updated, please check the file:
+*** ftp://samba.anu.edu.au/pub/samba/BROWSING.txt
+*** for more information on browsing.
+
+If your GUI client does not permit you to select non-browsable servers, you may
+need to do so on the command line. For example, under Lan Manager you might
+connect to the above service as disk drive M: thusly:
+
+ net use M: \\mary\fred
+
+The details of how to do this and the specific syntax varies from client to
+client - check your client's documentation.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 2: Some files that I KNOW are on the server doesn't show up when I view the
+ directories from my client!
+
+If you check what files are not showing up, you will note that they are files
+which contain upper case letters or which are otherwise not DOS-compatible (ie,
+they are not legal DOS filenames for some reason).
+
+The Samba server can be configured either to ignore such files completely, or
+to present them to the client in "mangled" form. If you are not seeing the
+files at all, the Samba server has most likely been configured to ignore them.
+Consult the man page smb.conf(5) for details of how to change this - the
+parameter you need to set is "mangled names = yes".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 3: Some files on the server show up with really wierd filenames when I view
+the directories from my client!
+
+If you check what files are showing up wierd, you will note that they are files
+which contain upper case letters or which are otherwise not DOS-compatible (ie,
+they are not legal DOS filenames for some reason).
+
+The Samba server can be configured either to ignore such files completely, or
+to present them to the client in "mangled" form. If you are seeing strange file
+names, they are most likely "mangled". If you would prefer to have such files
+ignored rather than presented in "mangled" form, consult the man page
+smb.conf(5) for details of how to change the server configuration - the
+parameter you need to set is "mangled names = no".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 4: My client reports "cannot locate specified computer" or similar.
+
+This indicates one of three things: You supplied an incorrect server name, the
+underlying TCP/IP layer is not working correctly, or the name you specified
+cannot be resolved.
+
+After carefully checking that the name you typed is the name you should have
+typed, try doing things like pinging a host or telnetting to somewhere on your
+network to see if TCP/IP is functioning OK. If it is, the problem is most
+likely name resolution.
+
+If your client has a facility to do so, hardcode a mapping between the hosts IP
+and the name you want to use. For example, with Man Manager or Windows for
+Workgroups you would put a suitable entry in the file LMHOSTS. If this works,
+the problem is in the communication between your client and the netbios name
+server. If it does not work, then there is something fundamental wrong with
+your naming and the solution is beyond the scope of this document.
+
+If you do not have any server on your subnet supplying netbios name resolution,
+hardcoded mappings are your only option. If you DO have a netbios name server
+running (such as the Samba suite's nmbd program), the problem probably lies in
+the way it is set up. Refer to Section Two of this FAQ for more ideas.
+
+By the way, remember to REMOVE the hardcoded mapping before further tests :-)
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 5: My client reports "cannot locate specified share name" or similar.
+
+This message indicates that your client CAN locate the specified server, which
+is a good start, but that it cannot find a service of the name you gave.
+
+The first step is to check the exact name of the service you are trying to
+connect to (consult your system administrator). Assuming it exists and you
+specified it correctly (read your client's doco on how to specify a service
+name correctly), read on:
+
+ * Many clients cannot accept or use service names longer than eight
+ characters.
+ * Many clients cannot accept or use service names containing spaces.
+ * Some servers (not Samba though) are case sensitive with service names.
+ * Some clients force service names into upper case.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 6: My client reports "cannot find domain controller", "cannot log on to the
+network" or similar.
+
+Nothing is wrong - Samba does not implement the primary domain name controller
+stuff for several reasons, including the fact that the whole concept of a
+primary domain controller and "logging in to a network" doesn't fit well with
+clients possibly running on multiuser machines (such as users of smbclient
+under Unix). Having said that, several developers are working hard on
+building it in to the next major version of Samba. If you can contribute,
+send a message to samba-bugs!
+
+Seeing this message should not affect your ability to mount redirected disks
+and printers, which is really what all this is about.
+
+For many clients (including Windows for Workgroups and Lan Manager), setting
+the domain to STANDALONE at least gets rid of the message.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 7: Printing doesn't work :-(
+
+Make sure that the specified print command for the service you are connecting
+to is correct and that it has a fully-qualified path (eg., use "/usr/bin/lpr"
+rather than just "lpr").
+
+Make sure that the spool directory specified for the service is writable by the
+user connected to the service. In particular the user "nobody" often has
+problems with printing, even if it worked with an earlier version of Samba. Try
+creating another guest user other than "nobody".
+
+Make sure that the user specified in the service is permitted to use the
+printer.
+
+Check the debug log produced by smbd. Search for the printer name and see if
+the log turns up any clues. Note that error messages to do with a service ipc$
+are meaningless - they relate to the way the client attempts to retrieve status
+information when using the LANMAN1 protocol.
+
+If using WfWg then you need to set the default protocol to TCP/IP, not Netbeui.
+This is a WfWg bug.
+
+If using the Lanman1 protocol (the default) then try switching to coreplus.
+Also not that print status error messages don't mean printing won't work. The
+print status is received by a different mechanism.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 8: My programs install on the server OK, but refuse to work properly.
+
+There are numerous possible reasons for this, but one MAJOR possibility is that
+your software uses locking. Make sure you are using Samba 1.6.11 or later. It
+may also be possible to work around the problem by setting "locking=no" in the
+Samba configuration file for the service the software is installed on. This
+should be regarded as a strictly temporary solution.
+
+In earlier Samba versions there were some difficulties with the very latest
+Microsoft products, particularly Excel 5 and Word for Windows 6. These should
+have all been solved. If not then please let Andrew Tridgell know.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 9: My "server string" doesn't seem to be recognized, my client reports the
+ default setting, eg. "Samba 1.9.15p4", instead of what I have changed it
+ to in the smb.conf file.
+
+You need to use the -C option in nmbd. The "server string" affects
+what smbd puts out and -C affects what nmbd puts out. In a future
+version these will probably be combined and -C will be removed, but
+for now use -C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 10: When I attempt to get a listing of available resources from the Samba
+ server, my client reports
+ "This server is not configured to list shared resources".
+
+Your guest account is probably invalid for some reason. Samba uses
+the guest account for browsing in smbd. Check that your guest account is
+valid.
+
+See also 'guest account' in smb.conf man page.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 11: You get the message "you appear to have a trapdoor uid system"
+ in your logs
+
+This can have several causes. It might be because you are using a uid
+or gid of 65535 or -1. This is a VERY bad idea, and is a big security
+hole. Check carefully in your /etc/passwd file and make sure that no
+user has uid 65535 or -1. Especially check the "nobody" user, as many
+broken systems are shipped with nobody setup with a uid of 65535.
+
+It might also mean that your OS has a trapdoor uid/gid system :-)
+
+This means that once a process changes effective uid from root to
+another user it can't go back to root. Unfortunately Samba relies on
+being able to change effective uid from root to non-root and back
+again to implement its security policy. If your OS has a trapdoor uid
+system this won't work, and several things in Samba may break. Less
+things will break if you use user or server level security instead of
+the default share level security, but you may still strike
+problems.
+
+The problems don't give rise to any security holes, so don't panic,
+but it does mean some of Samba's capabilities will be unavailable.
+In particular you will not be able to connect to the Samba server as
+two different uids at once. This may happen if you try to print as a
+"guest" while accessing a share as a normal user. It may also affect
+your ability to list the available shares as this is normally done as
+the guest user.
+
+Complain to your OS vendor and ask them to fix their system.
+
+===============================================================================
+SECTION FOUR: Specific client problems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 1: Are any MacIntosh clients for Samba.
+
+In Rob Newberry's words (rob@eats.com, Sun, 4 Dec 1994):
+
+The answer is "No." Samba speaks SMB, the protocol used for Microsoft networks.
+The Macintosh has ALWAYS spoken Appletalk. Even with Microsoft "services for
+Macintosh", it has been a matter of making the server speak Appletalk. It is
+the same for Novell Netware and the Macintosh, although I believe Novell has
+(VERY LATE) released an extension for the Mac to let it speak IPX.
+
+In future Apple System Software, you may see support for other protocols, such
+as SMB -- Applet is working on a new networking architecture that will make it
+easier to support additional protocols. But it's not here yet.
+
+Now, the nice part is that if you want your Unix machine to speak Appletalk,
+there are several options. "Netatalk" and "CAP" are free, and available on the
+net. There are also several commercial options, such as "PacerShare" and
+"Helios" (I think). In any case, you'll have to look around for a server, not
+anything for the Mac.
+
+Depending on you OS, some of these may not help you. I am currently
+coordinating the effort to get CAP working with Native Ethertalk under Linux,
+but we're not done yet.
+
+Rob
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 2: I am getting a "Session request failed (131,130)" error when I try to
+ connect to my Win95 PC with smbclient. I am able to connect from the PC
+ to the Samba server without problems. What gives?
+
+The following answer is provided by John E. Miller:
+
+I'll assume that you're able to ping back and forth between the machines by
+IP address and name, and that you're using some security model where you're
+confident that you've got user IDs and passwords right. The logging options
+(-d3 or greater) can help a lot with that. DNS and WINS configuration can
+also impact connectivity as well.
+
+Now, on to 'scope id's. Somewhere in your Win95 TCP/IP network configuration
+(I'm too much of an NT bigot to know where it's located in the Win95 setup,
+but I'll have to learn someday since I teach for a Microsoft Solution Provider
+Authorized Tech Education Center - what an acronym...) [Note: It's under
+Control Panel | Network | TCP/IP | WINS Configuration] there's a little text
+entry field called something like 'Scope ID'.
+
+This field essentially creates 'invisible' sub-workgroups on the same wire.
+Boxes can only see other boxes whose Scope IDs are set to the exact same
+value - it's sometimes used by OEMs to configure their boxes to browse only
+other boxes from the same vendor and, in most environments, this field should
+be left blank. If you, in fact, have something in this box that EXACT value
+(case-sensitive!) needs to be provided to smbclient and nmbd as the -i
+(lowercase) parameter. So, if your Scope ID is configured as the string
+'SomeStr' in Win95 then you'd have to use smbclient -iSomeStr <otherparms>
+in connecting to it.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 3: How do I synchronize my PC's clock with my Samba server?
+
+To syncronize your PC's clock with your Samba server:
+
+* Copy timesync.pif to your windows directory
+ * timesync.pif can be found at:
+ http://samba.canberra.edu.au/pub/samba/binaries/miscellaneous/timesync.pif
+* Add timesync.pif to your 'Start Up' group/folder
+* Open the properties dialog box for the program/icon
+ * Make sure the 'Run Minimized' option is set in program 'Properties'
+ * Change the command line section that reads \\sambahost to reflect the name
+ of your server.
+* Close the properties dialog box by choosing 'OK'
+
+Each time you start your computer (or login for Win95) your PC will
+synchronize it's clock with your Samba server.
+
+===============================================================================
+SECTION FIVE: Specific client application problems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* 1: MS Office Setup reports "Cannot change properties of the file named:
+ X:\MSOFFICE\SETUP.INI"
+
+When installing MS Office on a Samba drive for which you have admin user
+permissions, ie. admin users = <username>, you will find the setup program
+unable to complete the installation.
+
+To get around this problem, do the installation without admin user permissions
+The problem is that MS Office Setup checks that a file is rdonly by trying to
+open it for writing.
+
+Admin users can always open a file for writing, as they run as root.
+You just have to install as a non-admin user and then use "chown -R" to fix
+the owner.
+
+===============================================================================
+SECTION SIX: Miscellaneous
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Maintained By Paul Blackman, Email:ictinus@lake.canberra.edu.au
diff --git a/docs/samba.lsm b/docs/samba.lsm
index 503ba1ec94b..eacfda5ba0a 100644
--- a/docs/samba.lsm
+++ b/docs/samba.lsm
@@ -10,8 +10,8 @@ Author = Andrew Tridgell
AuthorEmail = samba-bugs@anu.edu.au
Maintainer = Andrew Tridgell
MaintEmail = samba-bugs@anu.edu.au
-Site1 = nimbus.anu.edu.au
-Path1 = pub/tridge/samba/
+Site1 = samba.anu.edu.au
+Path1 = pub/samba/
File1 = samba-latest.tar.gz
FileSize1 = 200K
Required1 = Ansi-C compiler and a TCP/IP network.
diff --git a/docs/textdocs/BUGS.txt b/docs/textdocs/BUGS.txt
index e0fd6951477..8cccfcf449e 100644
--- a/docs/textdocs/BUGS.txt
+++ b/docs/textdocs/BUGS.txt
@@ -2,10 +2,6 @@ This file describes how to report Samba bugs.
>> The email address for bug reports is samba-bugs@anu.edu.au <<
-(NOTE: This mail may not be in place yet. If you have troubles with it
-then use samba-bugs@arvidsjaur.anu.edu.au)
-
-
Please take the time to read this file before you submit a bug
report. Also, please see if it has changed between releases, as I
may be changing the bug reporting mechanism sometime soon.
@@ -17,15 +13,14 @@ of an answer and a fix if you send me a "developer friendly" bug
report that lets me fix it fast.
Do not assume that if you post the bug to the comp.protocols.smb
-newsgroup that I will read it. I do read all postings to the samba
-mailing list (see the README). If you suspect that your problem is not
-a bug but a configuration problem then it is better to send it to the
-Samba mailing list, as there are (at last count) 1900 other users on
+newsgroup or the mailing list that I will read it. If you suspect that your
+problem is not a bug but a configuration problem then it is better to send
+it to the Samba mailing list, as there are (at last count) 1900 other users on
that list that may be able to help you.
You may also like to look though the recent mailing list archives,
which are conveniently accessible on the Samba web pages
-at http://lake.canberra.edu.au/pub/samba/
+at http://samba.canberra.edu.au/pub/samba/
GENERAL INFO
@@ -36,6 +31,8 @@ errors. Look in your log files for obvious messages that tell you that
you've misconfigured something and run testparm to test your config
file for correct syntax.
+Have you run through DIAGNOSIS.txt? This is very important.
+
If you include part of a log file with your bug report then be sure to
annotate it with exactly what you were doing on the client at the
time, and exactly what the results were.
diff --git a/docs/textdocs/DIAGNOSIS.txt b/docs/textdocs/DIAGNOSIS.txt
index 6681bdc4bcb..ad3eb449314 100644
--- a/docs/textdocs/DIAGNOSIS.txt
+++ b/docs/textdocs/DIAGNOSIS.txt
@@ -86,7 +86,13 @@ If you get a "session request failed" then the server refused the
connection. If it says "your server software is being unfriendly" then
its probably because you have invalid command line parameters to smbd,
or a similar fatal problem with the initial startup of smbd. Also
-check your config file for syntax errors with "testparm".
+check your config file for syntax errors with "testparm".
+
+Another common cause of these two errors is having something already running
+on port 139, such as Samba (ie smbd is running from inetd already) or something
+like Digital's Pathworks. Check your inetd.conf file before trying to start
+smbd as a daemon, it can avoid a lot of frustration!
+
TEST 4:
-------
diff --git a/docs/textdocs/HINTS.txt b/docs/textdocs/HINTS.txt
index 953650bdd3e..eedd0bf36e1 100644
--- a/docs/textdocs/HINTS.txt
+++ b/docs/textdocs/HINTS.txt
@@ -40,7 +40,7 @@ Jim barry has written an excellent drag-and-drop cr/lf converter for
windows. Just drag your file onto the icon and it converts the file.
Get it from
-ftp://nimbus.anu.edu.au/pub/tridge/samba/contributed/fixcrlf.zip
+ftp://samba.anu.edu.au/pub/samba/contributed/fixcrlf.zip
----------------------
HINT: Use the "username map" option
diff --git a/docs/textdocs/Support.txt b/docs/textdocs/Support.txt
index d71bdaf7b3e..3a41ba52bc0 100644
--- a/docs/textdocs/Support.txt
+++ b/docs/textdocs/Support.txt
@@ -41,11 +41,13 @@ of the SAMBA Web Pages.
------------------------------------------------------------------------------
READING - ENGLAND
-Philip Hands | E-Mail: info@hands.com
-Philip Hands Computing Ltd. | Tel: +44 1734 476287 Fax: 1734 474655
-Unit 1, Cherry Close, Caversham, Reading RG4 8UP UK
+Philip Hands | E-Mail: info@hands.com Tel:+44 1734 545656
+Philip Hands Computing Ltd. | Mobile: +44 802 242989 Fax:+44 1734 474655
+Unit 1, Cherry Close, Caversham, Reading RG4 8UP ENGLAND
-Samba experience: SVR4,SVR3.2 & Linux <--> WfWg, W3.1, OS2 and MS-LanMan
+Samba experience:
+ Server platforms: Linux,SVR4,SVR3.2 & Sequent ptx
+ Clients: WfWg, W3.1, OS2 and MS-LanMan
------------------------------------------------------------------------------
------------------------------------------------------------------------------
@@ -243,15 +245,15 @@ LE12 8DX
TELEPHONE 01509-620922
FAX 01509-620933
-CONTACT DAVID ROBINSON
+Contact David Robinson
-WE ARE UNIX ORIENTATED BUT ALSO SPECIALISE IN PC TO UNIX COMMUNICATIONS, WE
-KNOW AND UNDERSTAND PC-NFS, (HENCE OUR INTEREST IN SAMBA).
-WE SUPPORT SUNOS, SOLARIS 1.X AND 2.X, HP-UX 9.0 AND 10.0, OSF (or DEC UNIX,
-whichever you prefer), WinNT, WfWG and Win95.
+We are unix orientated but also specialise in pc to unix communications, we
+know and understand pc-nfs, (hence our interest in samba).
+we support sunos, solaris 1.x and 2.x, hp-ux 9.0 and 10.0, osf (or dec unix,
+whichever you prefer), winnt, wfwg and win95.
-WE ARE ALREADY TALKING TO A COUPLE OF VERY LARGE SAMBA USERS HERE IN THE UK.
-WE WOULD LIKE TO SUPPORT THEM (AND MANY MORE), WOULD YOU PLEASE CONTACT ME ON:
+We are already talking to a couple of very large samba users here in the uk.
+we would like to support them (and many more), would you please contact me on:
david@tectonic.demon.co.uk
----------------------------------------------------------
@@ -357,6 +359,8 @@ rowl@earthlink.net
Michael St. Laurent
Hartwell Corporation
------------------------------------------------------------------------------
+
+------------------------------------------------------------------------------
WASHINGTON DC METRO - USA
Asset Software, Inc. has been running Samba since the 1.6 release on various
@@ -374,3 +378,18 @@ David J. Fenwick Asset Software, Inc.
President djf@assetsw.com
------------------------------------------------------------------------------
+
+------------------------------------------------------------------------------
+WELLINGTON - NEW ZEALAND
+
+David Gempton
+Computer Consultant
+UNIX & PC Networking specialist
+TTC Technology Training Consulting
+PO Box 5444
+Lambton Quay Wellington
+New Zealand
+Phone (025) 518-574
+Email: ttcdg@cyberspace.co.nz
+------------------------------------------------------------------------------
+
diff --git a/docs/textdocs/UNIX-SMB.txt b/docs/textdocs/UNIX-SMB.txt
index b2c064215cf..92167a9e843 100644
--- a/docs/textdocs/UNIX-SMB.txt
+++ b/docs/textdocs/UNIX-SMB.txt
@@ -155,6 +155,9 @@ within the one process. On some unixes (such as SCO) this is not
possible. This means that on those unixes the client is restricted to
a single uid.
+Note that you can also get the "trapdoor uid" message for other
+reasons. Please see the FAQ for details.
+
Port numbers
============
diff --git a/examples/misc/extra_smbstatus b/examples/misc/extra_smbstatus
index b018f3dcce9..363e7f67af5 100644
--- a/examples/misc/extra_smbstatus
+++ b/examples/misc/extra_smbstatus
@@ -10,28 +10,31 @@ added things at source level, script was quick&easy.
if ($1 == "-p") then
smbstatus -p |sort -u
else if ($1 == "-c") then
- echo There are `smbstatus -p |sort -u |grep -n -v z |grep -c :` unique
-smbd processes running.
+ echo There are `smbstatus -p |sort -u |grep -n -v z |grep -c :` unique smbd processes running.
else if ($1 == "-l") then
- echo `date '+ %d/%m/%y %H:%M:%S'` `smbstatus -p |sort -u |grep -n -v z
-|grep -c :` >>$2
+ echo `date '+ %d/%m/%y %H:%M:%S'` `smbstatus -p |sort -u |grep -n -v z |grep -c :` >>$2
+else if ($1 == "-cs") then
+ echo There are `smbstatus |awk '$1==share {n++;} END {print n}' share=$2` concurrent connections to share: $2
+else if ($1 == "-csl") then
+ echo `date '+ %d/%m/%y %H:%M:%S'` `smbstatus |awk '$1==share {n++;} END {print n}' share=$2` >>$3
else
- smbstatus |sort +3 -4 -u
+ echo "'smbstat -c' ==> Count unique smbd processes."
+ echo "'smbstat -p' ==> List unique smbd processes."
+ echo "'smbstat -l logfile' ==> Append a log entry for the number of"
+ echo " concurrent and unique processes to logfile."
+ echo "'smbstat -cs sharename'"
+ echo " ==> Count processes connected to sharename (assumed unique)"
+ echo "'smbstat -csl sharename logfile'"
+ echo " ==> Append a log entry for the number of concurrent"
+ echo " processes connected to sharename (assumed unique)"
endif
******
-The '-p' option was just to show unique PIDs.
+Run this script from cron eg.
-The more important ones are the '-c' and '-l' options '-c' just counts
-the number of unique smbd's, While '-l' logs this count with date and
-time to a log file specified on the command line. I'm using '-l' at
-the moment with cron to give me an idea of usage/max connections etc.
-I was also thinking of doing a log for individual/specified services.
+0,5,10,15,20,25,30,35,40,50,55 * * * * /usr/local/samba/bin/smbstat -l /usr/local/samba/var/smbdcount.log
-The default (last) option was to show unique PIDs with user names.
-Unfortunately this still lists all file locks etc. This would be
-better with a 'no locked files' option from smbstatus (or is there one
-that I didn't see)
+and you get a good idea of usage over time.
Cheers,
~^ MIME OK ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
diff --git a/examples/misc/wall.perl b/examples/misc/wall.perl
index fc3dc2e2c05..9303658ce14 100644
--- a/examples/misc/wall.perl
+++ b/examples/misc/wall.perl
@@ -6,40 +6,64 @@
#@(#) ...using "smbclient -M" message to winpopup service.
#@(#) Default usage is to message every connected PC.
#@(#) Alternate usage is to message every pc on the argument list.
-#@(#) Hacked up by Keith Farrar <farrar@parc.xerox.com>
+#@(#) Hacked up by Keith Farrar <farrar@parc.xerox.com>
#
+# Cleanup and corrections by
+# Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
+# Message to send can be now also fed (quietly) from stdin; a pipe will do.
#=============================================================================
-$smbstatus = "/usr/local/bin/smbstatus";
-$smbclient = "/usr/local/bin/smbclient";
-print STDOUT "\nEnter message for Samba clients of this host\n";
-print STDOUT "(terminated with single '.' or end of file):\n";
+$smbstatus = "/usr/local/bin/smbstatus";
+$smbshout = "/usr/local/bin/smbclient -M";
-while ( <STDIN> ) {
- /^\.$/ && last;
- push(@message, $_);
+if (@ARGV) {
+ @clients = @ARGV;
+ undef @ARGV;
}
+else { # no clients specified explicitly
+ open(PCLIST, "$smbstatus |") || die "$smbstatus failed!.\n$!\n";
+ while(<PCLIST>) {
+ last if /^Locked files:/;
+ split(' ', $_, 6);
+ # do not accept this line if less then six fields
+ next unless $_[5];
+ # if you have A LOT of clients you may speed things up by
+ # checking pid - no need to look further if this pid was already
+ # seen; left as an exercise :-)
+ $client = $_[4];
+ next unless $client =~ /^\w+\./; # expect 'dot' in a client name
+ next if grep($_ eq $client, @clients); # we want this name once
+ push(@clients, $client);
+ }
+ close(PCLIST);
+}
+
+if (-t) {
+ print <<'EOT';
-if ( $ARGV[0] ne "" ) {
- $debug && print STDOUT "Was given args: \n\t @ARGV\n";
- foreach $client ( @ARGV ) {
- $pcclient{$client} = $client;
- }
-} else {
- open( PCLIST, "$smbstatus | /bin/awk '/^[a-z]/ {print $5}' | /bin/sort | /bin/uniq|");
- while ( <PCLIST> ) {
- /^[a-z]+[a-z0-9A-Z-_]+.+/ || next;
- ($share, $user, $group, $pid, $client, @junk) = split;
- $pcclient{$client} = $client;
- }
- close(PCLIST);
+Enter message for Samba clients of this host
+(terminated with single '.' or end of file):
+EOT
+
+ while (<>) {
+ last if /^\.$/;
+ push(@message, $_);
+ }
+}
+else { # keep quiet and read message from stdin
+ @message = <>;
}
-foreach $pc ( keys(%pcclient) ) {
- print STDOUT "Sending message ";
- $debug && print STDOUT " <@message> \n";
- print STDOUT "To <$pc>\n";
- open(SENDMSG,"|$smbclient -M $pc") || next;
+foreach(@clients) {
+## print "To $_:\n";
+ if (open(SENDMSG,"|$smbshout $_")) {
print SENDMSG @message;
close(SENDMSG);
+ }
+ else {
+ warn "Cannot notify $_ with $smbshout:\n$!\n";
+ }
}
+
+exit 0;
+
diff --git a/source/.cvsignore b/source/.cvsignore
new file mode 100644
index 00000000000..b7fca32bb4a
--- /dev/null
+++ b/source/.cvsignore
@@ -0,0 +1,10 @@
+Makefile.ajt
+nmbd
+nmblookup
+smbclient
+smbd
+smbpasswd
+smbrun
+smbstatus
+testparm
+testprns
diff --git a/source/change-log b/source/change-log
index e120ac6f02a..ee49663ed6e 100644
--- a/source/change-log
+++ b/source/change-log
@@ -1793,6 +1793,9 @@ NOTE: THIS LOG IS IN CHRONOLOGICAL ORDER
- Linux quota patch from xeno@mix.hsv.no
- try to work around NT passlen2 problem in session setup
- released alpha1
+
+NOTE: From now on the cvs.log file will be used to give a complete log of
+changes to samba. This change-log is now obsolete.
==========
diff --git a/source/client/client.c b/source/client/client.c
index 504cb5a0bb4..5542e2f479d 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -2131,13 +2131,12 @@ static void cmd_mput(void)
strcpy(rname,cur_dir);
strcat(rname,lname);
- if (!do_mkdir(rname))
- {
- strcat(lname,"/");
- if (!seek_list(f,lname))
- break;
- goto again1;
- }
+ if (!chkpath(rname,False) && !do_mkdir(rname)) {
+ strcat(lname,"/");
+ if (!seek_list(f,lname))
+ break;
+ goto again1;
+ }
continue;
}
@@ -3182,19 +3181,36 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu
strcpy(pword, ""); passlen=1;
}
- set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True);
- CVAL(outbuf,smb_com) = SMBtconX;
- setup_pkt(outbuf);
-
- SSVAL(outbuf,smb_vwv0,0xFF);
- SSVAL(outbuf,smb_vwv3,passlen);
+ if (Protocol <= PROTOCOL_CORE) {
+ set_message(outbuf,0,6 + strlen(service) + passlen + strlen(dev),True);
+ CVAL(outbuf,smb_com) = SMBtcon;
+ setup_pkt(outbuf);
- p = smb_buf(outbuf);
- memcpy(p,pword,passlen);
- p += passlen;
- strcpy(p,service);
- p = skip_string(p,1);
- strcpy(p,dev);
+ p = smb_buf(outbuf);
+ *p++ = 0x04;
+ strcpy(p, service);
+ p = skip_string(p,1);
+ *p++ = 0x04;
+ memcpy(p,pword,passlen);
+ p += passlen;
+ *p++ = 0x04;
+ strcpy(p, dev);
+ }
+ else {
+ set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True);
+ CVAL(outbuf,smb_com) = SMBtconX;
+ setup_pkt(outbuf);
+
+ SSVAL(outbuf,smb_vwv0,0xFF);
+ SSVAL(outbuf,smb_vwv3,passlen);
+
+ p = smb_buf(outbuf);
+ memcpy(p,pword,passlen);
+ p += passlen;
+ strcpy(p,service);
+ p = skip_string(p,1);
+ strcpy(p,dev);
+ }
}
send_smb(Client,outbuf);
@@ -3225,11 +3241,18 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu
}
- max_xmit = MIN(max_xmit,BUFFER_SIZE-4);
- if (max_xmit <= 0)
- max_xmit = BUFFER_SIZE - 4;
+ if (Protocol <= PROTOCOL_CORE) {
+ max_xmit = SVAL(inbuf,smb_vwv0);
- cnum = SVAL(inbuf,smb_tid);
+ cnum = SVAL(inbuf,smb_vwv1);
+ }
+ else {
+ max_xmit = MIN(max_xmit,BUFFER_SIZE-4);
+ if (max_xmit <= 0)
+ max_xmit = BUFFER_SIZE - 4;
+
+ cnum = SVAL(inbuf,smb_tid);
+ }
DEBUG(3,("Connected with cnum=%d max_xmit=%d\n",cnum,max_xmit));
diff --git a/source/cvs.log b/source/cvs.log
new file mode 100644
index 00000000000..be24c06d162
--- /dev/null
+++ b/source/cvs.log
@@ -0,0 +1,757 @@
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:32
+Author: samba-bugs
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8106
+
+Modified Files:
+ includes.h
+Log Message:
+added sequent fixes
+
+
+
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:43
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8316
+
+Modified Files:
+ ipc.c
+Log Message:
+use the new issafe() macro instead of isalnum() and strchr()
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:44
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8360
+
+Modified Files:
+ mangle.c
+Log Message:
+move the dot_pos calculation down a bit
+
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:45
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8389
+
+Modified Files:
+ password.c
+Log Message:
+fix a netgroup bug (innetgr() was being called with the args in the
+wrong order!)
+
+
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:48
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8426
+
+Modified Files:
+ server.c
+Log Message:
+- use issafe()
+
+- map the archive bit in a more robust manner. We now set it when we
+first write to the file after opening it.
+
+
+
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:49
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv8458
+
+Modified Files:
+ util.c
+Log Message:
+fix a dst bug, we had a sign wrong in the calculation :-(
+
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 20:51
+Author: tridge
+
+Update of /data/cvs/samba/examples/misc
+In directory arvidsjaur:/var/tmp/cvs-serv8546
+
+Modified Files:
+ wall.perl
+Log Message:
+updates to wall.perl from michal@ellpspace.math.ualberta.ca
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 23:13
+Author: samba-bugs
+
+Update of /data/cvs/samba
+In directory arvidsjaur:/var/tmp/cvs-serv13363/samba
+
+Modified Files:
+ README
+Log Message:
+Changed to reflect new ownership by Microsoft
+
+
+
+****************************************
+Date: Saturday May 4, 1996 @ 23:16
+Author: tridge
+
+Update of /data/cvs/samba
+In directory arvidsjaur:/var/tmp/cvs-serv13433
+
+Modified Files:
+ README
+Log Message:
+removed obscene comment added by Dan
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 13:04
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv587
+
+Modified Files:
+ server.c
+Log Message:
+- close the listening socket in the child process when running as a daemon
+- exit with a non-zero exit code if open_sockets() fails
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 13:04
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv615
+
+Modified Files:
+ version.h
+Log Message:
+change version number to 1.9.16p2
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 17:19
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/samba/samba-bugs/samba/docs
+
+Modified Files:
+ Support.txt
+Log Message:
+added some more support entries from samba-bugs mail
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 18:02
+Author: tridge
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv6791
+
+Modified Files:
+ nmbd.8
+Log Message:
+removed old -S option from nmbd manpage
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 18:03
+Author: tridge
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv6832
+
+Modified Files:
+ smbclient.1
+Log Message:
+documented -W option
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:08
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10254
+
+Added Files:
+ .cvsignore
+Log Message:
+ignore some files
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:10
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10352
+
+Modified Files:
+ Makefile
+Log Message:
+- added NEWOS 6 support
+
+- added quotas.o
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:12
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10423
+
+Modified Files:
+ client.c
+Log Message:
+- handle CORE protocol better
+- handle case where director exists when untarring
+
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:23
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10576
+
+Modified Files:
+ dir.c
+Log Message:
+handle being passed a dptr of -1 to mean "close all open dir handles".
+Looks like OS/2 does this. It caused a core dump.
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:24
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10602
+
+Modified Files:
+ local.h
+Log Message:
+turn on KEEP_PASSWORD_SERVER_OPEN by default
+
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:24
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10629
+
+Modified Files:
+ password.c
+Log Message:
+turn on KEEP_PASSWORD_SERVER_OPEN by default
+
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:25
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10657
+
+Added Files:
+ quotas.c
+Log Message:
+move quotas support out of server.c
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:26
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10682
+
+Modified Files:
+ server.c
+Log Message:
+- fix a bug hanlding very log filenames
+- move quotas support to separate file
+- send keepalives to password server
+
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:33
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10862
+
+Modified Files:
+ status.c
+Log Message:
+- added hostname support to smbstatus
+- fix a bug where -s would not be recognised
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:34
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10889
+
+Modified Files:
+ trans2.c
+Log Message:
+made dptr_num signed to handle -1 from OS/2
+
+
+
+
+
+
+
+
+****************************************
+Date: Sunday May 5, 1996 @ 21:35
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv10930
+
+Modified Files:
+ version.h
+Log Message:
+fixed version number (again!)
+
+
+
+
+
+
+
+
+
+****************************************
+Date: Monday May 6, 1996 @ 10:36
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/samba/samba-bugs/samba/docs
+
+Modified Files:
+ MIRRORS
+Log Message:
+added QNX entry to MIRRORS
+
+
+
+****************************************
+Date: Monday May 6, 1996 @ 16:46
+Author: samba-bugs
+
+Update of /data/cvs/samba/examples/misc
+In directory arvidsjaur:/var/tmp/cvs-serv5225
+
+Modified Files:
+ extra_smbstatus
+Log Message:
+Updated smbstat script with a better one, Paul.
+
+
+
+****************************************
+Date: Monday May 6, 1996 @ 18:55
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv8483
+
+Modified Files:
+ BUGS.txt MIRRORS README.OS2 announce samba.7
+Log Message:
+Updated references in doco to 'http://lake.can.....'
+with 'http://samba.can.....' and added a mirror site to MIRROR
+
+
+
+****************************************
+Date: Monday May 6, 1996 @ 19:16
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv8786
+
+Modified Files:
+ samba.faq
+Log Message:
+Update the samba.faq file with what was current on the web site, there
+were a number of additions.
+Changed the faq version number to 1.9.15 to match current samba version.
+
+
+
+****************************************
+Date: Friday May 17, 1996 @ 10:43
+Author: samba-bugs
+
+Update of /data/cvs/samba
+In directory arvidsjaur:/var/tmp/cvs-serv32671
+
+Modified Files:
+ README
+Log Message:
+
+Made chang
+blody comso: can't see what i'm writing...
+Made changes to reflect nimbus.anu.edu.au -> samba.anu.edu.au chage.
+changed reference to /ub/samba/change-log o /ub/samba/alpha/change-log
+Also added samba.faq.html to docs directory
+Paul...
+
+
+
+
+****************************************
+Date: Friday May 17, 1996 @ 10:43
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv32671/docs
+
+Modified Files:
+ samba.faq
+Log Message:
+
+Made chang
+blody comso: can't see what i'm writing...
+Made changes to reflect nimbus.anu.edu.au -> samba.anu.edu.au chage.
+changed reference to /ub/samba/change-log o /ub/samba/alpha/change-log
+Also added samba.faq.html to docs directory
+Paul...
+
+
+
+
+****************************************
+Date: Monday May 20, 1996 @ 18:11
+Author: samba-bugs
+
+Update of /data/cvs/samba
+In directory arvidsjaur:/var/tmp/cvs-serv27227
+
+Modified Files:
+ README
+Log Message:
+Changed more references of 'nimbus.anu.edu.au/pub/tridge/samba' to
+'samba.anu.edu.au/pub/samba'
+The only reference I see now to 'nimbus' is in ENCRYPTION.txt regarding
+libdes stuff.
+Paul...
+
+
+
+****************************************
+Date: Monday May 20, 1996 @ 18:11
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv27227/docs
+
+Modified Files:
+ HINTS.txt MIRRORS announce samba.7 samba.lsm
+Log Message:
+Changed more references of 'nimbus.anu.edu.au/pub/tridge/samba' to
+'samba.anu.edu.au/pub/samba'
+The only reference I see now to 'nimbus' is in ENCRYPTION.txt regarding
+libdes stuff.
+Paul...
+
+
+
+****************************************
+Date: Friday May 24, 1996 @ 9:23
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv2665/samba/docs
+
+Modified Files:
+ DIAGNOSIS.txt
+Log Message:
+Added check for something already binding to port 139 to TEST 3
+ Dan
+
+
+
+****************************************
+Date: Friday May 24, 1996 @ 9:45
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv2938/samba/docs
+
+Modified Files:
+ samba.faq
+Log Message:
+Updated general section to include more about current capabilities. Added
+references to samba-bugs, DIAGNOSIS.txt and the hypermail archives. Various
+other small changes.
+ Dan
+
+
+
+****************************************
+Date: Friday May 24, 1996 @ 9:50
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv3028/samba/docs
+
+Modified Files:
+ BUGS.txt
+Log Message:
+Added reference to DIAGNOSIS.txt. Deleted the claim that tridge reads all
+postings to mailing list. Removed arvidsjaur, other small stuff.
+ Dan
+
+
+
+****************************************
+Date: Friday May 24, 1996 @ 9:54
+Author: samba-bugs
+
+Update of /data/cvs/samba
+In directory arvidsjaur:/var/tmp/cvs-serv3126/samba
+
+Modified Files:
+ README
+Log Message:
+General updating.
+ Dan
+
+
+
+****************************************
+Date: Tuesday May 28, 1996 @ 23:39
+Author: samba-bugs
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/samba/samba-bugs/samba/docs
+
+Modified Files:
+ MIRRORS
+Log Message:
+added nimbus to list of mirrors
+
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 13:11
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv13319
+
+Modified Files:
+ util.c
+Log Message:
+cleaned up the way the max log size stuff works and fixed a potential
+problem with varargs usage in Debug()
+
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 14:34
+Author: samba-bu
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/samba/samba-bugs/samba/source
+
+Modified Files:
+ change-log
+Log Message:
+preparing for release of 1.9.16alpha2
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 14:35
+Author: samba-bu
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/samba/samba-bugs/samba/source
+
+Added Files:
+ cvs.log
+Log Message:
+preparing for release of 1.9.16alpha2
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 17:45
+Author: tridge
+
+Update of /data/cvs/samba/docs
+In directory arvidsjaur:/var/tmp/cvs-serv20738
+
+Modified Files:
+ UNIX-SMB.txt samba.faq
+Log Message:
+added comments about trapdoor uids
+
+
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 17:47
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv20784
+
+Modified Files:
+ password.c smbencrypt.c smbpass.c smbpasswd.c
+Log Message:
+cleanups to make thinsg compile cleanly
+
+
+
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 17:49
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv20901
+
+Modified Files:
+ trans2.c
+Log Message:
+fixed a typo
+
+
+
+
+
+
+****************************************
+Date: Wednesday May 29, 1996 @ 17:53
+Author: tridge
+
+Update of /data/cvs/samba/source
+In directory arvidsjaur:/var/tmp/cvs-serv21121
+
+Modified Files:
+ server.c util.c
+Log Message:
+handle errors from receive_smb better, and print error string
+
+
+
+
+
+
diff --git a/source/include/charset.h b/source/include/charset.h
index 7091732223a..14b6ec2020f 100644
--- a/source/include/charset.h
+++ b/source/include/charset.h
@@ -57,5 +57,9 @@ extern void charset_initialise(void);
#define islower(c) (((char)(c)) != toupper(c))
#define isdoschar(c) (dos_char_map[(char)(c)] != 0)
#define isspace(c) ((c)==' ' || (c) == '\t')
+
+/* this is used to determine if a character is safe to use in
+ something that may be put on a command line */
+#define issafe(c) (isalnum(c) || strchr("-._",c))
#endif
diff --git a/source/include/includes.h b/source/include/includes.h
index cc2bbbfad7c..2408b3c1949 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -481,7 +481,6 @@ char *mktemp(char *); /* No standard include */
#include <netinet/ip.h>
#define SIGNAL_CAST (void (*)())
#define USE_DIRECT
-#define REPLACE_INNETGR
#endif
@@ -548,6 +547,32 @@ char *mktemp(char *); /* No standard include */
#define USE_DIRECT
#endif
+#ifdef SEQUENT_PTX4
+#include <string.h>
+#include <sys/dir.h>
+#include <dirent.h>
+#include <sys/statfs.h>
+#include <sys/statvfs.h>
+#include <sys/vfs.h>
+#include <fcntl.h>
+#include <sys/sockio.h>
+#include <netinet/tcp.h>
+#include <stropts.h>
+#include <termios.h>
+#define SYSV
+#define USE_WAITPID
+#define SIGNAL_CAST (void (*)(int))
+#define USE_STATVFS
+#define USE_GETCWD
+#ifndef seteuid
+#define seteuid(uid) setreuid(-1,uid)
+#endif
+#ifndef setegid
+#define setegid(gid) setregid(-1,gid)
+#endif
+#endif
+
+
#ifdef NEXT2
#include <sys/types.h>
#include <strings.h>
@@ -734,7 +759,6 @@ char *strdup (char *);
#endif /* DNIX */
#ifdef CONVEX
-#define SIGNAL_CAST (void (*)(int))
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <dirent.h>
diff --git a/source/include/local.h b/source/include/local.h
index 2775453e150..fba79559021 100644
--- a/source/include/local.h
+++ b/source/include/local.h
@@ -163,5 +163,8 @@
/* shall we support browse requests via a FIFO to nmbd? */
#define ENABLE_FIFO 1
+/* keep the password server open, this uses up a aocket, but is needed
+ by many apps */
+#define KEEP_PASSWORD_SERVER_OPEN 1
#endif
diff --git a/source/include/version.h b/source/include/version.h
index 9ad8b7d44b5..5858fccf2fa 100644
--- a/source/include/version.h
+++ b/source/include/version.h
@@ -1 +1 @@
-#define VERSION "1.9.16alpha1"
+#define VERSION "1.9.16alpha3"
diff --git a/source/lib/system.c b/source/lib/system.c
index 938746e9c9d..ac64b37a6fe 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -79,7 +79,7 @@ int sys_select(fd_set *fds,struct timeval *tval)
return(found);
}
- if (tval && tval.tv_sec < counter) return(0);
+ if (tval && tval->tv_sec < counter) return(0);
sleep(1);
counter++;
}
diff --git a/source/lib/util.c b/source/lib/util.c
index 7bd6298c4ca..e983a746731 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -151,6 +151,35 @@ void reopen_logs(void)
/*******************************************************************
+check if the log has grown too big
+********************************************************************/
+static void check_log_size(void)
+{
+ static int debug_count=0;
+ int maxlog;
+ struct stat st;
+
+ if (debug_count++ < 100) return;
+
+ maxlog = lp_max_log_size() * 1024;
+ if (!dbf || maxlog <= 0) return;
+
+ if (fstat(fileno(dbf),&st) == 0 && st.st_size > maxlog) {
+ fclose(dbf); dbf = NULL;
+ reopen_logs();
+ if (dbf && file_size(debugf) > maxlog) {
+ pstring name;
+ fclose(dbf); dbf = NULL;
+ sprintf(name,"%s.old",debugf);
+ sys_rename(debugf,name);
+ reopen_logs();
+ }
+ }
+ debug_count=0;
+}
+
+
+/*******************************************************************
write an debug message on the debugfile. This is called by the DEBUG
macro
********************************************************************/
@@ -165,44 +194,17 @@ va_dcl
#endif
va_list ap;
+ if (stdout_logging) {
#ifdef __STDC__
- va_start(ap, format_str);
+ va_start(ap, format_str);
#else
- va_start(ap);
- format_str = va_arg(ap,char *);
+ va_start(ap);
+ format_str = va_arg(ap,char *);
#endif
-
- if (stdout_logging) {
vfprintf(dbf,format_str,ap);
va_end(ap);
return(0);
}
-
- {
- static int debug_count=0;
-
- debug_count++;
- if (debug_count == 100) {
- int maxlog = lp_max_log_size() * 1024;
- if (dbf && maxlog > 0)
- {
- struct stat st;
-
- if (fstat(fileno(dbf),&st) == 0 && st.st_size > maxlog) {
- fclose(dbf); dbf = NULL;
- reopen_logs();
- if (dbf && file_size(debugf) > maxlog) {
- pstring name;
- fclose(dbf); dbf = NULL;
- sprintf(name,"%s.old",debugf);
- sys_rename(debugf,name);
- reopen_logs();
- }
- }
- }
- debug_count=0;
- }
- }
#ifdef SYSLOG
if (!lp_syslog_only())
@@ -241,7 +243,14 @@ va_dcl
else
priority = priority_map[syslog_level];
+#ifdef __STDC__
+ va_start(ap, format_str);
+#else
+ va_start(ap);
+ format_str = va_arg(ap,char *);
+#endif
vsprintf(msgbuf, format_str, ap);
+ va_end(ap);
msgbuf[255] = '\0';
syslog(priority, "%s", msgbuf);
@@ -252,11 +261,19 @@ va_dcl
if (!lp_syslog_only())
#endif
{
+#ifdef __STDC__
+ va_start(ap, format_str);
+#else
+ va_start(ap);
+ format_str = va_arg(ap,char *);
+#endif
vfprintf(dbf,format_str,ap);
+ va_end(ap);
fflush(dbf);
}
-
- va_end(ap);
+
+ check_log_size();
+
return(0);
}
@@ -464,12 +481,11 @@ int DSTDiff(time_t t)
table_size++;
- dst_table[i].is_dst = is_dst = (localtime(&t)->tm_isdst?True:False);;
+ dst_table[i].is_dst = is_dst = (localtime(&t)->tm_isdst?True:False);
dst_table[i].start = dst_table[i].end = t;
/* no entry will cover more than 6 months */
low = t - 3*30*24*60*60;
- high = t + 3*30*24*60*60;
/* widen the new entry using two bisection searches */
while (low+60*60 < dst_table[i].start) {
@@ -480,8 +496,9 @@ int DSTDiff(time_t t)
low = t;
}
+ high = low + 3*30*24*60*60;
while (high-60*60 > dst_table[i].end) {
- t = high + (high-dst_table[i].end)/2;
+ t = high - (high-dst_table[i].end)/2;
if ((localtime(&t)->tm_isdst?True:False) == is_dst)
dst_table[i].end = t;
else
@@ -2666,12 +2683,11 @@ BOOL receive_smb(int fd,char *buffer,int timeout)
if (len == -1)
return(False);
- if (len > BUFFER_SIZE)
- {
- DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
- if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
- exit(1);
- }
+ if (len > BUFFER_SIZE) {
+ DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
+ if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
+ exit(1);
+ }
ok = (read_data(fd,buffer+4,len) == len);
diff --git a/source/libsmb/smbencrypt.c b/source/libsmb/smbencrypt.c
index a0683b5d282..0221520ce65 100644
--- a/source/libsmb/smbencrypt.c
+++ b/source/libsmb/smbencrypt.c
@@ -166,7 +166,7 @@ void E_md4hash(uchar *passwd, uchar *p16)
MDstruct MD;
/* Password cannot be longer than 128 characters */
- len = strlen(passwd);
+ len = strlen((char *)passwd);
if(len > 128)
len = 128;
/* Password must be converted to NT unicode */
diff --git a/source/loadparm.h b/source/loadparm.h
new file mode 100644
index 00000000000..513dbcd636b
--- /dev/null
+++ b/source/loadparm.h
@@ -0,0 +1,160 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ Parameter loading functions
+ Copyright (C) Karl Auer 1993, 1994
+
+ Extensively modified by Andrew Tridgell
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/*
+ *
+ * Prototypes etc for loadparm.c.
+ *
+ */
+#ifndef _LOADPARM_H
+#define _LOADPARM_H
+
+#include "smb.h"
+
+extern BOOL lp_file_list_changed(void);
+extern void lp_killunused(BOOL (*snumused)(int ));
+extern BOOL lp_loaded(void);
+extern BOOL lp_snum_ok(int iService);
+extern BOOL lp_manglednames(int iService);
+extern char *lp_passwordserver(void);
+extern char *lp_passwd_program(void);
+extern char *lp_passwd_chat(void);
+extern char *lp_guestaccount(int iService);
+extern char *lp_printcapname(void);
+extern char *lp_lockdir(void);
+extern char *lp_logfile(void);
+extern char *lp_configfile(void);
+extern char *lp_smb_passwd_file(void);
+extern char *lp_rootdir(void);
+extern char *lp_defaultservice(void);
+extern char *lp_serverstring(void);
+extern char *lp_dfree_command(void);
+extern char *lp_msg_command(void);
+extern char *lp_workgroup(void);
+extern char *lp_domain_controller(void);
+extern char *lp_username_map(void);
+extern char *lp_hosts_equiv(void);
+extern char *lp_logon_script(void);
+extern char *lp_magicscript(int iService);
+extern char *lp_magicoutput(int iService);
+extern char *lp_mangled_map(int iService);
+char *volume_label(int snum);
+extern int lp_os_level(void);
+extern int lp_max_ttl(void);
+extern int lp_max_log_size(void);
+extern int lp_maxxmit(void);
+extern int lp_maxmux(void);
+extern int lp_mangledstack(void);
+extern BOOL lp_preferred_master(void);
+extern BOOL lp_domain_master(void);
+extern BOOL lp_domain_logons(void);
+extern BOOL lp_getwdcache(void);
+extern BOOL lp_use_rhosts(void);
+extern BOOL lp_readprediction(void);
+extern BOOL lp_readbmpx(void);
+extern BOOL lp_readraw(void);
+extern BOOL lp_writeraw(void);
+extern BOOL lp_null_passwords(void);
+extern BOOL lp_strip_dot(void);
+extern BOOL lp_encrypted_passwords(void);
+extern BOOL lp_syslog_only(void);
+extern BOOL lp_browse_list(void);
+extern int lp_numservices(void);
+extern int lp_keepalive(void);
+extern int lp_passwordlevel(void);
+extern int lp_security(void);
+extern int lp_printing(void);
+extern int lp_maxdisksize(void);
+extern int lp_lpqcachetime(void);
+extern int lp_syslog(void);
+extern int lp_deadtime(void);
+extern int lp_debuglevel(void);
+extern int lp_maxprotocol(void);
+extern int lp_maxpacket(void);
+extern char *lp_comment(int iService);
+extern char *lp_preexec(int iService);
+extern char *lp_postexec(int iService);
+extern char *lp_rootpreexec(int iService);
+extern char *lp_rootpostexec(int iService);
+extern char *lp_servicename(int iService);
+extern char *lp_pathname(int iService);
+extern char *lp_username(int iService);
+extern char *lp_invalid_users(int iService);
+extern char *lp_valid_users(int iService);
+extern char *lp_admin_users(int iService);
+extern char *lp_printcommand(int iService);
+extern char *lp_lpqcommand(int iService);
+extern char *lp_lprmcommand(int iService);
+extern char *lp_lppausecommand(int iService);
+extern char *lp_lpresumecommand(int iService);
+extern char *lp_printername(int iService);
+extern char *lp_hostsallow(int iService);
+extern char *lp_hostsdeny(int iService);
+extern char *lp_dontdescend(int iService);
+extern char *lp_force_user(int iService);
+extern char *lp_force_group(int iService);
+extern char *lp_readlist(int iService);
+extern char *lp_writelist(int iService);
+extern BOOL lp_alternate_permissions(int iService);
+extern BOOL lp_revalidate(int iService);
+extern BOOL lp_status(int iService);
+extern BOOL lp_hide_dot_files(int iService);
+extern BOOL lp_browseable(int iService);
+extern BOOL lp_widelinks(int iService);
+extern BOOL lp_syncalways(int iService);
+extern BOOL lp_readonly(int iService);
+extern BOOL lp_no_set_dir(int iService);
+extern BOOL lp_guest_ok(int iService);
+extern BOOL lp_guest_only(int iService);
+extern BOOL lp_print_ok(int iService);
+extern BOOL lp_postscript(int iService);
+extern BOOL lp_map_hidden(int iService);
+extern BOOL lp_map_archive(int iService);
+extern BOOL lp_locking(int iService);
+extern BOOL lp_strict_locking(int iService);
+extern BOOL lp_share_modes(int iService);
+extern BOOL lp_onlyuser(int iService);
+extern BOOL lp_map_system(int iService);
+extern BOOL lp_casesensitive(int iService);
+extern BOOL lp_casemangle(int iService);
+extern BOOL lp_preservecase(int iService);
+extern BOOL lp_shortpreservecase(int iService);
+extern BOOL lp_load(char *pszFname,BOOL global_only);
+extern void lp_dump(void);
+extern int lp_servicenumber(char *pszServiceName);
+extern BOOL lp_add_home(char *pszHomename,
+ int iDefaultService, char *pszHomedir);
+extern int lp_add_service(char *service, int iDefaultService);
+extern BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
+extern BOOL lp_readonly(int iService);
+extern int lp_create_mode(int iService);
+extern int lp_minprintspace(int iService);
+extern int lp_defaultcase(int iService);
+extern char lp_magicchar(int iService);
+extern int lp_max_connections(int iService);
+extern BOOL lp_add_home(char *pservice,int ifrom,char *phome);
+extern char *lp_string(char *s);
+char *my_workgroup(void);
+
+#endif
+
diff --git a/source/params.h b/source/params.h
new file mode 100644
index 00000000000..253eaa4e7ae
--- /dev/null
+++ b/source/params.h
@@ -0,0 +1,45 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ Parameter loading utilities
+ Copyright (C) Karl Auer 1993, 1994
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/**************************************************************************
+PARAMS.H
+
+Copyright (C) 1990, 1991, 1992 Karl Auer
+
+Prototypes and definitions for PARAMS.C.
+**************************************************************************/
+#ifndef _PARAMS_H
+#define _PARAMS_H
+
+#include <stdio.h>
+#include "smb.h"
+
+typedef BOOL (* PM_PARMFUNC)(char *pszParmName, char *pszParmValue);
+typedef BOOL (* PM_SECFUNC)(char *pszSectionName);
+
+#define PM_NOFILE 1
+#define PM_NOFILENAME 2
+#define PM_FILEERROR 3
+
+extern BOOL pm_process(char *pszFileName, PM_SECFUNC sfunc, PM_PARMFUNC pfunc);
+
+#endif
+
diff --git a/source/passdb/smbpass.c b/source/passdb/smbpass.c
index 2dec15ffb43..ca86d95618d 100644
--- a/source/passdb/smbpass.c
+++ b/source/passdb/smbpass.c
@@ -262,7 +262,7 @@ get_smbpwnam(char *name)
if (!strncasecmp((char *) p, "NO PASSWORD", 11)) {
pw_buf.smb_passwd = NULL;
} else {
- if(!gethexpwd(p,smbpwd)) {
+ if(!gethexpwd((char *)p,(char *)smbpwd)) {
DEBUG(0, ("Malformed Lanman password entry (non hex chars)\n"));
fclose(fp);
pw_file_unlock(lockfd);
@@ -280,7 +280,7 @@ get_smbpwnam(char *name)
the lanman password. */
if ((linebuf_len >= (PTR_DIFF(p, linebuf) + 33)) && (p[32] == ':')) {
if (*p != '*' && *p != 'X') {
- if(gethexpwd(p,smbntpwd))
+ if(gethexpwd((char *)p,(char *)smbntpwd))
pw_buf.smb_nt_passwd = smbntpwd;
}
}
diff --git a/source/pcap.h b/source/pcap.h
new file mode 100644
index 00000000000..89ab359af65
--- /dev/null
+++ b/source/pcap.h
@@ -0,0 +1,35 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ printcap parsing
+ Copyright (C) Karl Auer 1993, 1994
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/*
+ *
+ * Prototypes etc for pcap.c.
+ *
+ */
+#ifndef _PCAP_H
+#define _PCAP_H
+
+#include "smb.h"
+
+extern BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
+extern void pcap_printer_fn(void (*fn)());
+
+#endif
diff --git a/source/reply.h b/source/reply.h
new file mode 100644
index 00000000000..f88229436f7
--- /dev/null
+++ b/source/reply.h
@@ -0,0 +1,60 @@
+int reply_special(char *inbuf,char *outbuf);
+int reply_corep(char *outbuf);
+int reply_coreplus(char *outbuf);
+int reply_nt1(char *outbuf);
+int reply_lanman1(char *outbuf);
+int reply_lanman2(char *outbuf);
+int reply_tcon(char *inbuf,char *outbuf);
+int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_unknown(char *inbuf,char *outbuf);
+int reply_ioctl(char *inbuf,char *outbuf);
+int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_chkpth(char *inbuf,char *outbuf);
+int reply_getatr(char *inbuf,char *outbuf);
+int reply_setatr(char *inbuf,char *outbuf);
+int reply_dskattr(char *inbuf,char *outbuf);
+int reply_search(char *inbuf,char *outbuf);
+int reply_fclose(char *inbuf,char *outbuf);
+int reply_open(char *inbuf,char *outbuf);
+int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_mknew(char *inbuf,char *outbuf);
+int reply_ctemp(char *inbuf,char *outbuf);
+int reply_unlink(char *inbuf,char *outbuf);
+int reply_readbraw(char *inbuf, char *outbuf);
+int reply_lockread(char *inbuf,char *outbuf);
+int reply_read(char *inbuf,char *outbuf);
+int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_writebraw(char *inbuf,char *outbuf);
+int reply_writeunlock(char *inbuf,char *outbuf);
+int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
+int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_lseek(char *inbuf,char *outbuf);
+int reply_flush(char *inbuf,char *outbuf);
+int reply_exit(char *inbuf,char *outbuf);
+int reply_close(char *inbuf,char *outbuf);
+int reply_writeclose(char *inbuf,char *outbuf);
+int reply_lock(char *inbuf,char *outbuf);
+int reply_unlock(char *inbuf,char *outbuf);
+int reply_tdis(char *inbuf,char *outbuf);
+int reply_echo(char *inbuf,char *outbuf);
+int reply_printopen(char *inbuf,char *outbuf);
+int reply_printclose(char *inbuf,char *outbuf);
+int reply_printqueue(char *inbuf,char *outbuf);
+int reply_printwrite(char *inbuf,char *outbuf);
+int reply_mkdir(char *inbuf,char *outbuf);
+int reply_rmdir(char *inbuf,char *outbuf);
+int reply_mv(char *inbuf,char *outbuf);
+int reply_copy(char *inbuf,char *outbuf);
+int reply_setdir(char *inbuf,char *outbuf);
+int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
+int reply_writebmpx(char *inbuf,char *outbuf);
+int reply_setattrE(char *inbuf,char *outbuf);
+int reply_getattrE(char *inbuf,char *outbuf);
+int reply_writebs(char *inbuf,char *outbuf);
+int reply_sends(char *inbuf,char *outbuf);
+int reply_sendstrt(char *inbuf,char *outbuf);
+int reply_sendend(char *inbuf,char *outbuf);
+int reply_sendtxt(char *inbuf,char *outbuf);
+int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
diff --git a/source/smbd/dir.c b/source/smbd/dir.c
index ac6f918b9da..214b28dad04 100644
--- a/source/smbd/dir.c
+++ b/source/smbd/dir.c
@@ -186,6 +186,19 @@ close a dptr
****************************************************************************/
void dptr_close(int key)
{
+ /* OS/2 seems to use -1 to indicate "close all directories" */
+ if (key == -1) {
+ int i;
+ for (i=0;i<NUMDIRPTRS;i++)
+ dptr_close(i);
+ return;
+ }
+
+ if (key < 0 || key >= NUMDIRPTRS) {
+ DEBUG(3,("Invalid key %d given to dptr_close\n",key));
+ return;
+ }
+
if (dirptrs[key].valid) {
DEBUG(4,("closing dptr key %d\n",key));
if (dirptrs[key].ptr) {
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 8852e57e8b6..34210f2db70 100644
--- a/source/smbd/ipc.c
+++ b/source/smbd/ipc.c
@@ -1551,8 +1551,7 @@ static BOOL api_PrintJobInfo(int cnum,int uid,char *param,char *data,
int l = 0;
while (l<64 && *s)
{
- if (isalnum(*s) || strchr("-._",*s))
- name[l++] = *s;
+ if (issafe(*s)) name[l++] = *s;
s++;
}
name[l] = 0;
diff --git a/source/smbd/mangle.c b/source/smbd/mangle.c
index 8f1490c528d..a43e7f62451 100644
--- a/source/smbd/mangle.c
+++ b/source/smbd/mangle.c
@@ -90,8 +90,6 @@ BOOL is_8_3(char *fname)
if (slash_pos) fname = slash_pos+1;
len = strlen(fname);
- dot_pos = strchr(fname,'.');
-
DEBUG(5,("checking %s for 8.3\n",fname));
if (case_mangle)
@@ -122,6 +120,8 @@ BOOL is_8_3(char *fname)
/* %%% A nice improvment to name mangling would be to translate
filename to ANSI charset on the smb server host */
+ dot_pos = strchr(fname,'.');
+
{
char *p = fname;
#ifdef KANJI
diff --git a/source/smbd/password.c b/source/smbd/password.c
index 87c1fef94c5..6031daf5f16 100644
--- a/source/smbd/password.c
+++ b/source/smbd/password.c
@@ -52,7 +52,7 @@ void generate_next_challenge(char *challenge)
v2 = (counter++) * getpid() + tval.tv_usec;
SIVAL(challenge,0,v1);
SIVAL(challenge,4,v2);
- E1(challenge,"SAMBA",saved_challenge);
+ E1(challenge,"SAMBA",(char *)saved_challenge);
memcpy(challenge,saved_challenge,8);
challenge_sent = True;
}
@@ -684,7 +684,9 @@ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL
if(smb_pass->smb_nt_passwd != NULL)
{
DEBUG(4,("Checking NT MD4 password\n"));
- if(smb_password_check(password, smb_pass->smb_nt_passwd, challenge))
+ if(smb_password_check(password,
+ smb_pass->smb_nt_passwd,
+ (char *)challenge))
{
update_protected_database(user,True);
return(True);
@@ -696,11 +698,12 @@ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL
/* Try against the lanman password */
- if(smb_password_check(password, smb_pass->smb_passwd, challenge))
- {
- update_protected_database(user,True);
- return(True);
- }
+ if (smb_password_check(password,
+ smb_pass->smb_passwd,
+ (char *)challenge)) {
+ update_protected_database(user,True);
+ return(True);
+ }
DEBUG(3,("Error smb_password_check failed\n"));
}
@@ -1153,13 +1156,12 @@ static BOOL check_user_equiv(char *user, char *remote, char *equiv_file)
BOOL host_ok = False;
#ifdef NETGROUP
- /* THIS IS UNTESTED!! */
if (is_group)
{
static char *mydomain = NULL;
if (!mydomain)
yp_get_default_domain(&mydomain);
- if (mydomain && innetgr(remote,file_host,user,mydomain))
+ if (mydomain && innetgr(file_host,remote,user,mydomain))
host_ok = True;
}
#else
@@ -1242,7 +1244,7 @@ BOOL check_hosts_equiv(char *user)
}
-static int password_client = -1;
+int password_client = -1;
static fstring pserver;
/****************************************************************************
@@ -1406,7 +1408,7 @@ BOOL server_validate(char *buf)
DEBUG(3,("password server %s accepted the password\n",pserver));
-#ifndef KEEP_PASSWORD_SERVER_OPEN
+#if !KEEP_PASSWORD_SERVER_OPEN
close(password_client); password_client= -1;
#endif
diff --git a/source/smbd/quotas.c b/source/smbd/quotas.c
new file mode 100644
index 00000000000..32c9fc35d30
--- /dev/null
+++ b/source/smbd/quotas.c
@@ -0,0 +1,330 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ support for quotas
+ Copyright (C) Andrew Tridgell 1992-1995
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+
+
+#ifdef QUOTAS
+
+#ifdef LINUX
+/****************************************************************************
+try to get the disk space from disk quotas (LINUX version)
+****************************************************************************/
+/*
+If you didn't make the symlink to the quota package, too bad :(
+*/
+#include "quota/quotactl.c"
+#include "quota/hasquota.c"
+static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
+{
+ uid_t euser_id;
+ struct dqblk D;
+ struct stat S;
+ dev_t devno ;
+ struct mntent *mnt;
+ FILE *fp;
+ int found ;
+ int qcmd, fd ;
+ char *qfpathname;
+
+ /* find the block device file */
+
+ if ( stat(path, &S) == -1 )
+ return(False) ;
+
+ devno = S.st_dev ;
+
+ fp = setmntent(MOUNTED,"r");
+ found = False ;
+
+ while ((mnt = getmntent(fp)) != (struct mntent *) 0) {
+ if ( stat(mnt->mnt_dir,&S) == -1 )
+ continue ;
+ if (S.st_dev == devno) {
+ found = True ;
+ break ;
+ }
+ }
+ endmntent(fp) ;
+
+ if ( ! found )
+ return(False) ;
+
+ qcmd = QCMD(Q_GETQUOTA, USRQUOTA);
+
+ if (hasmntopt(mnt, MNTOPT_NOAUTO) || hasmntopt(mnt, MNTOPT_NOQUOTA))
+ return(False) ;
+
+ if (!hasquota(mnt, USRQUOTA, &qfpathname))
+ return(False) ;
+
+ euser_id = geteuid();
+ seteuid(0);
+
+ if (quotactl(qcmd, mnt->mnt_fsname, euser_id, (caddr_t)&D) != 0) {
+ if ((fd = open(qfpathname, O_RDONLY)) < 0) {
+ seteuid(euser_id);
+ return(False);
+ }
+ lseek(fd, (long) dqoff(euser_id), L_SET);
+ switch (read(fd, &D, sizeof(struct dqblk))) {
+ case 0:/* EOF */
+ memset((caddr_t)&D, 0, sizeof(struct dqblk));
+ break;
+ case sizeof(struct dqblk): /* OK */
+ break;
+ default: /* ERROR */
+ close(fd);
+ seteuid(euser_id);
+ return(False);
+ }
+ }
+ seteuid(euser_id);
+ *bsize=1024;
+
+ if (D.dqb_bsoftlimit==0)
+ return(False);
+ if ((D.dqb_curblocks>D.dqb_bsoftlimit)||(D.dqb_curinodes>D.dqb_isoftlimit))
+ {
+ *dfree = 0;
+ *dsize = D.dqb_curblocks;
+ }
+ else {
+ *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
+ *dsize = D.dqb_bsoftlimit;
+ }
+ return (True);
+}
+
+#elif defined(CRAY)
+/****************************************************************************
+try to get the disk space from disk quotas (CRAY VERSION)
+****************************************************************************/
+static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
+{
+ struct mntent *mnt;
+ FILE *fd;
+ struct stat sbuf;
+ dev_t devno ;
+ static dev_t devno_cached = 0 ;
+ static char name[MNTMAXSTR] ;
+ struct q_request request ;
+ struct qf_header header ;
+ static int quota_default = 0 ;
+ int found ;
+
+ if ( stat(path,&sbuf) == -1 )
+ return(False) ;
+
+ devno = sbuf.st_dev ;
+
+ if ( devno != devno_cached ) {
+
+ devno_cached = devno ;
+
+ if ((fd = setmntent(KMTAB)) == NULL)
+ return(False) ;
+
+ found = False ;
+
+ while ((mnt = getmntent(fd)) != NULL) {
+
+ if ( stat(mnt->mnt_dir,&sbuf) == -1 )
+ continue ;
+
+ if (sbuf.st_dev == devno) {
+
+ found = True ;
+ break ;
+
+ }
+
+ }
+
+ strcpy(name,mnt->mnt_dir) ;
+ endmntent(fd) ;
+
+ if ( ! found )
+ return(False) ;
+ }
+
+ request.qf_magic = QF_MAGIC ;
+ request.qf_entry.id = geteuid() ;
+
+ if (quotactl(name, Q_GETQUOTA, &request) == -1)
+ return(False) ;
+
+ if ( ! request.user )
+ return(False) ;
+
+ if ( request.qf_entry.user_q.f_quota == QFV_DEFAULT ) {
+
+ if ( ! quota_default ) {
+
+ if ( quotactl(name, Q_GETHEADER, &header) == -1 )
+ return(False) ;
+ else
+ quota_default = header.user_h.def_fq ;
+ }
+
+ *dfree = quota_default ;
+
+ }else if ( request.qf_entry.user_q.f_quota == QFV_PREVENT ) {
+
+ *dfree = 0 ;
+
+ }else{
+
+ *dfree = request.qf_entry.user_q.f_quota ;
+
+ }
+
+ *dsize = request.qf_entry.user_q.f_use ;
+
+ if ( *dfree )
+ *dfree -= *dsize ;
+
+ if ( *dfree < 0 )
+ *dfree = 0 ;
+
+ *bsize = 4096 ; /* Cray blocksize */
+
+ return(True) ;
+
+}
+
+
+#elif defined(SUNOS5)
+
+#include <fcntl.h>
+#include <sys/fs/ufs_quota.h>
+
+/****************************************************************************
+try to get the disk space from disk quotas (solaris 2 version)
+****************************************************************************/
+/* Quota code by Peter Urbanec (amiga@cse.unsw.edu.au) */
+static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
+{
+ uid_t user_id, euser_id;
+ int r;
+ struct dqblk D;
+ struct quotctl command;
+ int file;
+
+ if((file=open(path, O_RDONLY))<0) return(False);
+
+ euser_id = geteuid();
+ user_id = getuid();
+
+ setuid(0); /* Solaris seems to want to give info only to super-user */
+ seteuid(0);
+
+ command.op = Q_GETQUOTA;
+ command.uid = euser_id;
+ command.addr = (caddr_t) &D;
+
+ if(ioctl(file, Q_QUOTACTL, &command)<0)
+ {
+ close(file);
+ DEBUG(2,("disk_quotas ioctl (Solaris) failed\n"));
+ return(False);
+ }
+ close(file);
+
+ setuid(user_id); /* Restore the original UID status */
+ seteuid(euser_id);
+
+ /* Use softlimit to determine disk space. A user exceeding the quota is told
+ * that there's no space left. Writes might actually work for a bit if the
+ * hardlimit is set higher than softlimit. Effectively the disk becomes
+ * made of rubber latex and begins to expand to accommodate the user :-)
+ */
+
+ *bsize = 512;
+ *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
+ *dsize = D.dqb_bsoftlimit;
+ if(*dfree < 0)
+ {
+ *dfree = 0;
+ *dsize = D.dqb_curblocks;
+ }
+
+DEBUG(5,("disk_quotas for path \"%s\" returning bsize %d, dfree %d, dsize %d\n",
+ path,*bsize,*dfree,*dsize));
+
+ return(True);
+}
+
+#else
+
+/****************************************************************************
+try to get the disk space from disk quotas - default version
+****************************************************************************/
+static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
+{
+ uid_t user_id, euser_id;
+ int r;
+ char dev_disk[256];
+ struct dqblk D;
+ struct stat S;
+ /* find the block device file */
+ if ((stat(path, &S)<0) ||
+ (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False);
+
+ euser_id = geteuid();
+
+#ifdef USE_SETRES
+ /* for HPUX, real uid must be same as euid to execute quotactl for euid */
+ user_id = getuid();
+ setresuid(euser_id,-1,-1);
+#endif
+ r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
+ #ifdef USE_SETRES
+ if (setresuid(user_id,-1,-1))
+ DEBUG(5,("Unable to reset uid to %d\n", user_id));
+ #endif
+ /* Use softlimit to determine disk space, except when it has been exceeded */
+ *bsize = 1024;
+ if (r)
+ {
+ if (errno == EDQUOT)
+ {
+ *dfree =0;
+ *dsize =D.dqb_curblocks;
+ return (True);
+ }
+ else return(False);
+ }
+ /* Use softlimit to determine disk space, except when it has been exceeded */
+ if ((D.dqb_curblocks>D.dqb_bsoftlimit)||(D.dqb_curfiles>D.dqb_fsoftlimit))
+ {
+ *dfree = 0;
+ *dsize = D.dqb_curblocks;
+ }
+ else {
+ *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
+ *dsize = D.dqb_bsoftlimit;
+ }
+ return (True);
+}
+
+#endif
+#endif
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 5d8facef33f..00f8c9e0fd6 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -257,7 +257,7 @@ int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st)
unixmode &= ~(S_IWUSR|S_IWGRP|S_IWOTH);
unixmode |= tmp;
}
-
+
return(chmod(fname,unixmode));
}
@@ -326,7 +326,7 @@ static BOOL scan_directory(char *path, char *name,int snum,BOOL docache)
void *cur_dir;
char *dname;
BOOL mangled;
- fstring name2;
+ pstring name2;
mangled = is_mangled(name);
@@ -410,8 +410,12 @@ BOOL unix_convert(char *name,int cnum)
{
if ((! *name) || strchr(name,'/') || !is_8_3(name))
{
+ char *s;
fstring name2;
sprintf(name2,"%.6s.XXXXXX",remote_machine);
+ /* sanitise the name */
+ for (s=name2 ; *s ; s++)
+ if (!issafe(*s)) *s = '_';
strcpy(name,(char *)mktemp(name2));
}
return(True);
@@ -522,251 +526,6 @@ BOOL unix_convert(char *name,int cnum)
}
-
-
-#ifdef QUOTAS
-#ifdef LINUX
-/****************************************************************************
-try to get the disk space from disk quotas (LINUX version)
-****************************************************************************/
-/*
-If you didn't make the symlink to the quota package, too bad :(
-*/
-#include "quota/quotactl.c"
-#include "quota/hasquota.c"
-static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
-{
- uid_t euser_id;
- struct dqblk D;
- struct stat S;
- dev_t devno ;
- struct mntent *mnt;
- FILE *fp;
- int found ;
- int qcmd, fd ;
- char *qfpathname;
-
- /* find the block device file */
-
- if ( stat(path, &S) == -1 )
- return(False) ;
-
- devno = S.st_dev ;
-
- fp = setmntent(MOUNTED,"r");
- found = False ;
-
- while ((mnt = getmntent(fp)) != (struct mntent *) 0) {
- if ( stat(mnt->mnt_dir,&S) == -1 )
- continue ;
- if (S.st_dev == devno) {
- found = True ;
- break ;
- }
- }
- endmntent(fp) ;
-
- if ( ! found )
- return(False) ;
-
- qcmd = QCMD(Q_GETQUOTA, USRQUOTA);
-
- if (hasmntopt(mnt, MNTOPT_NOAUTO) || hasmntopt(mnt, MNTOPT_NOQUOTA))
- return(False) ;
-
- if (!hasquota(mnt, USRQUOTA, &qfpathname))
- return(False) ;
-
- euser_id = geteuid();
- seteuid(0);
-
- if (quotactl(qcmd, mnt->mnt_fsname, euser_id, (caddr_t)&D) != 0) {
- if ((fd = open(qfpathname, O_RDONLY)) < 0) {
- seteuid(euser_id);
- return(False);
- }
- lseek(fd, (long) dqoff(euser_id), L_SET);
- switch (read(fd, &D, sizeof(struct dqblk))) {
- case 0:/* EOF */
- memset((caddr_t)&D, 0, sizeof(struct dqblk));
- break;
- case sizeof(struct dqblk): /* OK */
- break;
- default: /* ERROR */
- close(fd);
- seteuid(euser_id);
- return(False);
- }
- }
- seteuid(euser_id);
- *bsize=1024;
-
- if (D.dqb_bsoftlimit==0)
- return(False);
- if ((D.dqb_curblocks>D.dqb_bsoftlimit)||(D.dqb_curinodes>D.dqb_isoftlimit))
- {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- }
- else {
- *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
- *dsize = D.dqb_bsoftlimit;
- }
- return (True);
-}
-#else
-#ifndef CRAY
-/****************************************************************************
-try to get the disk space from disk quotas
-****************************************************************************/
-static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
-{
- uid_t user_id, euser_id;
- int r;
- char dev_disk[256];
- struct dqblk D;
- struct stat S;
- /* find the block device file */
- if ((stat(path, &S)<0) ||
- (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False);
-
- euser_id = geteuid();
-
-#ifdef USE_SETRES
- /* for HPUX, real uid must be same as euid to execute quotactl for euid */
- user_id = getuid();
- setresuid(euser_id,-1,-1);
-#endif
- r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
- #ifdef USE_SETRES
- if (setresuid(user_id,-1,-1))
- DEBUG(5,("Unable to reset uid to %d\n", user_id));
- #endif
- /* Use softlimit to determine disk space, except when it has been exceeded */
- *bsize = 1024;
- if (r)
- {
- if (errno == EDQUOT)
- {
- *dfree =0;
- *dsize =D.dqb_curblocks;
- return (True);
- }
- else return(False);
- }
- /* Use softlimit to determine disk space, except when it has been exceeded */
- if ((D.dqb_curblocks>D.dqb_bsoftlimit)||(D.dqb_curfiles>D.dqb_fsoftlimit))
- {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- }
- else {
- *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
- *dsize = D.dqb_bsoftlimit;
- }
- return (True);
-}
-#else
-/****************************************************************************
-try to get the disk space from disk quotas (CRAY VERSION)
-****************************************************************************/
-static BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
-{
- struct mntent *mnt;
- FILE *fd;
- struct stat sbuf;
- dev_t devno ;
- static dev_t devno_cached = 0 ;
- static char name[MNTMAXSTR] ;
- struct q_request request ;
- struct qf_header header ;
- static int quota_default = 0 ;
- int found ;
-
- if ( stat(path,&sbuf) == -1 )
- return(False) ;
-
- devno = sbuf.st_dev ;
-
- if ( devno != devno_cached ) {
-
- devno_cached = devno ;
-
- if ((fd = setmntent(KMTAB)) == NULL)
- return(False) ;
-
- found = False ;
-
- while ((mnt = getmntent(fd)) != NULL) {
-
- if ( stat(mnt->mnt_dir,&sbuf) == -1 )
- continue ;
-
- if (sbuf.st_dev == devno) {
-
- found = True ;
- break ;
-
- }
-
- }
-
- strcpy(name,mnt->mnt_dir) ;
- endmntent(fd) ;
-
- if ( ! found )
- return(False) ;
- }
-
- request.qf_magic = QF_MAGIC ;
- request.qf_entry.id = geteuid() ;
-
- if (quotactl(name, Q_GETQUOTA, &request) == -1)
- return(False) ;
-
- if ( ! request.user )
- return(False) ;
-
- if ( request.qf_entry.user_q.f_quota == QFV_DEFAULT ) {
-
- if ( ! quota_default ) {
-
- if ( quotactl(name, Q_GETHEADER, &header) == -1 )
- return(False) ;
- else
- quota_default = header.user_h.def_fq ;
- }
-
- *dfree = quota_default ;
-
- }else if ( request.qf_entry.user_q.f_quota == QFV_PREVENT ) {
-
- *dfree = 0 ;
-
- }else{
-
- *dfree = request.qf_entry.user_q.f_quota ;
-
- }
-
- *dsize = request.qf_entry.user_q.f_use ;
-
- if ( *dfree )
- *dfree -= *dsize ;
-
- if ( *dfree < 0 )
- *dfree = 0 ;
-
- *bsize = 4096 ; /* Cray blocksize */
-
- return(True) ;
-
-}
-#endif /* CRAY */
-#endif /* LINUX */
-#endif /* QUOTAS */
-
-
/****************************************************************************
normalise for DOS usage
****************************************************************************/
@@ -1227,16 +986,6 @@ void close_file(int fnum)
if (lp_share_modes(SNUM(cnum)))
del_share_mode(fnum);
- if (Files[fnum].modified) {
- struct stat st;
- if (fstat(Files[fnum].fd,&st) == 0) {
- int dosmode = dos_mode(cnum,Files[fnum].name,&st);
- if (!IS_DOS_ARCHIVE(dosmode)) {
- dos_chmod(cnum,Files[fnum].name,dosmode | aARCH,&st);
- }
- }
- }
-
close(Files[fnum].fd);
/* NT uses smbclose to start a print - weird */
@@ -1609,7 +1358,16 @@ int write_file(int fnum,char *data,int n)
return(0);
}
- Files[fnum].modified = True;
+ if (!Files[fnum].modified) {
+ struct stat st;
+ Files[fnum].modified = True;
+ if (fstat(Files[fnum].fd,&st) == 0) {
+ int dosmode = dos_mode(Files[fnum].cnum,Files[fnum].name,&st);
+ if (MAP_ARCHIVE(Files[fnum].cnum) && !IS_DOS_ARCHIVE(dosmode)) {
+ dos_chmod(Files[fnum].cnum,Files[fnum].name,dosmode | aARCH,&st);
+ }
+ }
+ }
return(write_data(Files[fnum].fd,data,n));
}
@@ -2222,6 +1980,9 @@ static BOOL open_sockets(BOOL is_daemon,int port)
signal(SIGPIPE, SIGNAL_CAST sig_pipe);
signal(SIGCLD, SIGNAL_CAST SIG_DFL);
#endif
+ /* close the listening socket */
+ close(s);
+
/* close our standard file descriptors */
close_low_fds();
@@ -2633,7 +2394,8 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de
if (ChDir(pcon->connectpath) != 0)
{
- DEBUG(0,("Can't change directory to %s\n",pcon->connectpath));
+ DEBUG(0,("Can't change directory to %s (%s)\n",
+ pcon->connectpath,strerror(errno)));
pcon->open = False;
unbecome_user();
if (!IS_IPC(cnum)) {
@@ -3960,8 +3722,8 @@ void process(void )
extern int keepalive;
/* check for socket failure */
- if (errno == EBADF) {
- DEBUG(3,("%s Bad file descriptor - exiting\n",timestring()));
+ if (errno) {
+ DEBUG(3,("receive_smb error (%s) exiting\n",strerror(errno)));
return;
}
@@ -3989,10 +3751,15 @@ void process(void )
}
if (keepalive && (counter-last_keepalive)>keepalive) {
+ extern int password_client;
if (!send_keepalive(Client)) {
DEBUG(2,("%s Keepalive failed - exiting\n",timestring()));
return;
- }
+ }
+ /* also send a keepalive to the password server if its still
+ connected */
+ if (password_client != -1)
+ send_keepalive(password_client);
last_keepalive = counter;
}
@@ -4277,22 +4044,23 @@ int main(int argc,char *argv[])
become_daemon();
}
- if (open_sockets(is_daemon,port))
- {
- /* possibly reload the services file. */
- reload_services(True);
+ if (!open_sockets(is_daemon,port))
+ exit(1);
- maxxmit = MIN(lp_maxxmit(),BUFFER_SIZE);
+ /* possibly reload the services file. */
+ reload_services(True);
- if (*lp_rootdir())
- {
- if (sys_chroot(lp_rootdir()) == 0)
- DEBUG(2,("%s changed root to %s\n",timestring(),lp_rootdir()));
- }
+ maxxmit = MIN(lp_maxxmit(),BUFFER_SIZE);
- process();
- close_sockets();
+ if (*lp_rootdir())
+ {
+ if (sys_chroot(lp_rootdir()) == 0)
+ DEBUG(2,("%s changed root to %s\n",timestring(),lp_rootdir()));
}
+
+ process();
+ close_sockets();
+
exit_server("normal exit");
return(0);
}
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 9d02123cf87..045d4611840 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -1444,7 +1444,7 @@ int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize)
{
int cnum;
int outsize = 0;
- uint16 dptr_num=SVAL(inbuf,smb_vwv0);
+ int16 dptr_num=SVALS(inbuf,smb_vwv0);
cnum = SVAL(inbuf,smb_tid);
diff --git a/source/smbpass.h b/source/smbpass.h
new file mode 100644
index 00000000000..6ddca0b92dd
--- /dev/null
+++ b/source/smbpass.h
@@ -0,0 +1,50 @@
+#ifndef _SMBPASS_H_
+#define _SMBPASS_H_
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ SMB parameters and setup
+ Copyright (C) Jeremy Allison 1995
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+struct smb_passwd {
+ int smb_userid;
+ char *smb_name;
+ unsigned char *smb_passwd; /* Null if no password */
+ unsigned char *smb_nt_passwd; /* Null if no password */
+ /* Other fields / flags may be added later */
+};
+
+/* Return a smb_passwd struct given a user name, 0 if fails. */
+struct smb_passwd *get_smbpwnam(char *user);
+
+#ifndef uchar
+#define uchar unsigned char
+#endif
+
+/* SMB Encryption functions. */
+void str_to_key(unsigned char *str,unsigned char *key);
+void E_P16(uchar *p14,uchar *p16);
+void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
+void E_md4hash(uchar *passwd,uchar *p16);
+void SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
+void SMB_nt_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
+
+/* Password file lock/unlock routines */
+int pw_file_lock(char *name, int type, int secs);
+int pw_file_unlock(int fd);
+#endif
diff --git a/source/sockspy.c b/source/sockspy.c
new file mode 100644
index 00000000000..806b7379157
--- /dev/null
+++ b/source/sockspy.c
@@ -0,0 +1,302 @@
+/*
+ USAGE
+ sockspy desthost destservice
+
+You install this program in /etc/inetd.conf and /etc/services
+
+For example I have used these entries:
+
+/etc/services:
+spy 8001/tcp spy port
+
+/etc/inetd.conf:
+spy stream tcp nowait tridge /usr/local/smb/sockspy sockspy fjall netbios-ssn
+
+This means any connection to port 8001 will be redirected to
+netbios-ssn on fjall. By playing with these parameters you can easily
+spy on most of the tcp protocols. All packets traversing the link will
+be captured.
+
+NOTE: This program is totally unsupported. I haven't used it for 2
+years, and don't intend to fix the obvious bugs/limitations. I will,
+however, accept contributed patches - or even a total rewrite :-)
+*/
+
+#include <stdio.h>
+#include <strings.h>
+#include <sys/types.h>
+#include <sys/dir.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+#include <signal.h>
+
+#include <errno.h>
+#include <sysexits.h>
+
+int trans_num = 0;
+
+#ifndef LOGIN
+#define LOGIN "/tmp/spy.in"
+#endif
+
+#ifndef LOGOUT
+#define LOGOUT "/tmp/spy.out"
+#endif
+
+#ifndef LOGCMD
+#define LOGCMD "/tmp/spy.cmd"
+#endif
+
+FILE *cmd = NULL;
+FILE *login = NULL;
+FILE *logout = NULL;
+
+#define STREQL(a, b) (strcmp(a, b) == 0)
+#define NIL (0)
+
+char DestHost[256]; /* Remote system to connect to */
+char DestObj[256]; /* Remote object/service to connect to */
+
+/* Signal handler for SIGPIPE (write on a disconnected socket) */
+abort()
+{
+ if (cmd)
+ {
+ fprintf(cmd,"writing to disconnected socket!\n");
+ fflush(cmd);
+ }
+ exit(1);
+}
+
+
+main(argc, argv)
+int argc; /* # of command line arguments */
+char *argv[]; /* the command line arguments */
+{
+ int client, /* Socket connected to client */
+ server; /* Socket to use for server */
+
+ trans_num = 0;
+#ifndef NOLOG
+ login = fopen(LOGIN,"w");
+ logout = fopen(LOGOUT,"w");
+ cmd = fopen(LOGCMD,"w");
+#endif
+
+ if (cmd)
+ {
+ fprintf(cmd,"Started server\n");
+ fflush(cmd);
+ }
+
+ /* Check usage */
+ if(argc != 3)
+ return;
+
+ strcpy(DestHost,argv[1]);
+ strcpy(DestObj,argv[2]);
+
+ /* Time to attempt the connection */
+ server = inet_conn(DestHost, DestObj);
+
+ if( server < 0 ) {
+ exit(EX_CANTCREAT);
+ }
+
+ /* Just to make the code more readable */
+ client = 0;
+
+ /* We will abort gracefully when the client or remote system
+ goes away */
+ signal(SIGPIPE, abort);
+
+ /* Now just go and move raw data between client and
+ remote system */
+ dowork(client, server);
+ /* ... NEVER RETURNS ... */
+}
+
+dowork(client, server)
+ int client, server;
+{
+
+ /* select(2) masks for client and remote */
+ int ClientMask, ServerMask;
+
+ /* Combined ClientMask and ServerMask */
+ int ReadMask;
+
+ /* Initialize select(2) masks */
+ ClientMask = 1<<client;
+ ServerMask = 1<<server;
+
+ ReadMask = ClientMask | ServerMask;
+
+ /* Now move raw data for the rest of our life between
+ client and remote */
+ for( ; ; ) {
+ /* Local Variables */
+ int SelectReadMask;/* select(2) mask modifiable by select(2) */
+ int nready; /* status return from select(2) */
+
+ do {
+ /* Intialize select(2) mask everytime
+ as select(2) always modifies it */
+ SelectReadMask = ReadMask;
+
+ /* Wait for data to be present to be moved */
+ errno = 0;
+ nready = select(32,&SelectReadMask,(int *)0,(int *)0,NIL);
+ } while( nready < 0 && errno == EINTR );
+
+ /* select(2) failed, shouldn't happen. Exit abnormally */
+ if( nready < 0 )
+ exit(EX_SOFTWARE);
+
+ /* Favor the client (for no particular reason)
+ if s/he is has data */
+ if( SelectReadMask & ClientMask )
+ {
+ if (cmd)
+ fprintf(cmd,"client %d\n",nready);
+ xfer(client, server,login);
+ }
+
+ /* Then check on the other guy */
+ if( SelectReadMask & ServerMask )
+ {
+ if (cmd)
+ fprintf(cmd,"server %d\n",nready);
+ xfer(server, client,logout);
+ }
+ }
+
+ /* NEVER REACHED */
+}
+
+#define BUFSIZE 20000 /* Max bytes to move at a time */
+
+xfer(from, to,file)
+ int from, to; /* Move data from "from" to "to" */
+ FILE *file;
+{
+ static char buf[BUFSIZE]; /* Buffer data to be moved */
+ int nready; /* # bytes readable */
+ int got; /* # bytes actually being moved */
+ int ret;
+
+ /* Query the system how many bytes are ready to be read */
+ ioctl(from, FIONREAD, &nready);
+
+ if (cmd)
+ fprintf(cmd,"nready = %d\n",nready);
+
+ /* Only try to get the smaller of nready and BUFSIZE */
+ got = read(from, buf, nready < BUFSIZE ? nready : BUFSIZE);
+
+ /* Zero bytes returned indicates end of stream, exit gracefully */
+ if( got == 0 )
+ {
+ if (cmd)
+ {
+ fprintf(cmd,"read 0 bytes exiting\n");
+ fflush(cmd);
+ }
+ if (login)
+ fclose(login);
+ if (logout)
+ fclose(logout);
+ if (cmd)
+ fclose(cmd);
+ exit(EX_OK);
+ }
+
+
+ if (file)
+ {
+ fprintf(file,"\nTransaction %d\n",trans_num);
+ fwrite(buf,got,1,file);
+ fflush(file);
+ }
+ trans_num++;
+
+ /* Now send it accross to the other side */
+ ret = write(to, buf, got);
+
+ if (cmd)
+ {
+ fprintf(cmd,"wrote %d\n",ret);
+ if (ret < 0)
+ fprintf(cmd,"error = %s\n",strerror(errno));
+ }
+}
+
+int
+inet_conn(host, port)
+ char *host;
+ char *port;
+{
+ /* Local Vars */
+ int sock; /* Socket to use for the connection */
+ struct hostent *hostent; /* Destination host entry */
+ struct servent *servent; /* Destination service entry */
+ struct sockaddr_in addr; /* Formated destination for connect */
+
+ /* Fetch the requested host and service entries */
+ hostent = gethostbyname(host);
+ if (isdigit(*port))
+ servent = getservbyport(80, "tcp");
+ else
+ servent = getservbyname(port, "tcp");
+
+
+ if (cmd)
+ {
+ fprintf(cmd,"inet_conn %s %s\n",host,port);
+
+ if (servent == NULL)
+ fprintf(cmd,"servent is NIL\n");
+ if (hostent == NULL)
+ fprintf(cmd,"hostent is NIL\n");
+ if (hostent->h_addrtype != AF_INET)
+ fprintf(cmd,"not inet type\n");
+ fflush(cmd);
+ }
+
+
+ /* No host entry, no service entry, or host is not
+ Internet, error! */
+ if( servent == NIL ||
+ hostent == NIL ||
+ hostent->h_addrtype != AF_INET )
+ return -1;
+
+ /* Get a socket from the system to use for the connection */
+ if( (sock = socket(AF_INET, SOCK_STREAM, 0)) < 0 )
+ return -1;
+
+ /* Make sure we start with a clean address structure ... */
+ bzero(&addr, sizeof(addr));
+
+ /* ... then fill in the required fields */
+ addr.sin_family = AF_INET;
+ addr.sin_port = servent->s_port;
+ bcopy(hostent->h_addr, &addr.sin_addr, hostent->h_length);
+
+ /* Now try to connection to the destination */
+ if( connect(sock, &addr, sizeof(addr)) < 0 ) {
+ /* No go, release the socket, and then return error! */
+ close(sock);
+ return -1;
+ }
+
+ /* Success. Return the connected socket descriptor */
+ if (cmd)
+ fprintf(cmd,"returning %d\n",sock);
+ return sock;
+}
+
+
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index 167eb2ed5f3..2b3a48a75bf 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -152,8 +152,8 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
/* NT Entry was valid - even if 'X' or '*', can be overwritten */
*got_valid_nt_entry = True;
if (*p != '*' && *p != 'X') {
- if(gethexpwd(p,smbntpwd))
- pw_buf.smb_nt_passwd = smbntpwd;
+ if (gethexpwd((char *)p,(char *)smbntpwd))
+ pw_buf.smb_nt_passwd = smbntpwd;
}
}
pw_buf.smb_name = user_name;
@@ -167,12 +167,12 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
if (p[32] != ':')
return (False);
- if (!strncasecmp(p, "NO PASSWORD", 11)) {
- pw_buf.smb_passwd = NULL; /* No password */
+ if (!strncasecmp((char *)p, "NO PASSWORD", 11)) {
+ pw_buf.smb_passwd = NULL; /* No password */
} else {
- if(!gethexpwd(p,smbpwd))
- return False;
- pw_buf.smb_passwd = smbpwd;
+ if(!gethexpwd((char *)p,(char *)smbpwd))
+ return False;
+ pw_buf.smb_passwd = smbpwd;
}
pw_buf.smb_name = user_name;
@@ -189,8 +189,8 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
/* NT Entry was valid - even if 'X' or '*', can be overwritten */
*got_valid_nt_entry = True;
if (*p != '*' && *p != 'X') {
- if(gethexpwd(p,smbntpwd))
- pw_buf.smb_nt_passwd = smbntpwd;
+ if (gethexpwd((char *)p,(char *)smbntpwd))
+ pw_buf.smb_nt_passwd = smbntpwd;
}
}
return &pw_buf;
diff --git a/source/utils/status.c b/source/utils/status.c
index ed0ae532114..1ae38528d03 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -33,6 +33,7 @@
struct connect_record crec;
extern int DEBUGLEVEL;
extern FILE *dbf;
+extern pstring myhostname;
static pstring Ucrit_username = ""; /* added by OH */
int Ucrit_pid[100]; /* Ugly !!! */ /* added by OH */
@@ -69,7 +70,7 @@ int main(int argc, char *argv[])
return(1);
}
- while ((c = getopt(argc, argv, "pdsu:")) != EOF) {
+ while ((c = getopt(argc, argv, "pds:u:")) != EOF) {
switch (c) {
case 'd':
verbose = 1;
@@ -89,13 +90,13 @@ int main(int argc, char *argv[])
}
}
-
-
if (!lp_load(servicesf,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
return (-1);
}
+ get_myname(myhostname, NULL);
+
if (verbose) {
printf("using configfile = %s\n", servicesf);
printf("lockdir = %s\n", *lp_lockdir() ? lp_lockdir() : "NULL");
@@ -113,6 +114,9 @@ int main(int argc, char *argv[])
printf("You need to have status=yes in your smb config file\n");
return(0);
}
+ else if (verbose) {
+ printf("Opened status file %s\n", fname);
+ }
uid = getuid();