1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

486 Commits

Author SHA1 Message Date
Andrew Tridgell
19fea3242c the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f7)
2001-09-04 07:13:01 +00:00
Andrew Tridgell
464237cdb8 fixed handling of 139/445 in clients
(This used to be commit 22b372f8a7)
2001-08-24 20:11:09 +00:00
Andrew Tridgell
11ce0f4d2d a bunch of fixes from the sflight to seattle
in particular:
 - fixed NT status code for a bunch of ops
 - fixed handling of protocol levels in ms_fnmatch
(This used to be commit 3eba9606f7)
2001-08-20 05:15:26 +00:00
Simo Sorce
2e783a4707 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b4)
2001-08-12 17:30:01 +00:00
Simo Sorce
2f844bf447 Change all realloc() statements to Realloc() (ecxept for tdb.c)
changed some code to exploit the fact that Realloc(NULL, size) == malloc(size)
fixed some possible mem leaks, or seg faults.

thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c)
(This used to be commit 7f33c01688)
2001-08-08 16:54:16 +00:00
Tim Potter
afa7300006 Changed instances of TRUE, FALSE to True, False as some compilers don't
have the first set of symbols.
(This used to be commit ad0cbfbd79)
2001-07-12 22:27:00 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
6daea198a8 Applied Michael Sweet's patch, with one minor signal change.
Jeremy.
(This used to be commit 8d1dab74c2)
2001-07-03 00:52:56 +00:00
Andrew Tridgell
91b8a8d1d2 next_token() was supposed to be a reentrant replacement for strtok(),
but the code suffered from bitrot and is not now reentrant. That means
we can get bizarre behaviour
i've fixed this by making next_token() reentrant and creating a
next_token_nr() that is a small non-reentrant wrapper for those lumps
of code (mostly smbclient) that have come to rely on the non-reentrant
behaviour
(This used to be commit 674ee2f1d1)
2001-06-21 09:10:42 +00:00
Andrew Tridgell
9d5348c758 removed need for scandir in client.c
fixed possible bug with readdirname on systems with NAMELEN != strlen
(This used to be commit 78f448b7d4)
2001-05-07 05:19:52 +00:00
Andrew Tridgell
a636c642b5 new mput code from idra that doesn't need a call to find
(This used to be commit 5dac4cdee4)
2001-05-07 01:51:56 +00:00
Jeremy Allison
8f11c24b74 More gcc compile on solaris tidyups.
Jeremy.
(This used to be commit 956201c4fb)
2001-04-27 22:42:10 +00:00
Andrew Tridgell
d3e438d54f a couple of minor merges from 2_2
(This used to be commit 67aa587eb2)
2001-04-22 03:16:04 +00:00
Tim Potter
af08cd21eb Getting medieval with compiler warnings as Jeremy puts it.
(This used to be commit d05c3cf0f4)
2001-04-16 02:35:35 +00:00
Jeremy Allison
c9f2c1fc5e Fix from Tony Butt - shouldn't set got_pass for -c option.
Jeremy.
(This used to be commit 83aa762058)
2001-04-15 20:40:08 +00:00
John Terpstra
548ca26bd5 Patch from Mandrakesoft to ensure we close all files.
(This used to be commit 8051406588)
2001-04-14 18:39:32 +00:00
Jeremy Allison
6578fd8742 To stop people complaining about the mktemp call, move it into lib/util.c. Thanks
to Andrew for all this code. Fixed extra line in lib/sysacls.c that broke
XFS ACL code.
Jeremy.
(This used to be commit 9b32b8a8cf)
2001-04-11 23:19:08 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Jeremy Allison
4e35283a8b Fix for smbtar race condition from Glenn Burkhardt <glenn@aoi.ultranet.com>.
Jeremy.
(This used to be commit 0c9a92a055)
2001-03-26 22:34:25 +00:00
Jeremy Allison
7adb11393e Missed a cli_set_port on message code connect.
Jeremy.
(This used to be commit 799e043ae3)
2001-03-26 22:28:12 +00:00
Andrew Tridgell
e17e7b6417 added basic command completion support
(This used to be commit 386fdff2df)
2001-03-19 00:22:52 +00:00
Andrew Tridgell
bc25293f96 much simpler readline code
should work with readline 2.x
(This used to be commit 7940b6b0cf)
2001-03-18 23:41:53 +00:00
Andrew Tridgell
9c4927d362 much better readline support from Simo Sorce, with some mods from me
to make it a bit simpler
(This used to be commit e1487eb2c4)
2001-03-18 13:24:57 +00:00
Jeremy Allison
5b45f4a6a6 Updates for CUPS 1.1 from Michael Sweet.
Jeremy.
(This used to be commit 4e76f33869)
2001-03-16 19:17:04 +00:00
Jeremy Allison
a9855dedea Sync up Urbans changes from 2.2 into HEAD.
Jeremy.
(This used to be commit d0fcd91443)
2001-03-10 19:50:36 +00:00
Jeremy Allison
00ab9021b0 Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d)
2001-03-09 23:48:58 +00:00
Richard Sharpe
632ed01166 Fixes to testsmbc to ensure it will compile on SGI ...
(This used to be commit ad3a21b281)
2001-03-09 03:59:45 +00:00
Andrew Tridgell
4d6e45e41b the -m option to the client is back
(This used to be commit 69c13434f6)
2001-02-25 23:45:06 +00:00
Richard Sharpe
b206b16cb3 Fix a small problem where tree.c was using the creation time to display, rather than modification time. Creation time is not returned by the SMB protocol.
(This used to be commit d7f3793a2b)
2001-02-20 04:40:49 +00:00
Richard Sharpe
0ea6c2473b Improve the sample GTK+ client program to make it a bit more functional.
(This used to be commit 3e8366c58c)
2001-02-19 02:19:03 +00:00
Jeremy Allison
fd46817f0b Excise snprintf -> slprintf.
srv_samr.c: duplicate gid fix.
srv_spoolss_nt.c: Merge of JF's work.
uid.c: Fix for returning names when a PDC.
Jeremy.
(This used to be commit d938ad6963)
2001-02-16 19:21:18 +00:00
Richard Sharpe
b4b387e31b Fix calls to smbc_init in testsmbc.c and tree.c
(This used to be commit 244edad065)
2001-02-12 12:31:05 +00:00
Anton Blanchard
c15a054b21 io_bufsize was set too large and so full length reads
and writes got broken up into one ~64k and one ~1k packet.
(This used to be commit b91f906467)
2001-01-25 06:40:44 +00:00
Richard Sharpe
552d6bce08 Fixed bugs relating to Win2K and the need for a codepage so that unicode
strings can be handled correctly.
(This used to be commit 5629b097d4)
2001-01-14 00:11:29 +00:00
Richard Sharpe
fb40134446 Many bug fixes to the libsmbclient.c code plus
- an implementation of smbc_readdir
  - extensions to tree.c to show files in a second window
  - changes to auth_fn to provide buffers for username, password, etc
    from caller rather than callee
(This used to be commit 7f559c1a73)
2001-01-12 05:10:45 +00:00
Richard Sharpe
e646dddfde Update the tree.c GTK+ App so it can walk down directories etc ...
(This used to be commit 0490a0ed10)
2001-01-07 12:54:03 +00:00
Richard Sharpe
34fea75f35 Fix some more bugs in libsmbclient.c and add functionality to tree.c
(This used to be commit d6cef8877a)
2001-01-06 14:48:55 +00:00
Richard Sharpe
a0feaf62b7 Fix a minor problem with listing servers in a workgroup and add a
gtk+ test application that tests out some of this stuff ...
(This used to be commit 606c4aecea)
2001-01-06 12:15:46 +00:00
Richard Sharpe
b6e811b90b The latest changes to libsmbclient ...
It can now do a directory listing for workgroups, servers, and shares, and,
with a bit more effort, it will be able to list directories and files.

I also does not request a username and password for the IPC$ share, but it
should if the first attempt to connect fails.
(This used to be commit 38ff91c505)
2001-01-05 13:43:19 +00:00
Richard Sharpe
dca808cbc4 Needed a callback arg on cli_list ...
(This used to be commit d45e667a74)
2001-01-05 13:11:29 +00:00
Richard Sharpe
92ebc81734 I need a callback arg for cli_NetServerEnum and cli_RNetShareEnum, so I had
to modifiy any routine that calls it to pass NULL and so forth.

Should have no impact. It compiles OK.
(This used to be commit 7f862e387f)
2001-01-04 11:35:55 +00:00
Richard Sharpe
b87c484051 First pass at the libsmbclient code ...
This code handles the basic stuff and compiles and links under Linux, but
I do not know about any other operating systems. Now onto directory
listing routines, including those that list workgroups, servers, etc.

Nothing is built automatically yet, you have to make client/testsmbc to build
the library and test program. Also, no make install targets are defined for
libsmbclient.so as yet, either.

Would be good if people test on operating systems other than Linux.
(This used to be commit 51c0436a50)
2000-12-26 05:57:10 +00:00
Jeremy Allison
8d26523e90 Tar fixes from Craig Barratt craig@arraycomm.com.
Jeremy.
(This used to be commit cf05709ec3)
2000-11-22 23:06:29 +00:00
Gerald Carter
cb55856e4e fixed typo
jerry
(This used to be commit d2949468dc)
2000-09-14 16:47:49 +00:00
Gerald Carter
28c07a5e9f added -A <authfile> option to smbclient for the reading of username /
password credentials from a file.



--jerry
(This used to be commit e291500903)
2000-08-29 14:35:31 +00:00
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
88a97957e7 and yet another memory leak - this one in the client
(This used to be commit a85ae6e0ae)
2000-05-02 07:50:33 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Andrew Tridgell
700f72453e - removed all our old wildcard matching code and replaced it with a
call to ms_fnmatch(). This also removes all the Win9X semantics stuff
and a bunch of other associated cruft.

- moved the stat cache code into statcache.c

- fixed the uint16 alignment requirements of ascii_to_unistr() and
  unistr_to_ascii()

- trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as
  unicode always (at least thats what NT4 does)

- fixed some errors in the in-memory tdb code. Still ugly, but doesn't
  crash as much
(This used to be commit 03e9cea004)
2000-04-30 11:04:28 +00:00
Jeremy Allison
d56e3425a1 Fix for names with spaces and some I18N filename issues from
V. Fyodorov <V.Fyodorov@VAZ.RU>.
Jeremy.
(This used to be commit 4673aa1a4b)
2000-03-10 22:25:02 +00:00
Jeremy Allison
0f1eee5c7a client/client.c:
libsmb/clientgen.c: Fixes for Win2k smbclient browsing.
Other fixes implement smbpasswd -x user to delete users. Also allows swat
to do the same.
Jeremy.
(This used to be commit 9f6ad04676)
2000-02-25 22:25:25 +00:00
Jeremy Allison
451dcb3351 Fixed code page conversions of messages outgoing/incoming.
Jeremy.
(This used to be commit 84b045cbc8)
2000-01-27 01:09:21 +00:00
Jeremy Allison
d867b86721 Second set of inline optimisation fixes from Ying Chen <ying@almaden.ibm.com>.
Stop makeing function calls for every use of skip_multibyte_char. This function
is called several *million* times during a NetBench run :-).
Jeremy.
(This used to be commit e5a3deba46)
2000-01-26 00:12:35 +00:00
Andrew Tridgell
e8b5cb4515 cli_open() wasn't handling DENY_FCB or O_WRONLY correctly.
After fixing that I needed to use O_RDWR instead of O_WRONLY in
several places to avoid the silly bug in MS servers that doesn't allow
getattrE on a file opened with O_WRONLY
(This used to be commit e21aa4cb08)
2000-01-08 10:15:53 +00:00
Andrew Tridgell
171da4d787 this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()

this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
(This used to be commit b563be824b)
2000-01-07 06:55:36 +00:00
Jeremy Allison
20bd653b48 Fixed spurious error message when doing a 'put' of an empty file.
Jeremy
(This used to be commit 9ba8ad1d3d)
2000-01-06 21:23:49 +00:00
Jeremy Allison
c4914e2202 client/client.c: I18N fixes.
smbd/dir.c: Reformatting comments.
smbd/ipc.c: New password change code for Win98.
Jeremy.
(This used to be commit 9e90122afd)
2000-01-05 19:59:42 +00:00
Andrew Tridgell
3da55bfb8e changed %g to %3.1f to be friendly to our poor snprintf() code
(This used to be commit 6d506ee641)
1999-12-21 09:54:24 +00:00
Andrew Tridgell
a0b9e3ef4f client/smbspool.c from 2.0.6
(This used to be commit 599a7e7f9e)
1999-12-17 01:48:16 +00:00
Andrew Tridgell
32a965e09c 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0
(This used to be commit d7b2087865)
1999-12-13 13:35:20 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
6ddfc68e04 sys_select added one more argument (read, write selectors).
(This used to be commit e4d92ff9df)
1999-12-01 02:15:14 +00:00
Luke Leighton
9b68305475 whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.
found out that getopt() _must_ have optind set to 0 before reuse.

still haven't decided what to do with the net* api yet...
(This used to be commit 29c480085e)
1999-11-26 23:04:19 +00:00
Luke Leighton
eae9b12ca5 general, drastic improvements to rpcclient.
added samgroup <groupname> command
added samgroupmem <groupname> command

added proper registry key completion

added sam command user-completion (e.g samuser [tab])

added sam command group-completion (e.g samgroup [tab])
(This used to be commit bc5d021916)
1999-10-30 20:32:40 +00:00
Tim Potter
59bd1de1a5 Put back in GNU readline support for smbclient accidentally trashed by
tridge in the clientgen.c to clientutil.c conversion.
(This used to be commit 26d66071fb)
1999-07-09 03:34:09 +00:00
Luke Leighton
8e14594798 smbclient modified to use cli_establish_connection(). smbclient therefore
now uses improved authentication.  smbclient now "broken" for "scripts"
based on DEBUG() output.  cli_establish_connection() requires modification
to support old scripts.
(This used to be commit b0539d4340)
1999-06-29 19:39:23 +00:00
Alexandre Oliva
a8aff598f4 declare ttarf as double, as in client.c
(This used to be commit dfcfeb743a)
1999-03-30 10:41:07 +00:00
Alexandre Oliva
d963fb524c use double instead of SMB_BIG_UINT for dir_total and ttarf
(by tridge, merged from branch)
(This used to be commit b482ac8fc4)
1999-03-30 10:25:20 +00:00
Luke Leighton
754be76bde SMB_BIG_INT dir_total incompatible with %d: must use %llu (line 446)
(This used to be commit 1cece21246)
1999-03-25 21:01:08 +00:00
Alexandre Oliva
1db113b0a2 * client/client.c (dir_total): use SMB_BIG_UINT
* client/clitar.c (ttarf): ditto
* * lib/snprintf.c: support long longs; adapted from Cloyce D. Spradling's
patch <cloyce@headgear.org>
(This used to be commit 29581f8486)
1999-03-25 20:21:01 +00:00
Michael Warfield
894a824041 Got to the bottom of another weird one...
Piping the output of smbmount back to autofs/automount was causing the
automount process to hang.  Reason was that automount was depending
on the pipe to close to continue on, rather than detecting the child
signal.  This occured with debug enabled and the daemon process was not
closing the stdout process.  Disabling debuging avoids the problem.
Debugging is turned off in the cvs repository and a warning placed over
the debugging option.
(This used to be commit 329ceaee49)
1999-02-18 04:33:06 +00:00
Michael Warfield
e588ffdaa8 Added caching of user password if it was entered via getpass. We were already
caching the password if it came from the command line or from the environment.
This completes the set and deals with the bloody nusance when reconnecting
a connection after we have gone daemon...  Grrr...

Added code to clean up the mount point following a catastrophic failure
during reconnect.  The smbmount daemon was exiting but leaving the mount
point in an unusable state.  If smbmount must exit following a reconnect
failure, we "unmount" the mount point and clean up mnttab.  Currently,
the unmount works, fixing some really ugly I/O errors and failure when
trying to remount.  The cleanup on mnttab still has problems.  This
is better than what it was and doesn't break anything that wasn't broken
before, so I'm committing this in even with the mnttab problem.  Will
commit the fix to that when I figure out what is busted there...

	-mhw-
(This used to be commit ad8389804c)
1999-02-14 23:15:54 +00:00
Michael Warfield
cbbac5455c Fixed a glibc glitch in smbumount.c and reenabled some debugging
in smbmount.c
(This used to be commit 4b4a706213)
1999-02-13 18:36:49 +00:00
Luke Leighton
91403ea47d %s not $s
(This used to be commit 62118e15fe)
1999-02-03 16:30:54 +00:00
Michael Warfield
8fdc846070 Minor change to bring smbmount in the main branch in line with some bzero
to memset changes...
(This used to be commit 1cb8fcb33b)
1999-02-01 22:01:29 +00:00
Michael Warfield
f5ac863e5a Ok... Yet another round of fixes for smbmount and autofs.
1)  The earlier fix for the smbmount race conditions broke the PID
	registration with smbfs.  That fix has been backed out and
	replaced by a signalling convention from the child smbmount
	process back to the parent telling the parent when it is safe
	to exit.

2)  Fixing all of this uncovered a NASTY deadly embrace between smbmount,
	smbmnt, and autofs.  This was caused by the setsid call in the
	daemon code.  The smbmnt process no longer was registered as
	"magic" because it was no longer in the autofs process group.
	Many many kudos and thanks to H Peter Anvin for giving me the
	clue to solving this agravating puzzle.  The setsid was moved
	down the where the child signals the parent and a warn left in
	its place in the daemonize code.

3)  Fixed (actually worked around with a BUTT UGLY HACK) a problem with
	SMB_GET_MOUNTPID in smbumount.c.  The smb_fs.h header file has
	the parameter to this ioctl defined as a uid_t.  Unfortunately
	that's a 32 bit quantity under glibc and it's currently a 16 bit
	quantity in kernel space.  Undefined the macro and redefined
	it with a parameter of __kernel_uid_t.  That should keep us
	out of trouble till I can have someone fix smb_fs.h in the
	kernel sources...
(This used to be commit c5608093e4)
1999-01-31 21:28:55 +00:00
Luke Leighton
f6c646467d set_port warning / unused / global/local variable overlap issues
cmd_svcctl.c tests got put into cvs by mistake.
(This used to be commit 0ed70972d7)
1999-01-27 19:37:29 +00:00
Richard Sharpe
f5f913b001 Putting back the -p flag in smbclient.
However, it seems that the -s flag
in smbclient is also ignored :-(
(This used to be commit f6c7819266)
1999-01-25 01:46:14 +00:00
Richard Sharpe
8dac09c5a1 A small change to clitar.c (really, I promise :-)
If we are writing the tar file to stdout, set dbf to stderr
so that we do not screw up tar output with log info etc.

Compiles clean and tested with 38MB backup. Honest :-)
(This used to be commit 57301a3eb4)
1999-01-17 01:03:52 +00:00
Richard Sharpe
ddfe1d35fc Fixed problems in debug code because I did not compile
first :-(
(This used to be commit 47e36bed8f)
1998-12-19 02:08:35 +00:00
Richard Sharpe
a7e4be0e78 Added some debugging to clitar ...
(This used to be commit b75af70990)
1998-12-19 01:43:24 +00:00
Jeremy Allison
d5791b826d Fixed tar recurse bug.
Jeremy.
(This used to be commit 7be5c8e8f7)
1998-12-17 22:44:56 +00:00
Michael Warfield
da7a6d46b0 Earlier fix for smbmount timing window was the wrong patch.
My bad...  Earlier one was the patch from the CIFS conference that
didn't work, this fixes...
(This used to be commit 12739f0456)
1998-11-30 18:06:29 +00:00
Jeremy Allison
bfc38ff872 Makefile.in: Added maintainer mode fixes.
aclocal.m4: Added AC_LIBTESTFUNC.
configure.in: Fixed -lsecurity -lsec problems.
client.c: dos_ fixes.
groupdb/aliasunix.c: Dead code removal.
include/includes.h: Added default PRINTCAP_NAME.
lib/genrand.c: dos_ fixes.
lib/replace.c: Added strtoul.
lib/system.c: dos_ fixes.
lib/util.c: dos_ fixes.
lib/util_sid.c: Signed/unsigned fixes.
lib/util_str.c: removed bad const.
locking/locking_slow.c: dos_ fixes.
printing/printing.c: dos_ fixes.
rpc_server/srv_samr.c: Dead code removal.
rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN !
smbd/dir.c: dos_ fixes.
smbd/open.c: dos_ fixes.
smbd/oplock.c: dos_ fixes.
smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes.

Jeremy.
(This used to be commit 6acb4b68f6)
1998-11-25 21:17:20 +00:00
Jeremy Allison
768761820e Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't
compile cleanly. There are calls with incorrect parameters that
don't seem to be doing the right thing.

This code still needs surgery :-(.

Jeremy.
(This used to be commit 18ff93a9ab)
1998-11-17 20:50:07 +00:00
Jeremy Allison
b7c4cd9fc6 Fixed missing NULL check in tar op.
Jeremy.
(This used to be commit 6db04cd462)
1998-11-17 01:44:25 +00:00
Andrew Tridgell
3ba68d045c automatically uppercase server and share names (win95 won't handle
lowercase share names!)
(This used to be commit dddf1d8522)
1998-11-14 04:16:07 +00:00
Andrew Tridgell
c57ab7807d fixed setmode in smbclient
(This used to be commit c58f496510)
1998-11-14 04:08:19 +00:00
Andrew Tridgell
fedc62d17a - handle servers that don't support getattrE (ie. NT)
- use * in clitar instead of *.*
(This used to be commit 2d9335fe2a)
1998-11-14 03:53:24 +00:00
Jeremy Allison
2a28d20f20 Fixed problem with smbclient issuing '*.*' to NT server when an
NT server needs '*'. Win95/98 doesn't care either way :-).
Jeremy.
(This used to be commit a0adae90ca)
1998-11-14 03:34:44 +00:00
Andrew Tridgell
2b67f7eba4 prompt for password on smbclient -L
(This used to be commit 1558f34a87)
1998-11-14 02:34:19 +00:00
Jeremy Allison
8fc1504ff8 Makefile.in configure configure.in include/config.h.in: Changes for DGUX and UNIXWARE.
groupdb/aliasdb.c groupdb/aliasfile.c groupdb/groupfile.c: Don't use snprinf, use slprintf.
include/includes.h: Fix YP problem.
include/smb.h: Fix ZERO_STRUCTP.
lib/util_sock.c: Added strerror() in debugs.
passdb/ldap.c: Don't use snprinf, use slprintf.
rpc_client/cli_lsarpc.c rpc_client/cli_pipe.c rpc_parse/parse_sec.c rpc_server/srv_pipe.c: Don't use snprinf, use slprintf.
script/installman.sh: DGUX changes.
smbd/open.c smbd/oplock.c: Fixed gcc warnings.
web/swat.c: Changes USER to SWAT_USER.
(This used to be commit 4c2b5a0098)
1998-11-13 21:41:01 +00:00
Michael Warfield
9c3cbb8012 Fixed timing window created by daemonize function. Smbmount was going daemon
before the mount was actually completed.  This caused weird problems when
used with autofs such as empty directories on first listing or files which
would appear in "ls" but would return "no such file or directory" under
"ls -l".  Note to Volker:  Initial attempt from CIFS conference didn't work.
Had to move daemonize function inside of loop after ioctl.
(This used to be commit 2f456be660)
1998-11-13 20:32:22 +00:00
Andrew Tridgell
2db96e3047 fixes for OSF1 compilation
(This used to be commit 5be3c37f50)
1998-11-13 03:37:01 +00:00
Andrew Tridgell
c1bf51bd2c please remember to check that code compiles before checkin!
(This used to be commit 88c90ec65c)
1998-11-12 23:10:48 +00:00
Herb Lewis
d30b6ab548 .cvsignore: Removed old entries.
client/client.c:
include/client.h: Added some debug messages that the old client used to
		  generate. These are needed to make scripts such as
		  'findsmb' work - there may be other changes to keep
		  backwards output compatibility. Do we need a -old-client-compat
		  argument ?
libsmb/clientgen.c: Fixed crash bug where malloc'ed data wasn't being
		    cleared - corrupted malloc chains.
web/swat.c: John's changes to get rid of "ghost" table entries.
(This used to be commit 3c45a3503e)
1998-11-12 22:17:51 +00:00
Jeremy Allison
e4f974c611 Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions.
client/client.c:
client/clitar.c:
include/client.h:
smbwrapper/smbw_dir.c:
smbwrapper/smbw_stat.c:
smbwrapper/smbw.c:
lib/util.c: Converted all use of 'mode' to uint16.
smbd/quotas.c: Fixed stupid comment bug I put in there :-(.
printing/printing.c: Fix from J.F. to new code.
Jeremy.
(This used to be commit bacd3e9d20)
1998-11-09 20:33:37 +00:00
Andrew Tridgell
8c62b28e0e converted smbclient to use clientgen.c rather than clientutil.c
I did this when I saw yet another bug report complaining about
smbclient intermittently missing files. Rather than applying more
patches to smbclient it was better to move to the more robust
clientgen.c code.

The conversion wasn't perfect, I probably lost some features of
smbclient while doing it, but at least smbclient should be consistent
now. It if fails it should _always_ fail rather than giving people the
false impression of a reliable utility.

the tar stuff seems to work, but hasn't had much testing as I never
use it myself. I'm sure someone will find bugs in my conversion of
smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It
now uses clientgen.c exclusively.

smbclient is still quite messy, but at least it doesn't build its own
SMB packets.

I haven't touched smbmount as I never use it. Mike, do you want to
convert smbmount to use clientgen.c?
(This used to be commit e14ca7765a)
1998-11-09 03:45:49 +00:00
Jeremy Allison
c082539152 client/client.c: Patch to tidy up file size output.
nmbd/nmbd.c: Someone (a "yank" no doubt :-) Changed instances of "initialise" to
             "initialize". Someone get that man an *English* dictionary.... :-) :-).
Jeremy.
(This used to be commit 6279be7f96)
1998-11-02 18:12:28 +00:00
Jeremy Allison
54ebe3fa01 Tidied up option processing in smbclient - usage message now actually
reflects the real options. Removed '-S' option - couldn't see what
this was doing (seemed to have something to do with nt_domain_logon ?).
Luke please check if you needed this code (code is only #ifdef'ed out
and can be re-instated).
Did this to make writing of yodl smbclient man page possible :-).
Jeremy.
(This used to be commit 97a14db756)
1998-10-29 02:18:17 +00:00
Andrew Tridgell
d9ebe8dcea fix for John.
don't seek unless absolutely necessary on files in do_put()
(This used to be commit 9d33d405cd)
1998-10-24 08:24:11 +00:00
John Terpstra
b0c360c25a Unlink zero length files that did NOT exist at the point of origin on a do_get() call.
(This used to be commit 98ba0b3a0a)
1998-10-24 02:49:09 +00:00
Andrew Tridgell
a6298e2cba use the username GUEST if no other username is available
(This used to be commit 59d99ad76c)
1998-10-16 17:05:19 +00:00
Andrew Tridgell
8043472753 fixed a bug in the readline support
(This used to be commit b0a6962250)
1998-10-08 22:12:13 +00:00
Andrew Tridgell
52d52a5131 somehow "in_client" got included twice in two places.
(This used to be commit 378290bfe1)
1998-10-07 01:03:35 +00:00
Richard Sharpe
0cf1ea4e2e Added capability for smbclient to use the local WINS server on the same
machine if WINSsupport configured
(This used to be commit 1398feebbc)
1998-10-06 23:46:01 +00:00
Andrew Tridgell
fe2681dd4b fixed a cast warning
(This used to be commit 4093bb16d2)
1998-10-05 12:34:43 +00:00
Andrew Tridgell
40984f6b55 - modified resolve_name() to take a name_type
- cleaned up resolve_name() (split into separate functions for each resolver)
- if can't find local master then use #1B name
- support listing of foreign workgroups in /smb/
(This used to be commit a4e607c17d)
1998-10-04 12:00:40 +00:00
Andrew Tridgell
f2c43ee039 support using #xx at end of netbios name to connect to the specified name type
(This used to be commit bf409a40e2)
1998-10-04 10:48:31 +00:00
Richard Sharpe
832ca93117 Added E Jay Berkenbilt's fixes
(This used to be commit fcdc9bc208)
1998-10-04 07:09:38 +00:00
Michael Warfield
4828c1c3b8 Removed a redundant include for "includes.h"
Cleaned up a prototype warning message.
smbumount.c now compiles warning free.
(This used to be commit 3459541abc)
1998-09-30 03:02:35 +00:00
Jeremy Allison
9a5f40cadf Fixed uid->vuid confusion in smbmount (hopefully).
Jeremy.
(This used to be commit 60c2278e8c)
1998-09-30 00:25:04 +00:00
Jeremy Allison
f82217a589 Fixed extern definition of cnum in clitar.c
Jeremy
(This used to be commit 6c08f3b81c)
1998-09-29 22:52:38 +00:00
Jeremy Allison
9066025a8a Got very strict about the differences and uses of
uid_t, gid_t and vuid. Added sys_getgroups() to get
around the int * return problem. Set correct datatypes
for all uid, gid and vuid variables.
Jeremy.
(This used to be commit e570db46fc)
1998-09-29 20:24:17 +00:00
Alexandre Oliva
a2d7f765e8 get away with dummy and .dummy files
(This used to be commit 90a8a02484)
1998-09-29 04:52:17 +00:00
Richard Sharpe
e1d962659f Now have a better solution to the need to have smblcient find
a WINS server if running on the WINS server.  As suggested by
Andrew, we have a flag, in_client=False by default, and set it
to True in the client.  loadparam.c checks this and sets
szWINSserver to 127.0.0.1 when in_client && bWINSsupport.

BTW, we seem to have picked up and unused value in some of
Luke's new code.
(This used to be commit b665756bfc)
1998-09-29 04:43:40 +00:00
Jeremy Allison
4746a0b93f Fixed stupid bug with "cd /" appending a "/" character to the path forever....
Jeremy.
(This used to be commit 14ee57f336)
1998-09-29 01:55:48 +00:00
Jeremy Allison
008fd97309 Fixed problems found in lint pass over the old code by <cpeterso@microsoft.com>.
These were the problems that still existed in the 2.0 branch.
Jeremy.
(This used to be commit 3fd28812f7)
1998-09-28 23:55:09 +00:00
Jeremy Allison
cf3a9741dc Changes to test in configure if capabilities are enabled on a system.
Changes to get Samba to compile cleanly with the IRIX compiler
with the options : -fullwarn -woff 1209,1174 (the -woff options
are to turn off warnings about unused function parameters and
controlling loop expressions being constants).
Split prototype generation as we hit a limit in IRIX nawk.
Removed "." code in smbd/filename.c (yet again :-).
Jeremy.
(This used to be commit e0567433bd)
1998-09-28 21:43:48 +00:00
Michael Warfield
cdaa53e3ef Two changes in this ball...
1) Changes to smbmnt.c, smbmount.c, and smbumount.c allow them to compile on
both RedHat 4.x (libc 4.x) systems and RedHat 5.x (glibc 2) systems.

2) Changes to Makefile.in and configure.in (and subsequently configure) are to
configure for smbmount, smbumount, and smbmnt to compile.

This adds a "--with(out)-smbmount" option to configure.  Sanity checking is
not present yet.  You can specify this if you are not on linux, it just
won't compile.
(This used to be commit 8a4730f619)
1998-09-28 19:18:21 +00:00
Alexandre Oliva
cf971f88ac automated generation of .dummy files for each subdirectory;
dummy.in files are no longer needed, and new directories will be taken
care of automatically, at configure (or config.status --recheck) time
(This used to be commit 237a8e5fe6)
1998-09-28 00:14:36 +00:00
Alexandre Oliva
464f71f414 wait_keyboard must still be defined if readline is not available
(This used to be commit dc21f6c982)
1998-09-27 20:38:06 +00:00
Richard Sharpe
ecd8ca2431 Fixed up more possibly uninitialized variables.
Now only two compilation warnings seem to be left.

Luke may want to check the changes I made.
(This used to be commit 2456c95c16)
1998-09-27 08:29:50 +00:00
Richard Sharpe
1ea570da83 Small update to clitar.c to omit warnings about servers not
letting us change the date unless tar_real_noisy is True.

Also updated a few places where variables are declared but not set.
(This used to be commit b46f1024c9)
1998-09-26 00:41:20 +00:00
Luke Leighton
1631d3fba7 not needed.
(This used to be commit 78b5c15121)
1998-09-25 16:01:14 +00:00
Richard Sharpe
921b171acf Added a minor fix to clitar.c for a bug.
Could not check that it compiles clean with Jeremy's -Wflags because
someone loaded some changes to reply.c that break in the locking area

:-(
(This used to be commit b18cd03c0b)
1998-09-24 13:43:36 +00:00
Richard Sharpe
474110e3e0 Fixed data corruption bugs in clitar.c with restores.
Have tested against samba with clitar using a hard-coded
max_xmit of 2920, since max smit = 2920 does not seem to work in
the smb.conf file.

Will have to test correctly against Win95 and WinNT now.

Have also compiled with -WJeremy'sFlags and get no more warnings
after I removed an unused variable.
(This used to be commit f24bbaccda)
1998-09-23 14:37:01 +00:00
Jeremy Allison
242d068297 Fixed up warnings in new client code.
Note to coders. If using gcc please use the compiler flags :
-Wall -Werror -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual
*before* checking anything in to ensure a clean compile.
Jeremy.
(This used to be commit 1daf424da6)
1998-09-23 00:57:34 +00:00
Alexandre Oliva
e649750cb4 major autoconf clean-up
fix problems in builds with srcdir!=builddir
(This used to be commit 1ffc3b807a)
1998-09-21 09:07:08 +00:00
Alexandre Oliva
81babe9b0d implemented du and tar -n
(This used to be commit 23484508a8)
1998-09-21 08:45:11 +00:00
Richard Sharpe
b65bbdeefc Fixed changes in clitar.c that Jeremey noted. One change was
correct, the other needed slightly changing.

Now to test it is all OK :-)
(This used to be commit d54c91598c)
1998-09-19 04:25:10 +00:00
Jeremy Allison
717f538e2e Fixed compile errors in new code.
Jeremy.
(This used to be commit dbd8ce8a70)
1998-09-18 17:32:35 +00:00
Richard Sharpe
c198d4c8be Adding rewritten restore code ... Old code is still there
surrounded by a OLD_DOTARPUT.
(This used to be commit 00ba54d4ee)
1998-09-18 12:47:46 +00:00
Jeremy Allison
9b20e5bac2 Ok so with this bugfix 64 bit file access actually seems to work :-).
Problems were just dumb bugs like (defining sys_lseek to return 'int' DOH !).

Jeremy.
(This used to be commit 54dd51176f)
1998-09-11 21:42:18 +00:00
Andrew Tridgell
012e575e13 ahh, the joy of deleting large chunks of code that someone else has
painstakingly put in :)

This gets rid of most of the #ifdef LARGE_SMB_INO_T ifdefs around
DEBUG() statements. We just use %.0f in all cases. Makes the code a
bit easier to read :)
(This used to be commit 41f0069afc)
1998-09-05 05:23:29 +00:00
Andrew Tridgell
e9ea36e4d2 tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois
pointed out I added a make target "finddead" that finds potentially
dead (ie. unused) code. It spat out 304 function names ...

I went through these are deleted many of them, making others static
(finddead also reports functions that are used only in the local
file).

in doing this I have almost certainly deleted some useful code. I may
have even prevented compilation with some compile options. I
apologise. I decided it was better to get rid of this code now and add
back the one or two functions that are needed than to keep all this
baggage.

So, if I have done a bit too much "destroying" then let me know. Keep
the swearing to a minimum :)

One bit I didn't do is the ubibt code. Chris, can you look at that?
Heaps of unused functions there. Can they be made static?
(This used to be commit 2204475c87)
1998-09-05 05:07:05 +00:00
Jeremy Allison
7bb86c1b13 Ok - this is the 64 bit widening check in. It changes the configure
to check for stat64 and friends, and then changes much of Samba
to use the data type SMB_OFF_T for file size information.

stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide
the 64 bit calls if needed.

Note that this still does not expose 64 bit functionality to the
client, as the changes to the reply_xxx smb's are not yet done.

This code change should make these changes possible.

Still to do before full 64 bit-ness to the client:

fcntl lock code.
statfs code
widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T
types being in place).

Let me know if wierd things happen after this check-in and I'll
fix them :-).

Jeremy.
(This used to be commit 14500936c3)
1998-09-03 18:40:31 +00:00
Jeremy Allison
1855627413 More abstraction of file system data types, to move to a 64
bit file interface for the NT SMB's.

Created a new define, SMB_STRUCT_STAT that currently is
defined to be struct stat - this wil change to a user
defined type containing 64 bit info when the correct
wrappers are written for 64 bit stat(), fstat() and lstat()
calls.

Also changed all sys_xxxx() calls that were previously just
wrappers to the same call prefixed by a dos_to_unix() call
into dos_xxxx() calls. This makes it explicit when a pathname
translation is being done, and when it is not.

Now, all sys_xxx() calls are meant to be wrappers to mask
OS differences, and not silently converting filenames on
the fly.

Jeremy.
(This used to be commit 28aa182dbf)
1998-09-01 20:11:54 +00:00
Andrew Tridgell
61b5fd6f32 bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7)
1998-08-31 03:11:42 +00:00
Andrew Tridgell
56cbed3904 allow smbclient to connect to IPC$ as an IPC service
(This used to be commit 275679db29)
1998-08-30 04:37:07 +00:00
Jeremy Allison
38142a1ebb This checking fixes the statcache bug that stopped NetBench from running
correctly. Added new parameter "stat cache size" - set to 50 by default.

I now declare the statcache code officially "open" for business :-).
It gets a hit rate of 97% with a NetBench run and seems to make
using a case insensitive run as efficient as a case sensitive run.

Also tidied up our sys_select usage - added a maxfd parameter and
also added an implementation of select in terms of poll(), for systems
where poll() is much faster. This is disabled by default.

Jeremy.
(This used to be commit 779b924ec1)
1998-08-28 21:46:29 +00:00
Jeremy Allison
e13aeea928 configure: Changes for extra headers.
configure.in: Source for header changes.
client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile.
include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers.
include/includes.h: Headers for the above.
include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int).
lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/debug.c: Fixed signal functs.
lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile.
libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem_sysv.c: Fixed error messages in sysV stuff.
nmbd/asyncdns.c: Fixed signal functs.
nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/nttrans.c: Fixed fsp code path.
smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem.
smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/trans2.c: Fixed core dump bug.
smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile.
Jeremy.
(This used to be commit 1b9cbcd02e)
1998-08-15 01:19:26 +00:00
Andrew Tridgell
b9623ab59e this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c

I might have broken something with this change. In particular the
oplock code is suspect and some .dll files aren't being oplocked when
I expected them to be. I'll look at it after I've got some sleep.
(This used to be commit c7ee025ead)
1998-08-14 17:38:29 +00:00
Andrew Tridgell
58fb3c31c0 remove an unused variable
(This used to be commit 6f9228b011)
1998-08-14 06:26:31 +00:00
Christopher R. Hertel
5032122753 Changed a call to fflush(dbg) to dbgflush().
(This used to be commit c626828471)
1998-08-12 15:27:13 +00:00
Christopher R. Hertel
08feb74221 I've added a dbgflush() function to debug.c. Calling this will cause the
debug format buffer to be written out (and reset).  fflush() is also called
to force the issue.  I replaced the call to fflush() in client.c with a
call to dbgflush(), which seems to have fixed the problem that Andrew was
working on (i.e., that the prompt was not displayed when using smbclient).

Chris -)-----
(This used to be commit a97460869f)
1998-08-12 14:51:17 +00:00
Jeremy Allison
9042aa41c3 Makefile.in: Added CHECK target back in (at Herb's request). Added
manpath in (although we don't currently use it).
client/client.c: Added John Blair's fixes for "put -".
include/nterr.h: Added NT_STATUS_NOTIFY_ENUM_DIR error code.
smbd/nttrans.c: Added in devious fix for one-shot NT change notify bug.
Jeremy.
(This used to be commit 4ac3091e57)
1998-08-11 02:13:01 +00:00
Andrew Tridgell
87bcd5502c added ignore rules for the dummy files
(This used to be commit 687f76a17d)
1998-08-09 11:25:49 +00:00
Andrew Tridgell
27ff18a184 these dummy files are needed for autoconf processing
(This used to be commit be762dc3de)
1998-08-09 11:24:15 +00:00
Richard Sharpe
4fa20ebdc0 Fixing clitar.c so that tar to stdout works correctly.
Replaced printfs with DEBUG(0. Tested ... Works.

Hope I didn't disturb the autoconf code ... It feels
great to be able to run configure for Samba at long last!

Regards
Richard Sharpe
(This used to be commit b968aa31ba)
1998-08-03 10:35:00 +00:00
Christopher R. Hertel
28900ea26f As per a Andrew's message, I went through and removed the timestring()
timestamps from several DEBUG messages.  The timestamps are redundant now
that DEBUG() provides them automatically.

There are still a few more files to do, but I've got to get home for dinner.

Chris -)-----
(This used to be commit 60286cceca)
1998-07-31 22:39:15 +00:00
Andrew Tridgell
64578c0589 merge from the autoconf2 branch to the main branch
(This used to be commit 3bda7ac417)
1998-07-29 03:08:05 +00:00
Jeremy Allison
bc39cff279 clitar.c: Fixed gcc warning with comment in /* */ code.
nmbd_winsserver.c: Remember to free packet in multi-homed register code.
                   Use correct query_name_from_wins_server call instead of
                   query_name call in multihomed code.
Jeremy.
(This used to be commit 6e995802fe)
1998-06-25 23:51:28 +00:00
Richard Sharpe
9d001d5c95 Arrrgh, one more fix. Restores of long file names were
broken ...

Added a bzero of the buffer the names went into ...

Seems OK now ...

Richard Sharpe
(This used to be commit c749c8d046)
1998-06-22 06:31:39 +00:00
Richard Sharpe
8afebcdd7e Remove the copyright to Canon Information Systems Australia, as we don't
want them to have the copyright.

Added a new DOSERR response code that Win95 returns, unimp, unimplemented.

Added code to ignore errors on setting remote time, as Win 95 does not like
the time being changed on a directory.  Win NT and Samba are OK at this.

This is the next to last clean-ups here. Next is to properly handle restore
times on directories (except for Win95--see above).

Now have Jay's changes in and have fixed a bug reported by Tim Lee.
(This used to be commit dc9436bae4)
1998-06-21 12:44:34 +00:00
Jeremy Allison
55da32fb45 clitar.c: Fixed minor gcc -pedantic-error compile warnings.
passdb.c: Fixed stupid bug in read_sid_from_file().
Jeremy.
(This used to be commit e65efe3f78)
1998-06-20 10:06:26 +00:00
Richard Sharpe
c47cce6dd9 Re-submit changes for CLITAR.
Have fixed the location of create_string_s back to clitar.c, and have
added Jay Berkenbilt's changes.

Have used safe_strcpy and safe_strcat everywhere and have tested with
long file names extensively, but have not yet been able to check that
it works OK on Solaris.
(This used to be commit daf239a188)
1998-06-17 01:52:57 +00:00
Jeremy Allison
bbd7ca65e7 clientgen: Added USE_SSL for client shutdown.
clitar.c: Added 'Samba style' comments before string_create_s().
loadparm.c: Fixed missing comma in SSL code.
util.c: Removed string_create_s(). Currently it's only called from
        clitar.c and having it here as well as a static in clitar
        causes the compile to break (Richard, please decide where
        you want this function).
lib/rpc/parse/parse_net.c: Fix from <anders.blomdell@control.lth.se>
                           to stop coredump on missing parameter.
Jeremy.
(This used to be commit d23b443225)
1998-06-16 18:25:36 +00:00
Jeremy Allison
cb757820f5 Added SSL support from Christian Starkjohann <cs@obdev.at>
This patch may not yet compile with -DUSE_SSL enabled, further
Makefile changes may be needed. But it was important to get
this code in place before I go off to USENIX.
Jeremy.
(This used to be commit 31e768369f)
1998-06-16 01:35:52 +00:00
Jeremy Allison
7ed5a181ac client.c: Made -L do a null-session share unless -U user is specified.
clientutil.c: Fixed NT session to add NT password.
groupname.c: Added lookup function.
Jeremy.
(This used to be commit 8216363e83)
1998-06-15 22:02:14 +00:00
Jeremy Allison
644fbaaf9b Makefile:
smbumount.c: Added fixes to compile under Linux.
includes.h: Added SunOS 4.x QSORT_CAST fix.
reply.c: Fixed user name mapping function for security=server, security=domain.
Jeremy.
(This used to be commit 21ca6bfb3b)
1998-06-15 18:19:54 +00:00
Jeremy Allison
28029c73b7 client.c: Allowed client to proceed even if it gets error 234 (more data
available) when scanning server/workgroup/share lists.
ipc.c: Removed redundent definition of ERROR_MORE_DATA (234) we already have
       ERRmoredata in smb.h
Jeremy.
(This used to be commit ae3510e9fb)
1998-06-04 18:49:13 +00:00
Jeremy Allison
ffe91d6443 clientutil.c: Don't core dump if no controlling terminal available for password.
passdb.c:
lib/rpc/include/rpc_misc.h: First cut at automatic uid/gid to rid mapping.
We can change this at a later date to make more bits available if neccessary.
Jeremy.
(This used to be commit 34f40474ab)
1998-06-01 18:50:27 +00:00
Jeremy Allison
ee9a61841a includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don't
have vsnprintf.
locking_slow.c: slight tidy.
make_smbcodepage.c: Use safe_strcpy instead of pstrcpy.
nmbd_winsserver.c: Use pstrcpy instead of fstrcpy.
smbmount.c: Fixed reported bug.
util.c: Removed old fstrcpy/fstrcat functions.
Jeremy.
(This used to be commit f257d2e4ba)
1998-05-12 22:11:24 +00:00
Jeremy Allison
f888868f46 This is a security audit change of the main source.
It removed all ocurrences of the following functions :

sprintf
strcpy
strcat

The replacements are slprintf, safe_strcpy and safe_strcat.

It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.

Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.

Jeremy.
(This used to be commit 2d77445400)
1998-05-12 00:55:32 +00:00
Andrew Tridgell
b3cd94780d don't use system functions as arguments to qsort() as otherwise you
get stuck on systems with broken headers (like SunOS4). In this case
use StrCaseCmp instead of strcasecmp
(This used to be commit 1386c6e25a)
1998-05-11 08:41:09 +00:00
Andrew Tridgell
3dfc0c8472 changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf()
using mprotect() and a non-writeable page.

This should prevent any sprintf based security holes.
(This used to be commit ee09e9dadb)
1998-05-11 06:38:36 +00:00
Jeremy Allison
9f57f01b14 clitar.c: #ifdef'ed out all the bits that were giving 'defined but not used'
messages.
nttrans.c: More updates.
smb.h: Removed stuff that didn't belong in the smb_passwd struct. Persuaded Luke
       to use a new structure.
web/swat.c: Fixed gcc complaints about shadowing global 'string'.
Jeremy.
(This used to be commit 61c1dbb978)
1998-05-08 16:59:30 +00:00
Richard Sharpe
bb8706f407 Se-submitting clitar.c/
I now only have one warning in my code which is the result of some code I have started
working on but am not yet using in the code, along with a warning that is caused
by one of the include files (a nested comment).

I used -Wall -Wshadow -Wstrict-prototypes
(This used to be commit 7b98fd5b69)
1998-05-08 13:51:17 +00:00
Jeremy Allison
2b4d426726 Rolling back again to the equivalent of revision 1.22, as the current
CVS head branch will not compile.
Jeremy.
(This used to be commit 18a0a10dcb)
1998-05-06 17:54:28 +00:00
Richard Sharpe
b59916ebf7 Real fix for clitar.c problems. Have now made all the right
things static, and have done a 'make proto; make clean; make'.

Still get 54 compiler warnings under Digital UNIX cc.

Honest. :-)
(This used to be commit 47eb7e5be2)
1998-05-06 02:35:56 +00:00
Jeremy Allison
905261c53c Rolling clitar.c back to the previous rev 1.22 as the current one
needs fixing (sorry).
Jeremy.
(This used to be commit 50f75b1146)
1998-05-05 18:11:24 +00:00
Richard Sharpe
38b8e524ea Added bug fixes to clitar to ensure proper longfile name restores
occur.

Also getting ready for setting directory dates correctly
(This used to be commit fc0cad9035)
1998-05-05 13:03:44 +00:00
Jeremy Allison
e7ac86607c This looks like a big change but really isn't.
It is changing the global variables "myname" and "myworkgroup"
to "global_myname" and "global_myworkgroup" respectively.

This is to make it very explicit when we are messing
with a global (don't ask - it makes the domain client
code much clearer :-).

Jeremy.
(This used to be commit 866406bfe3)
1998-04-25 01:12:08 +00:00
Jeremy Allison
cac6a060af Changes to allow Samba to be compiled with -Wstrict-prototypes
with gcc. (Not a big change although it looks like it :-).

Jeremy.
(This used to be commit cd2613c572)
1998-04-13 19:24:06 +00:00
Richard Sharpe
e0c21df69a Changes to client.c support the need for directories to be processed by whatever
action is passed to do_dir.

Changes to clitar.c as requested by Canon Information Systems Research Australia:

1. Support restoring long file names
2. Write directory entries to TAR files as first part of setting directory create
   times
3. Ensure zero length files get correct mtime
4. Allow DOS and UNIX pathnames in command line parameters.
(This used to be commit 0c228f0b33)
1998-04-11 07:52:13 +00:00
Jeremy Allison
612cbb6a60 Patch from Chris Maltby <chris@softway.com.au>. His comments follow:
+ improvement to smbtar to allow exclusion/inclusion of system and
    hidden files, and to generate a listing of what has been archived
    in a format useful for automated backup systems.

  + add the "Softq" spooling system to samba's printing capabilities.

  + I have "fixed" the intrusion of US style dates into samba reporting
    as well. The format yyyy/mm/dd is not only uunambiguous, but also
    has the benefit of making lexicographic sorts work correctly.

Jeremy.
(This used to be commit f9dacd1d8b)
1998-04-02 01:01:24 +00:00
Jeremy Allison
6cd35ce945 client.c: Fixed problem where debug level on command line was overridden by smb.conf.
smbpasswd.c: Removed bugs I put in yesterday (thanks Luke :-) and added error
message reporting for remote password changing.
Jeremy.
(This used to be commit 6a3394a285)
1998-03-26 19:11:31 +00:00
Jeremy Allison
7abbf368f9 Adding the same changes to HEAD as were added to BRANCH_1_9_18.
Changed smbpasswd to be client-server for a normal user, rather
than accessing the private/smbpasswd file directly (it still accesses
this file directly when run as root, so root can add users/change a
users password without knowing the old password).

A shakeout of this change is that smbpasswd can now be used to
change a users password on a remote NT machine (yep - you heard
that one right - we can now change a NT password from UNIX !!!!!).

Jeremy.
(This used to be commit 20770b6f1c)
1998-03-19 20:06:47 +00:00
Jeremy Allison
c54af0f8b2 Adding the same change as was added to 1.9.18 branch to add the
"name resolve order" parameter.

source/Makefile: Re-ordered link for name resolve order code.
source/clientgen.c:
source/clientutil.c: Added calls to resolve_name().
source/includes.h: Added HPUX zombie fix.
source/loadparm.c: Added new name resolve order parameter.
source/namequery.c: Re-wrote to include parsing of lmhosts file, new resolve_name()
                    function requested by John.
source/nmbd.c: Tell resolve_name not to do WINS lookups if we are the WINS server.
source/nmbd_lmhosts.c: Call lmhosts parsing functions in namequery.c
source/password.c: Call resolve_name() to lookup security=server name.

source/reply.c:
source/time.c:
source/trans2.c: "fake directory create times" fix from Jim Hague - hague@research.canon.com.au.
source/util.c: Removed isalnum() test in Get_Hostname() that seems to cause
               problems on many systems.

Jeremy.
(This used to be commit 7f118970da)
1998-03-16 20:59:47 +00:00
Andrew Tridgell
b85346942e another makeover of loadparm to support new stuff in swat and
testparm.

In particular I added:

- ability to optionally save default values of all parameters when
  calling lp_load(). This can then be used to save only non-default
  parameters in lp_dump(). This makes the saved smb.conf (and viewed
  parameters in testparm) much shorter

- ability to not load ipc share in lp_load()

- separators in parm_table[] so parameters can be grouped logically.

- flag to mark parameters that are local but which should be also
  viewed as global as far as parameters editing is concerned
(This used to be commit f9af35da26)
1998-03-14 08:27:41 +00:00
Jeremy Allison
fdeea341ed "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
(This used to be commit 118ba4d77a)
1998-03-11 21:11:04 +00:00
Jeremy Allison
b7fb6c6b38 Change the multibyte character set support so that
Kanji support is one case of multibyte character
support, rather than being a specific case in
single byte character support.

This allows us to add Big5 Chinese support (code page 950)
and Korean Hangul support (code page 949) at very little
cost. Also allows us to easily add future multibyte
code pages.

Makefile: Added codepages 949, 950 as we now support more multibyte
codepages.
asyncdns.c: Fixed problem with child being re-spawned when parent killed.
charcnv.c
charset.c
client.c
clitar.c
kanji.c
kanji.h
smb.h
util.c
loadparm.c: Generic multibyte codepage support (adding Big5 Chinese
            and Korean Hangul).
nmbd.c: Fixed problem with child being re-spawned when parent killed.
mangle.c: Modified str_checksum so that first 15 characters have more
          effect on outcome. This helps with short name mangling as
          most 'long' names are still shorter than 15 chars (bug was
          foobar_mng and foobar_sum would hash to the same value, with
          the modified code they hash differently.
Jeremy.
(This used to be commit 299016338c)
1998-03-03 20:19:14 +00:00
Herb Lewis
b3d9fe61f3 -N option still prompted for password in smbclient -L usage
(This used to be commit 140fba461b)
1998-02-26 20:41:05 +00:00
Jeremy Allison
990c84354a Sometime after 1.9.17p5 smbclient stopped being able to do
NetBIOS name lookups by broadcast and instead only does DNS.
With the belief that this was not what was intended (I think
it happened in the clientutil.c cleanup) I have added that
capability back to smbclient by adding the #define USENMB
into clientutil.c, and adding the required namequery.o into
the object lists for smbclient and smbmount (as they now
need it to link).
If this was done intentionally let me know and I'll back
this out.
Jeremy.
(This used to be commit 1da47e79d3)
1998-02-14 07:11:46 +00:00
Jeremy Allison
a093e73d94 Fix for crash bug with amanda - from "Michael C. Povel" <Michael.Povel@hub.de>.
Jeremy.
(This used to be commit 735adfa01b)
1998-02-13 12:40:23 +00:00
Jeremy Allison
6d488ae796 Added fix for doing pq command (from "James J. Szinger" <james.szinger@yale.edu>).
Jeremy.
(This used to be commit 7123405d63)
1998-02-12 11:59:55 +00:00
Jeremy Allison
55f400bd84 This is *not* a big change (although it looks like one).
This is merely updating the Copyright statements from 1997 to 1998.
It's a once a year thing :-).
NO OTHER CHANGES WERE MADE.
Jeremy.
(This used to be commit b9c1697723)
1998-01-22 13:27:43 +00:00
Volker Lendecke
0b2e57592c *** empty log message ***
(This used to be commit 1e1b0c80f8)
1998-01-22 03:47:48 +00:00
Jeremy Allison
fec28f2def Makefile: Added new codepage - 866.
charset.c: Supporting code for codepage 866.
clientutil.c: Fix compile bug in little-used #define.
includes.h: Supporting code for codepage 866.
make_smbcodepage.c: Supporting code for codepage 866.
pcap.c: Fix bug for lpstat.
Jeremy.
(This used to be commit 6040d7a39e)
1998-01-16 06:29:38 +00:00
Volker Lendecke
bd33a35fb5 Added manpages.
Removed obsolete options from smbmount help message.
Volker
(This used to be commit 2d550d28cd)
1998-01-06 00:13:44 +00:00
Volker Lendecke
c271da9c85 the real source code for the smbfs utilities. Forgot to do
cvs add first.
Volker
(This used to be commit 65406a546e)
1998-01-05 22:56:29 +00:00
Volker Lendecke
8d50079a6e Added 3 commands:
smbmount: This is a stripped down smbclient that communicates with
the Linux 2.1.x kernel to supply authenticated smb connections for
smbfs mount points.
smbmnt/smbumount: setuid commands that do the actual smb mount system
call after having done the appropriate security checks
(This used to be commit ccbbc4e647)
1998-01-05 22:54:32 +00:00
Jeremy Allison
5f38824696 Bugfix from Branko Cibej <branko.cibej@hermes.si>
- client.c had a workaround embedded in it for his
earlier bug in StrnCaseCmp - removed this.
Jeremy.
(This used to be commit 7cb4e4b099)
1997-12-24 04:32:01 +00:00
Jeremy Allison
be71d43585 client.c:
clientgen.c:
clientutil.c:
clitar.c: Changed usage of receive_smb to new function client_receive_smb
          except for one use of receive_smb in client.c. This is the
          receive_smb used to discard packets received whilst in a
          keyboard wait state.
util.c: Created new function client_receive_smb that ignores session
        keepalives just as the old receive_smb used to do. Created
        internal function read_smb_length_return_keepalive that is
        used internally by the changed receive_smb call.
        Changed read_smb_len to not use an internal buffer - it is
        never called with a null buffer so such code is redundant.
Jeremy.
(This used to be commit 1084fb4682)
1997-12-20 14:36:11 +00:00
Andrew Tridgell
edc0554f7c fix a bug that sometimes prevented smbclient from connecting with
protocol < LANMAN1
(This used to be commit 95ad2c284d)
1997-12-14 17:48:55 +00:00
Jeremy Allison
64f0348a3f This is it ! The mega-merge of the JRA_NMBD_REWRITE branch
back into the main tree.
For the cvs logs of all the files starting nmbd_*.c, look
in the JRA_NMBD_REWRITE branch. That branch has now been
discontinued.
Jeremy.
(This used to be commit d80b0cb645)
1997-12-13 14:16:07 +00:00
Andrew Tridgell
1463cb1a43 fixed the help message for -p (someone complained!)
(This used to be commit c779ed654e)
1997-12-02 23:32:03 +00:00
Andrew Tridgell
e54a611dad get rid of stat command (it is a hangover from an old experiment)
(This used to be commit 8ced76c4c7)
1997-11-25 12:20:55 +00:00
Andrew Tridgell
51f20adc6b added true enumerated types in loadparm.c. Now we don't need all those
"interpret_security" and similar functions. This also means that
testparm produces string values for these enumerated types rather than
an integer. This was done to make the web interface much cleaner.

While I was doing this I found a couple of very nasty bugs in the
parm_table code. Someone had added a handle_character_set() function
that treated the char** pointer for a P_STRING as an integer! This
would have caused memory corruption for anyone using the "character
set" option. The loadparm code is delicate - please be careful about
using it's more esoteric features!

I've also removed the "coding system" global and made it a
P_STRING. The integer value was never used anywhere in Samba.
(This used to be commit bac6b0daa2)
1997-11-22 07:09:12 +00:00
Jeremy Allison
77aec4ae63 Rolled back tree state to 11:59pm 8th November 1997 EST to
remove problems.
Jeremy
(This used to be commit 4a36ac236c)
1997-11-10 19:23:17 +00:00
Luke Leighton
cc512947c9 byteorder.h :
typecasting for the debug messages of the data dump.  hm.

#ifdef NTDOMAIN

ntclient.c rpc_pipes/lsaparse.c rpc_pipes/ntclientnet.c rpc_pipes/smbparse.c :

	adding "Net Server Password Set" functionality to smbclient.

#endif
(This used to be commit ad43183d2d)
1997-11-09 20:42:47 +00:00
Luke Leighton
e357d91068 attempting to mark up 32 bit error codes, needed for NT domains.
separated out smb server-mode password validation into a separate file.
added called and calling netbios names to client gen state: referenced
section in rfc1002.txt.
created workstation trust account checking code in ntclient.c

there might be a bug in reply_session_setup_andX.  i indented and added { }
around single-line if statements: the lm password checking code now doesn't
look right (around the GUEST_SESSSETUP bits).  *no code semantics have been
changed by the indentation process*.
(This used to be commit f27966957f)
1997-11-09 17:30:10 +00:00
Luke Leighton
4039df6d4b added code that _uses_ arcfour. arcfour itself, or anything remotely
like it, has *not* been added.

this is the client and server side of the SAM Logon NT and LM OWF password
obfuscation (rc4 with the long-term session key).
(This used to be commit 4cf4dd6967)
1997-11-03 15:47:03 +00:00
Andrew Tridgell
4012c1cc8f convert the credentials code back to uchar[8] from uint32[2]
This should fix the byte order problems (maybe!)
(This used to be commit 21878e7d86)
1997-11-02 04:01:57 +00:00
Luke Leighton
c533c07553 client.c clientutil.c proto.h
rpc_pipes/ntclientlsa.c rpc_pipes/ntclientnet.c
rpc_pipes/ntclientpipe.c :

	added extra argument to cli_call_api() to allow specifying the length of
	the \PIPE\ name.  it appears that, like when the name of the pipe is NULL
	and OS-2 requires two extra bytes _after_ the NULL name, that NT requires
	two bytes after the NULL-terminated name "\PIPE\".  these two bytes vary,
	but values seen so far are: 0x72 0x70; 0x63 0x65; 0x44 0x65; 0x4E 0x00.

	there appears not to be much logic to this.  purpose unknown.

ntclient.c:

	put Set Named Pipe Handle State call directly after SMBopenX call.
(This used to be commit 54c245be15)
1997-11-01 19:20:29 +00:00
Andrew Tridgell
224c40a523 a simple SMB torture tester. This will allow us to evaluate locking
techniques more accurately.
(This used to be commit 054e3b2ae3)
1997-11-01 13:22:16 +00:00
Luke Leighton
9fc5056a4a added a client-side "set named pipe handle state" function. not known
exactly when you call this (before or after a bind).  can sort that out
later.
(This used to be commit a64ba16db6)
1997-10-30 22:21:49 +00:00
Luke Leighton
a275e5d4e1 removed mechanism that created actual files NETLOGON, lsarpc and the like,
which are pipes on the IPC$ connection.

created mechanism to record pipe names in a separate pipes_struct.  it
is planned to expand this, to return sensible things like interface
structures, and policy handles (RPC_IFACE and LSA_POL_HND).  and the like.
(This used to be commit 33cce5fac0)
1997-10-30 01:05:13 +00:00
Luke Leighton
a2cbf43a6d split ntclient.c down into appropriate modules.
(This used to be commit 50d7e4d6f6)
1997-10-29 13:24:42 +00:00
Luke Leighton
b925b3d20c added frag field to make_rpc_hdr() function
(This used to be commit 6b0e519294)
1997-10-29 01:05:46 +00:00
Luke Leighton
fe0a702322 byteorder.h :
added mode for printing debug array data as chars not uint8/16/32s.
	only really useful for (uint8) strings or (uint16) unicode strings

lsaparse.c smbparse.c smb.h :

	rpc bind and rpc bind ack structures and parsing and creation functions.

ipc.c pipes.c pipenetlog.c pipentlsa.c pipesrvsvc.c :

	using rpc bind / bind ack parsing routines instead of incorrect use of
	api_LsarpcTNP1 function.

ntclient.c :

	creation of do_rpc_bind() function.

THAT'S IT, FOLKS!
(This used to be commit 21c89e2f17)
1997-10-29 00:04:14 +00:00
Luke Leighton
d8e79427c9 smb.h smbparse.c pipeutil.c :
added bind and bind ack structures and parsing functions.  restructured
	rpc header stuff.

ntclient.c pipenetlog.c pipentlsa.c pipesrvsvc.c :

	having to deal with restructuring above.
(This used to be commit 9f2c4f1fee)
1997-10-28 17:54:10 +00:00
Luke Leighton
aee261e784 added LSA_Q_CLOSE and LSA_R_CLOSE (also to smb.h). implemented in smbclient.
updated Query Info Policy to report domain name and domain sid for info levels
3 and 5.
fixed bug in dom_sid_to_string (idauths decoded wrong).  fixed bug in DOM_SID:
subauths are 32 bit not 16.
(This used to be commit 2f3cca23e2)
1997-10-27 19:00:38 +00:00
Jeremy Allison
a030c93878 Fixed ntclient.c so it would compile.
Jeremy.
(This used to be commit 598e98e561)
1997-10-27 18:07:36 +00:00
Luke Leighton
13291ce01d added LSA Query Info Policy.
fixed a problem with byte ordering (doing an SIVAL of the setup parameters
which was _also_ being done in the creation of the SMB header.  oops).
(This used to be commit 541fb82895)
1997-10-27 17:04:15 +00:00
Luke Leighton
8586dda29b added LSA Open Policy query and response processing to smbclient
(This used to be commit 16cc27852b)
1997-10-27 15:09:23 +00:00
Luke Leighton
95b3b1473f hooray. hooray some more. hooray a lot. got the client-side working.
Q/R LSA_REQ_CHAL; Q/R LSA_AUTH2; Q/R LSA_SAMLOGON; Q/R LSA_SAMLOGOFF.
the last (non-essential right now) bit is the LSA_SRV_PWSET.

the next stage is to do LSA_OPENPOLICY; add the pipe binds (missing right
now); then we can test against an NT Server.
(This used to be commit 0a549e62fb)
1997-10-26 18:42:47 +00:00
Andrew Tridgell
f8c059517a fix some casting errors in smbencrypt and some multiply-defined errors
in clientutil.c (Luke, you can't just copy a global variable
declaration from one file to another, you need to declare one of them
extern)
(This used to be commit 944ecbcbd4)
1997-10-26 07:45:36 +00:00
Andrew Tridgell
a342ff5bf4 The browse synchronisation code in nmbsync.c now uses the clientgen.c
code, which means we don't have to link with a fake getpass routine
and we don't have a whole pile of global variables that really have
nothing to do with nmbd and were there to keep the client code happy.

The code should function identically to what it did before (hopefully
it was correct)

The only thing that now uses the horrible clientutil.c code is
smbclient.
(This used to be commit 4bf5c03b18)
1997-10-26 07:32:02 +00:00
Luke Leighton
7e56b5a173 added correct client-side credential generation / checking to the LSA SAM
Logon query.  i think i even got the client-side checking of the response
credentials right!
(This used to be commit f14c111835)
1997-10-25 17:38:37 +00:00
Luke Leighton
5493293442 got the SAM logon request generated, and received a SAM logon response back.
YEAH!

need to add:

	- client-side credential calculation
	- client-side parsing of the SAM logon response.
(This used to be commit 349677de3f)
1997-10-25 15:49:27 +00:00
Luke Leighton
390c1f3c4d Makefile :
adding bits for new nt domain code

byteorder.h :

	trying to get macros right, and not to crash on SUNOS5...

client.c :

	added #ifdef NTDOMAIN, and created do_nt_login() function.  don't
	want to have to recompile client.c unless absolutely necessary.

credentials.c :

	moved deal_with_creds() [possibly inappropriately] into credentials.c

ipc.c reply.c server.c uid.c :

	attempting to make (un)become_root() functions calleable from smbclient.
	this is a little tricky: smbclient might have to be another setuid
	root program, immediately setuid'ing to non-root, so that we can
	reset-uid to root to get at the smbpasswd file.  or, have a secure
	pipe mechanism to smbd to grab smbpasswd entries.  or the like.

smbdes.c smbencrypt.c :

	created a function to generate lm and nt owf hashes.

lsaparse.c ntclient.c smbparse.c :

	added nt client LSA_AUTH2 code.  it works, too!

pipenetlog.c pipentlsa.c pipesrvsvc.c :

	simplification.  code-shuffling.  getting that damn offset right
	for the opcode in RPC_HDR.

smb.h :

	changed dcinfo xxx_creds to DOM_CRED structures instead of DOM_CHAL.
	we might need to store the server times as well.

proto.h :

	the usual.
(This used to be commit 82436a3d99)
1997-10-25 10:58:18 +00:00
Luke Leighton
a12f047533 nterr.c :
added a structure that wraps nt errors as strings and enums, so we
	can do a smb_nt_error() function.

Makefile ntclient.c :

	added ntclient.c, broken out nt domain stuff into a separate file.
	getting fed up of compile-times and size of client.c.

	fixed the do_lsa_req_chal() function.  made it read the response,
	and return the challenge credentials received from the server.

	next stop: do_lsa_auth_2().

client.c :

	removed nt domain logon functions into a separate file.

pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c :

	i'd broken the offsets of the RPC_HDR while trying to sort out the
	nt client code.  fixed it again.  added some robustness stuff.

util.c :

	the unistrn2() function was null-terminating the string at one
	character too many.
(This used to be commit 39cec7f698)
1997-10-24 13:15:34 +00:00
Luke Leighton
310536a709 missed nmbsync.c when adding setup count and setup pointer arguments to
cli_call_api().  sorting this for jeremy.

there is a discrepancy between the client.c list_servers() and the nmbsync.c
add_info() calls to cli_call_api() - one has an mdrcount of 1024, the other
of zero.

i don't know what difference this makes.
(This used to be commit d8c265c515)
1997-10-23 17:54:21 +00:00
Luke Leighton
203c93e922 general sorting out, from crashes generated by do_lsa_req_chal() in client.c
trying to set up the data parameters etc and not understanding what's going on.

in api_netlogTNP, added smb_io_rpc_hdr() call to decode the header received
(and in this instance, generated by do_lsa_req_chal()).  and then noticed
that it's two bytes out.  but i don't know how to do "byte parameters"
and it's not the same format as the LSA_REQCHAL received from nt workstations.

agh!
(This used to be commit 0cc8ce43e1)
1997-10-23 16:17:07 +00:00
Luke Leighton
5cd52a56a4 playing about, trying to SMBopenX a \PIPE\NETLOGON (should be a SMBopen)
and then send a LSA_REQ_CHAL down it.
(This used to be commit 473f21071f)
1997-10-23 13:38:46 +00:00
Luke Leighton
d38aba33af client.c :
send to \PIPE\ not \PIPE\NETLOGON.

ipc.c :

	fstring name not being bzero'd caused problems when calling named_pipe().
(This used to be commit 2393c49b05)
1997-10-22 18:37:43 +00:00
Luke Leighton
a947dff4c0 Makefile client.c :
adding start of undocumented options to do NT domain logons, client-side.
	starting with LSA_REQCHAL.

	the code here happily crashes smbd: i'll investigate this further... :-)

smbparse.c pipeutil.c lsaparse.c :

	moved some of the common make_xxxx() functions out of pipeutil.c
	so that the make_xxxx and (smb/lsa)_io_xxxx functions now sit
	together.  makes sense, really...

	added a make_q_req_chal() function.

	restructured make_rpc_reply() and called it make_rpc_hdr().  created
	functions create_rpc_reply() and create_rpc_response().

pipenetlog.c pipentlsa.c pipesrvsvc.c

	calling new create_rpc_reply() function instead of old make_rpc_reply().

proto.h :

	usual.

smb.h:

	added enum for RPC_PACKET_TYPE
(This used to be commit b88ee3e16c)
1997-10-22 17:51:02 +00:00
Luke Leighton
5897f0493d Makefile client.c clientutil.c clitar.c nmbsync.c :
redid the split that i did a year ago, taking the functions in client.c
	out into clientutil.c.  guess what?  we could now do encrypted password
	NetServerEnum2 calls in nmbd, if we wanted to.

	i can now use cli_call_api() to send to different pipes.  i hope.

pipenetlog.c:

	allow adding to users group _and_ to admin group.  if adding to
	guest group, don't allow adding to users or admin as well.

smb.h :

	added some pipe #defines (\PIPE\NETLOGON \PIPE\srvsvc ...)

proto.h :

	usual.
(This used to be commit 6ee065ce6e)
1997-10-22 14:28:19 +00:00
Andrew Tridgell
6032872209 some cleanups in the clientutil.c code.
I'm actually hoping to remove this module completely once we convert
nmbd to using the new (much cleaner) clientgen.c

smbclient now also reports if it connects as a guest user
(This used to be commit 3af8d855fa)
1997-10-21 09:39:08 +00:00
Andrew Tridgell
ae9b654a6b add ERRDOS/67 ERRnosuchshare to the client.c list of error strings
(This used to be commit 1cccd7c519)
1997-10-16 08:01:00 +00:00
Andrew Tridgell
e5494e2c09 bracket some macros
change MAX_PASSWORD_LENGTH to MAX_PASS_LEN to prevent conflict on some
systems

add #ifdef around soft link dependent code (for systems that don't
have soft links)
(This used to be commit e10ba4b97a)
1997-10-09 06:36:04 +00:00
Jeremy Allison
2e92be3aaf client.c: Changed shadowed variable.
locking.c: Removed USE_OPLOCKS - now the default.
params.c: Removed unused variable.
proto.h: Updated.
reply.c: Removed USE_OPLOCKS - now the default.
server.c: Removed USE_OPLOCKS - now the default.
smb.h: Removed USE_OPLOCKS - now the default.
smbparse.c: Changed shadowed variable.
status.c: Removed USE_OPLOCKS - now the default.
util.c: Removed USE_OPLOCKS - now the default.
Jeremy (jallison@whistle.com)
(This used to be commit b93509846d)
1997-10-06 17:52:25 +00:00
Andrew Tridgell
b6a3fd6777 a bit of bounds checking
(This used to be commit d40199f4fe)
1997-10-04 05:21:47 +00:00
Andrew Tridgell
c549112d4b a little hack to smbclient to support extracting NT error codes
(This used to be commit 0eb9a59043)
1997-10-04 05:21:14 +00:00
Jeremy Allison
cef59090bb Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com)
(This used to be commit e7eb1f044d)
1997-09-26 18:55:29 +00:00
Andrew Tridgell
5a7b3294db add error string reporting to clitar
(This used to be commit 2c5587a6fe)
1997-09-26 09:06:51 +00:00
Jeremy Allison
a2d2206cc9 Makefile: Changed proto: target to not include c files not used currently.
Caused proto.h to be from a sorted list of C files.
arcfour.h: Added prototypes.
client.c: Added username%password in environment patch from John Blair <jdblair@frodo.tucc.uab.edu>
loadparm.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au]
username.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au]
mkproto.awk: Added arc4_key type.
proto.h: Updated & sorted.
Jeremy (jallison@whistle.com)
(This used to be commit 97ed4fea67)
1997-09-19 17:12:08 +00:00
Andrew Tridgell
102fb71537 John asked the other day about using the tar feature in smbclient to
handle file paths longer than 100 characters (the limit of the normal
tar format).

This patch adds support for producing GNU tar files (which have no
real limit on the path length) in smbclient.

Note that I have only added support for producing GNU tar files, I
haven't added support for accepting them when restoring. I thought I'd
leave that up to John :-)
(This used to be commit d5daf85162)
1997-09-18 06:52:49 +00:00
Andrew Tridgell
33a003de40 This commit does 3 main things:
1) put the encryption code in by default, with no #ifdef. It is still
disabled by default so you need to add "encrypt passwords = yes" in
smb.conf but at least all binaries will have it.

2) cleanup the kanji code so it compiles with no warnings

3) get rid of lots of uses of ugly non-portable C code. The main
offender being things like "register" but also remove uses of the
"const" keyword as there are compilers out there that don't support it
and even those that do often complain about its usage. Users don't
like warnings :-(

There is still some work to do. We need to replace the md4 code with
our own implementation. The current code (from rfc1186) is PD but is
not very portable. The new RFC (rfc1320) is more portable but adds
copyright restrictions. I'll do a from-scratch MD4 soon.

We also need to test that what I've implemented is portable. It should
be, but I'm too tired right now to test it on anything other than
intel linux.
(This used to be commit db917c62c1)
1997-09-14 16:37:18 +00:00
Jeremy Allison
30416c0b8a charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c
mangle.c smb.h util.c:

  Big merge to allow KANJI support to be in the main
binary without explicitly compiling with it.

locking.c: Fix for smbstatus not being able to read files.
namepacket.c: Removed unneccesary debug statement.
trans2.c: Added Luke's proposed fix (ifdefed out until further testing).
nmblookup.c: Fixed bug where query fails and status is done on bogus IP.

Jeremy (jallison@whistle.com)
(This used to be commit 9196255022)
1997-09-11 20:17:32 +00:00
Jeremy Allison
e7e49a6e6a client.c: Made sure myhostname was initialised before substitutions.
status.c: Made sure myhostname was initialised before substitutions.
server.c
trans2.c: Moved OS/2 WPS fix.
Jeremy (jallison@whistle.com)
(This used to be commit 8a12b6a4f0)
1997-09-05 21:32:32 +00:00
Jeremy Allison
473c42a194 includes.h: Make sure REPLACE_GETPASS are wrapped with #ifdefs.
nmbsync.c: Make sure REPLACE_GETPASS is defined before including includes.h
clientutil.c: Catch null passwords.
Fixes for a nmbd crash bug found by Herb Lewis @ SGI.
Jermey(jallison@whistle.com)
(This used to be commit 45c266baae)
1997-08-28 20:59:51 +00:00
Samba Release Account
7971fb1feb charset.c: Added patch for client code page 852 (Eastern European) from
Leos Bitto <bitto@altec.cz>.
clitar.c:
proto.h: Fixed proto mismatch for strslashcmp().
Jermey (jallison@netcom.com)
(This used to be commit c7a4647b7a)
1997-08-27 20:20:58 +00:00
Samba Release Account
4c319ad046 charset.c : Add mapping for code page 932 (KANJI).
client.c : Fix crash bug. Add code to use BUFFER_SIZE for NetServerEnum calls.
namepacket.c: Fixed cast.
nmbsync.c : Add code to use BUFFER_SIZE for NetServerEnum calls.
smb.h : Set default client code page to 932 for KANJI.
system.c : Remove vendor specific code that crept in :-).
util.c : Added #define to allow Samba to behave as Win95 when doing
         KANJI case insensitivity tests.

Jeremy (jallison@whistle.com)
(This used to be commit 7f7d2faa07)
1997-08-25 22:18:31 +00:00
Samba Release Account
75bbf35a86 client.c: Minor change to cast parameters for DEC unix.
clientutil.c:	Minor change to cast parameters for DEC unix.
ipc.c:		Fixes to parameterise the stuff John wants.
loadparm.c:	Fixes to parameterise the stuff John wants.
nameannounce.c: Fixes to parameterise the stuff John wants.
namedbwork.c: Fixes to parameterise the stuff John wants.
nameserv.h:	Fixes to parameterise the stuff John wants.
proto.h: Fixes to parameterise the stuff John wants.
smb.h: Fixes to parameterise the stuff John wants.
util.c: tidy.
Jeremy (jallison@whistle.com)
(This used to be commit 9fbca2594b)
1997-07-30 19:17:51 +00:00
Samba Release Account
01d19fd31d Minor text mods, mostly checking that CVS still works
Dan
(This used to be commit 632bf0dab0)
1997-07-30 10:13:14 +00:00
Samba Release Account
7314126d9e client.c: Added amanda fixes.
clitar.c:	Added amanda fixes.
nameannounce.c:	Removed redundent code.
nameelect.c:	Removed redundent code.
nameserv.h:		Removed redundent code.
nameservresp.c:	Removed redundent code.
namework.c:		Removed redundent code.
password.c:		Prevented crash if getpwnam fails.
Jeremy (jallison@whistle.com)
(This used to be commit 760fe30353)
1997-07-28 18:59:57 +00:00