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

337 Commits

Author SHA1 Message Date
Luke Leighton
264459d25a added debug reporting to pwdb_sam_map_names() and pwdb_smb_map_names()
(This used to be commit baab308152)
1999-07-07 18:44:58 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Tim Potter
731c7f2ecf Moved code that changes the pw_passwd entry (i.e shadow password and
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug.

Note that the Get_Pwnam() function now returns a const struct passwd *
as a hint to other developers not to change entries in the struct
passwd.
(This used to be commit 36d7cb4ccc)
1999-06-13 04:14:24 +00:00
Luke Leighton
94a4094f44 had to move day display names into lib/util, to get rpctorture to compile.
(This used to be commit 8c80742e4e)
1999-05-07 18:20:59 +00:00
Luke Leighton
150645f955 Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hack
(This used to be commit 899fc053c5)
1999-05-06 18:05:45 +00:00
Tim Potter
069f1b5ff2 Fix compile warning in nametouid().
(This used to be commit deb6dfb4e0)
1999-04-12 01:39:46 +00:00
Luke Leighton
f37d96a8c0 Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.
(This used to be commit 81b5304fe5)
1999-03-12 19:53:28 +00:00
Luke Leighton
a3c6e96a22 mods to allow inter-domain trust accounts to be added to SAM database
using smbpasswd command.
(This used to be commit 62d499f832)
1999-03-09 01:21:57 +00:00
Luke Leighton
1153f00f88 cache unix groups so that two-level getgrent calls don't occur.
(This used to be commit f7dfa55a2e)
1999-02-03 00:49:24 +00:00
Luke Leighton
58a0cbc0c8 oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ.
(This used to be commit ca10eb4490)
1998-12-09 16:30:37 +00:00
Andrew Tridgell
e50ab2b528 fixed warnings (and potential errors) due to integer overflow when
creating locking masks
(This used to be commit 5e2844d5ed)
1998-12-07 22:43:43 +00:00
Luke Leighton
cf0ea874b1 - renamed do_samr_xxx to samr_xxx
- renamed do_lsa_xxx to lsa_xxx

- added "enumgroups [-m]" command, enumerates groups, shows members.
- added cmd_sam_add_groupmem(), need to call these in rpcclient.c
- added cmd_sam_add_aliasmem(), need to call these in rpcclient.c

- modified "enumaliases [-m]" command

- improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs.

- renamed "samr_unknown_12" to "samr_lookup_rids".

- added the following client-side functions:

	get_samr_query_groupmem()
	get_samr_query_aliasmem()
	get_samr_query_groupinfo()
	samr_enum_dom_groups()
	samr_enum_dom_aliases()
	samr_add_aliasmem()
	samr_add_groupmem()

- improved display output (display.c)
(This used to be commit eacc5e581a)
1998-12-04 16:30:00 +00:00
Luke Leighton
f3787515d6 moved get_unixgroups it will be needed by the unix instance of the group
DB API
(This used to be commit ef58e48bc9)
1998-12-03 17:41:14 +00:00
Luke Leighton
67638b8d2b adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
(This used to be commit 51c1c31768)
1998-12-01 16:04:24 +00:00
Luke Leighton
30038de462 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
(This used to be commit 5d5d7e4de7)
1998-11-29 20:03:33 +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
Luke Leighton
4cee58780c unix instance of group database API
(This used to be commit e76f593b35)
1998-11-23 21:51:05 +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
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Andrew Tridgell
29e36b7134 extracted the password change code from smbpasswd and used it in swat
instead of opening pipes and other horrible stuff.
(This used to be commit 49bf197103)
1998-11-12 07:06:48 +00:00
Andrew Tridgell
d85dcf86d5 largely rewrote smbpasswd so that the code is understandable. This
should allow us to call a function in swat rather than piping to
smbpasswd.

while doing this I also fixed quite a few "const char *" versus "char *" issues
that cropped up while using const to track down bugs in the code. This
led to changes in several generic functions.

The smbpasswd changes should be correct but they have not been
extensively tested. At least if I have introduced bugs then we should
be able to fix them more easily than before.
(This used to be commit 713864dd03)
1998-11-12 06:12:19 +00:00
Luke Leighton
9f14f281ff changed syntax of registry commands so keys can start with HKLM or HKU.
sorted lookupsids command
(This used to be commit 13a0ee851f)
1998-11-11 14:23:55 +00:00
Luke Leighton
313d8ef27d util functions split into relevant modules, first pass.
(This used to be commit d448906e68)
1998-11-10 18:14:16 +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
fb15277b5e use abort() instead of exit() in smb_panic()
the reason we don't return() here is that smb_panic() is used not just
for segv but also for detected errors (such as buffer overflows)
(This used to be commit 7a50ca81a5)
1998-10-28 06:05:34 +00:00
Jeremy Allison
5d6ed11ef3 include/smb.h: Added #defines for lots of things - makes our code a *lot* easier to read.
lib/util.c: Fixed Luke's set_first_token() function - should return void.
smbd/close.c: Move delete_on_close into file_fd_struct structure.
smbd/ipc.c: Changed local_machine back to fstring.
smbd/nttrans.c: Use defines for mapping share modes.
smbd/open.c: Move delete_on_close into file_fd_struct structure, added code for ALLOW_SHARE_DELETE.
smbd/reply.c: Use defines for mapping share modes.
smbd/trans2.c: Move delete_on_close into file_fd_struct structure.
Jeremy.
(This used to be commit 8e1ce307bd)
1998-10-23 00:58:28 +00:00
Luke Leighton
a0512ce5ff rpctorture command
(This used to be commit b4ae65e2d0)
1998-10-22 22:19:08 +00:00
Jeremy Allison
e094a36a98 Fixed bug found by John Blair where trim_string wasn't
correctly trimming trailing multibyte code page strings.
Jeremy.
(This used to be commit dbdbce29f5)
1998-10-20 20:08:35 +00:00
Luke Leighton
1ebeb54932 some quite important bug-fixes i missed because i transferred the wrong
smb.tgz file from my portable.

particularly the call to mem_data followed by a realloc of that data in
cli_pipe.c's rpc_read() function.

smbd responses now use p->rdata_i which is a faked-up pointer into
p->rdata's response data.  rdata can be very long; rdata_i is limited
to point to no more than max_tsize - 0x18 in length.  this will make
it an almost trivial task to add the encrypted rpc headers after
rdata_i, and mem_buf_copy will cope admirably with rhdr chained to
rdata_i chained to auth_verifier etc etc...
(This used to be commit 05a297e3a9)
1998-10-20 18:27:49 +00:00
Luke Leighton
01de603084 - dce/rpc code
- removed debug info in struni2 and unistr2 (security risk)

- rpc_pipe function was getting pointer to data then calling realloc *dur*

- password check function, the start of "credential checking",
  user, wks, domain, pass as the credentials (not just user,pass which
  is incorrect in a domain context)

- cli_write needs to return ssize_t not size_t, because total can be -1
  if the write fails.

- fixed signed / unsigned warnings (how come i don't get those any more
  when i compile with gcc???)

- nt password change added in smbd.  yes, jeremy, i verified that the
  SMBtrans2 version still works.
(This used to be commit fcfb40d2b0)
1998-10-19 17:32:10 +00:00
Andrew Tridgell
48a3c12279 removed an incorrect comment
(This used to be commit 5abdb70e2a)
1998-10-19 01:03:52 +00:00
Jeremy Allison
b8aec499dc Fixed sys_lseek and seek_file calls so all returns
are *checked* :-).
Jeremy.
(This used to be commit b8b781191d)
1998-10-18 22:06:35 +00:00
Jeremy Allison
f3793be165 Re-added code to tell the user how many open files they
have. Needed for server diagnosis purposes...
Jeremy.
(This used to be commit 04d79a9ae5)
1998-10-16 06:16:10 +00:00
Andrew Tridgell
b79773d3c7 - fixed cast warnings
- ignore *.po32 files
(This used to be commit 469474803d)
1998-10-05 12:35:30 +00:00
Andrew Tridgell
93bbfce02b added a function set_maxfiles() to set our file rlimit to the max
possible and return the max.
(This used to be commit 7a7b5ee168)
1998-10-05 01:57:03 +00:00
Andrew Tridgell
e34e25d907 more solaris 2.5 fixups. It now seems to be working pretty well.
(This used to be commit c4e4508178)
1998-10-04 15:54:04 +00:00
Andrew Tridgell
7c3c022a89 use *SMBSERVER convention in smbwrapper to allow us to connect to
servers that we don't know the netbios name of.
(This used to be commit 147d49dade)
1998-10-04 10:46:52 +00:00
Andrew Tridgell
6760e69a68 added support for printing via smbwrapper
You can print using "cp filename /smb/SERVER/PRINTER/jobname"

You can list the current printqueue using ls
(This used to be commit 080fb61b69)
1998-10-04 09:42:51 +00:00
Andrew Tridgell
03a06267f4 added simple device/inode number support based on a checksum of the
filename
(This used to be commit 5674fb4e9d)
1998-10-03 13:12:08 +00:00
Andrew Tridgell
6291a9da89 fixed a bug in name_len() (thanks to kooros@kooros.netrack.net)
(This used to be commit f05f0a01ce)
1998-10-03 12:32:18 +00:00
Andrew Tridgell
cce5f09a90 added unlink() and rename() support to smbwrapper
(This used to be commit b85d961447)
1998-10-03 09:39:11 +00:00
Andrew Tridgell
60efedd4c0 - ignore *.p files
- make msleep() non-static
(This used to be commit 688a749484)
1998-10-03 08:29:06 +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
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
Jeremy Allison
5f7ee36056 Makefile.in: Fixed bug with continuation line causing proto to fail.
Added $(PROGS) $(SPROGS) as targets for make clean.
acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES.
configure.in: Added sys/capability.h header check.
              Added function checks for srandom random srand rand.
              Added HAVE_IRIX_SPECIFIC_CAPABILITIES test.
includes.h: Added #include <sys/capability.h>.
ntdomain.h: Moved struct acct_info into here from smb.h
smb.h: Added KERNEL_OPLOCK_CAPABILITY define.
       Moved enum action_type into rpcclient.h
       Moved struct cli_state into client.h
       Moved struct nt_client_info, struct tar_client_info, struct client_info
             into rpcclient.h
lib/genrand.c: Changed to use sys_random() & friends.
lib/smbrun.c: Lose capabilities after fork.
lib/system.c: Added set_process_capability(), set_inherited_process_capability()
              sys_random(), sys_srandom().
lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an
            32 bit mounted NFS filesystem.
nmbd/nmbd.c: Changed to use sys_random() & friends.
nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends.
passdb/ldap.c: Missed one pdb_encode_acct_ctrl call.
passdb/passdb.c: Changed to Ander's code for ' ' characters.
passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ.
script/mkproto.awk: Added 'long' to prototypes.
smbd/chgpasswd.c: Lose capabilities after fork.
smbd/open.c: Do the mmap *after* the kernel oplock.
smbd/oplock.c: Removed stub code from kernel oplock path.
               Added set_process_capability(), set_inherited_process_capability() calls.
smbd/reply.c: Initialize count = 0, offset = 0.
smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls.
tests/summary.c: Ensure we have RANDOM or RAND.
utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ.
utils/torture.c: Changed to use sys_random() & friends.

Jeremy.
(This used to be commit e8be306f23)
1998-09-25 23:40:49 +00:00
Luke Leighton
66d5d73a5d added rpcclient program
(This used to be commit aa38f39d67)
1998-09-25 21:01:52 +00:00
Jeremy Allison
aab2fe0216 First cut at kernel oplocks. This should have no effect unless runnin
on a machine that supports them in autoconf.

Move various functions out of lib/util.c into smbd/process.c
and smbd/oplock.c where they belong.

Jeremy.
(This used to be commit c3c5e13f85)
1998-09-23 01:48:45 +00:00
Jeremy Allison
ac87559729 Remove some byte-copying code in unix_format() that did nothing except
slow down my benchmark :-).

Jeremy.
(This used to be commit b55f93b213)
1998-09-19 02:35:43 +00:00
Andrew Tridgell
8d6b713c5d got rid of some #ifdef LARGE_XXXX stuff and got rid of non-portable LL
suffix from some constants.
(This used to be commit 84956eddf3)
1998-09-18 02:21:07 +00:00
Jeremy Allison
b8b67f4fab configure configure.in: Added checks for statvfs64. Last bit of 64 bit widening (I hope :-).
include/config.h.in: Added #undef STAT_STATVFS64.
include/includes.h: Added SMB_STRUCT_STATVFS type, Changed SMB_BIG_INTEGER to
                    SMB_BIG_UINT and SMB_BIG_INT types.
include/smb.h: Added flag defines from CIFS spec.
lib/debug.c: Fixed one more mode_t issue.
lib/system.c: Added sys_statvfs wrapper.
lib/util.c: Changed trim_string to use size_t.
param/loadparm.c: Moved "blocking locks" into locking section. Alphabetised
                  locking options. Question - shuld we do this for all options ?
passdb/ldap.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT.
passdb/nispass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT.
passdb/smbpass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT.
smbd/dfree.c: Changed to use 64 bit types if available. Moved to use unsigned
              types.
smbd/dosmode.c: Fixed one more mode_t issue.
smbd/negprot.c: Changed literals to be FLAG_ #defines.
smbd/nttrans.c: Removed dead code.
smbd/open.c: Changed disk_free call.
smbd/process.c: Changed literals to be FLAG_ #defines.
smbd/reply.c: Changed disk_free call.
smbd/trans2.c: Fixed but in SMB_QUERY_FS_VOLUME_INFO call. Was using
               UNICODE - should use ascii.
tests/summary.c: Added STAT_STATVFS64 check.
Jeremy.
(This used to be commit c512b1b91f)
1998-09-17 23:06:57 +00:00
Jeremy Allison
20d3988e06 Removed hideous inefficiencies in old trim_string code. This was making
calls to strlen() a profiling hotspot.
Jeremy.
(This used to be commit ffa450acdd)
1998-09-15 01:38:10 +00:00
Jeremy Allison
06cc91f9a6 Added ssize_t to configure code.
Got 'religion' about using size_t and ssize_t for read/write stuff
as part of the code to expose 64 bits to the client.

This checkin does all the 'easy' stuff - such as all the read/write/lock
calls - but now comes the harder parts (open & friends) and all the
file enquiry functions.....

Jeremy.
(This used to be commit 36544fe547)
1998-09-11 01:24:30 +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
Andrew Tridgell
1546ccfd24 got rid of interpret_security(). Thanks to Jean-Francois for pointing
out it is no longer used (replaced by enumerated types in loadparm.c)
(This used to be commit 88df8a8b25)
1998-09-05 01:12:07 +00:00
Jeremy Allison
623a18db4b More 64 bit stuff - now the fcntl locks are 64 bit clean.
Nearly at the stage where I can expose the 64-bit-ness to
the NT clients....
Jeremy.
(This used to be commit 422f1dd450)
1998-09-04 00:23:28 +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
Andrew Tridgell
148691b1c5 we are never interested in SIGPIPE so just ignore (block) it
always. Don't even install a handler.
(This used to be commit 72c383f4b7)
1998-09-02 05:00:47 +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
Jeremy Allison
693480af8b configure.in, configure: include/config.h.in: Added stropts and poll.
include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where
               all the other defines live (changed them from typedefs to
               defines).
Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T
in preparation for moving to size independed (ie. 64 bit clean) device
and inode access. Stat call wrapper comes next :-).

Jeremy.
(This used to be commit 3d9ec96de5)
1998-08-31 20:20: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
a6c94d7eb1 added a function zero_free(void *, int size) that zeros an area of
memory then frees it. Useful for catching bugs.
(This used to be commit 99782754f7)
1998-08-30 04:31:55 +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
8afc9c80ac Changed ASSERT macros to SMB_ASSERT macros as some systems already
have an ASSERT macro defined.
Jeremy.
(This used to be commit dbe6ad014a)
1998-08-24 21:49:10 +00:00
Andrew Tridgell
3f3f47b0bd added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code.
(This used to be commit e6ce1c5b5a)
1998-08-22 02:54:21 +00:00
Andrew Tridgell
038e3433d3 added new smb.conf option "panic action". see my samba-technical
explanation.
(This used to be commit c6899df44c)
1998-08-21 11:37:40 +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
Jeremy Allison
3cf6cc6134 Makefile.in: Changed so that make proto will work with ldap & nisplus.
locking/locking.c: Made #ifdef'ed out functions static for Make proto.
lib/util.c: Re-instated old mask_match code for UNIX filesystem checks
            only. Client calls use the new mask_match code. Changed the
            name of the old function to unix_mask_match.
Jeremy.
(This used to be commit b68e756ff5)
1998-08-14 02:02:40 +00:00
Andrew Tridgell
963e96f3a9 added --with-nisplus-home option
(This used to be commit 70000c2190)
1998-08-08 01:15:14 +00:00
Jeremy Allison
7448091da6 First implementation of ChangeNotify - this version only checks
for changes in the directory modify timestamps. A better version
will look at the requested client flags, and create a hash that
represents the current state of the directory, and check against
this instead.
debug.c: Added lp_timestamp_logs() function.
loadparm.c: Added "change notify timeout" in seconds (default 60)
- this is the scan rate for a directory.
            Added ""timestamp logs" boolean - default True. Turns
off log timestamps (so I can read them :-).
nttrans.c: ChangeNotify implementation.
server.c: ChangeNotify implementation.
shmem_sysv.c: Added exits on shmem errors (without them smbd can
              core dump if some calls fail).
smb.h: Added ChangeNotify flags for future use.
util.c: Tidied up typedef.
Jeremy.
(This used to be commit a0748c3f53)
1998-08-03 19:07:55 +00:00
Christopher R. Hertel
ebd415c03f This is the checkin of the debug changes.
Makefile.in:  I've added debug.o.
  proto.h    :  Rebuilt, as is standard for these sorts of things.
  smb.h      :  New macros, etc.
  util.c     :  Debug code removed.

I'll check in debug.c in the next step.

Chris -)-----
(This used to be commit 653c17c1b8)
1998-07-31 20:16:35 +00:00
Jeremy Allison
7284bb5ca0 Makefile.in: Moved UBIQX stuff into UTILOBJ.
loadparm.c: Added "ole locking compatibility" option (default "true").
locking.c: Changes to implement union in files_struct.
locking_shm.c: Changes to implement union in files_struct.
nttrans.c: Made opening a directory explicit (we have to).
           Added create directory code for nttrans.
reply.c: Changes to implement union in files_struct.
server.c: Changes to implement union in files_struct. Added create directory code.
trans2.c: Changes to implement union in files_struct.
smb.h: Changes to implement union in files_struct.
util.c: Changed linked list code to UNIQX linked list. This will make
        the other lists I need to implement for ChangeNotify and blocking
        locks easier.
Jeremy.
(This used to be commit 3a5eea850b)
1998-07-30 21:18:57 +00:00
Andrew Tridgell
fb08c34cf3 get rid of the runtime test for broken getgroups() and add a compile
time test instead. This also allows us to get rid of the igroups
element of a couple of structures.
(This used to be commit 8b25fe7341)
1998-07-29 05:05:36 +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
06c0349c44 locking.c: Added lock type to is_locked() and do_lock()
as the code in reply_lockingX wasn't taking account of
           the difference between read and write locks ! How did this
           ever work :-) !
reply.c:
server.c: Add lock type to is_locked() and do_lock().
util.c: Also added code from klausr@ITAP.Physik.Uni-Stuttgart.De
        to fix problem with log files growing too large if an
        smbd writes less than 100 debug messages.
Jeremy.
(This used to be commit 80080abf77)
1998-07-23 00:10:26 +00:00
Jeremy Allison
f1cd3cb54c Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com.
ipc.c:
loadparm.c:
printing.c:
           Added code from <Dirk.DeWachter@rug.ac.be> to implement print
           queue pausing. New parameters are "queuepause command" and
           "queueresume command".
util.c: Added fix for mount options in autmount map.
lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois.
Jeremy.
(This used to be commit 559a9bf2bb)
1998-07-16 00:06:29 +00:00
Christopher R. Hertel
7ade0aa1d2 util.c: I've added a function called mem_dup(). Similar to strdup(),
mem_dup() allocates the required memory before copying the
         source data.  It returns NULL if memory could not be allcoated,
         else a pointer to the newly allocated memory.
proto.h: Rebuilt to add the prototype for mem_dup().
(This used to be commit 7f7e265ab4)
1998-07-15 20:15:25 +00:00
Jeremy Allison
1e4b0268aa Fix for bug PR#8294 reported by <detlef.lammermann@er.materna.de>
- the Files array was storing the 'dos_to_unix' translated name,
rather than the untranslated name. This could case problems when
the name was run through dos_to_unix again.
Jeremy.
(This used to be commit 5f4be1498f)
1998-07-10 20:03:09 +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
Richard Sharpe
5bf9b18328 CLITAR changes to overcome some reported problems and add Jay's changes
(This used to be commit e1468dac03)
1998-06-16 06:52:24 +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
206f5882e7 Fixed file descriptor leak in open_socket_out - this could
cause nmbd to run out of fd's. Test case found by Eloy Paris.
Jeremy.
(This used to be commit 9e25703171)
1998-06-04 01:50:28 +00:00
Jeremy Allison
459ecfec83 Ooops - fixed Win95 crash bugs with earlier code.
Jeremy
(This used to be commit 6baeb4ad96)
1998-05-27 23:50:30 +00:00
Jeremy Allison
ad53f02511 Newly re-written do_match and mask_match functions, with the
help of Ums Harald <Harald.Ums@pro-sieben.de>, who has been
testing our 8.3 wildcards with a test suite.
With his new code for 8.3 matching, this is the test done
(I'm quoting from his email)

"I tested it by generating a directory with about 7600 Files and run
automatc tests with about 4000 patterns. The result from Win95 -> WinNT
and Win95 -> Samba where identical according to diff."

I have also re-written the long filename wildcard code,
so that doing DIR a*z now matches files :

AAA.BBB.CCCC....ZZZZ

correctly, and other fixes besides.

I sincerely hope I can lay this (horrid) issue to rest
now :-).

Jeremy.
(This used to be commit 94e3f0d9b4)
1998-05-27 22:48:22 +00:00
Jeremy Allison
1d16f75051 smb.h: More NT SMB stuff (just defines).
smbpass.c: Do *NOT* make this function static. It breaks the compile on gcc
util.c: Getting closer to MS wildcard semantics. A trailing '*' matches
        any trailing dot-separated components.
trans2.c: Removed hacks that change multiple '?' -> '*' as this
          breaks things now.
trans2.h: Removed NT_FILE_ATTRIBUTE_NORMAL - now FILE_ATTRIBUTE_NORMAL is defined
          in smb.h.
Jeremy.
(This used to be commit 42a6551106)
1998-05-26 19:37:31 +00:00
Jeremy Allison
00516da27e Fix to do NT wildcard matching.
Jeremy.
(This used to be commit 170070b9c7)
1998-05-19 22:06:41 +00:00
Jeremy Allison
1b412a501e passdb.c: Fixed typo in coment.
smb.h: Removed comments no longer valid.
smbpass.c: Stopped dummy function from being prototyped.
util.c: Fix for multibyte char problems with strlower, strupper
and string_replace.
Jeremy.
(This used to be commit cd244b45a5)
1998-05-19 20:08:37 +00:00
Jeremy Allison
643e16be62 Fixed signed/unsigned warning.
Jeremy.
(This used to be commit 6b6539cad8)
1998-05-19 04:49:56 +00:00
Luke Leighton
32954eb9e9 Makefile:
- added nisppass.c and NISPLUS_FLAGS

includes.h:

	- renamed USE_LDAP to USE_LDAP_DB.  renamed NISPLUS to USE_NISPLUS_DB.
	added default define of USE_SMBPASS_DB.

	- removed ldap headers: they are local only to ldap.c

ldap.c :

	- made all ldap-specific functions static.

	- added dummy sam21 functions

loadparm.c :

	- renamed NISPLUS to NISPLUS_HOME


mkproto.awk

	- commented out ldap-specific #ifdef generation code: it's not
	  needed now that ldap-specific functions in ldap.c are static

nisppass.c :

	- first attempt at an add function from
(This used to be commit f215d375f0)
1998-05-18 11:54:00 +00:00
Jeremy Allison
bc69d08227 util.c: Re-seed the crypto random number generator after a fork, so all
smbds started from the same parent won't use the same sequence.
Jeremy.
(This used to be commit d3f507d05d)
1998-05-15 00:39:46 +00:00
Luke Leighton
0923f9ec24 some pretty horrible formatting in standard_sub_basic(): makes the function
unreadable and unmaintainable
(This used to be commit eefeb61242)
1998-05-14 14:01:09 +00:00
Jeremy Allison
a4276507e4 chgpasswd.c: Added comments to #ifdefs
ipc.c: Caused samba password changing not to be done if UNIX password
       changing requested and not successful.
util.c: Added string_to_sid() and sid_to_string() functions.
lib/rpc/client/cli_samr.c:
lib/rpc/include/rpc_misc.h:
lib/rpc/parse/parse_lsa.c:
lib/rpc/parse/parse_misc.c:
lib/rpc/parse/parse_net.c:
lib/rpc/parse/parse_samr.c:
lib/rpc/server/srv_lsa.c:
lib/rpc/server/srv_lsa_hnd.c:
lib/rpc/server/srv_netlog.c:
lib/rpc/server/srv_samr.c:
lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs
around as char *, they are converted to DOM_SID at the earliest
opportunity, and passed around as that. Also added dynamic memory
allocation of group sids. Preparing to auto-generate machine sid.
Jeremy.
(This used to be commit 134d6fa79c)
1998-05-14 01:30:40 +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
Luke Leighton
f004d84f68 ldap back-end database development
Makefile:

	created PASSBD_OBJ group

includes.h:

	added #ifdef USE_LDAP to #include <ldap> headers

ldap.c:

	- renamed "_machine" to "_trust" everywhere.
	- added sam_passwd support routines
	- removed get_ldappwd_entry function: replaced with get_sampwd_entry
	- removed getldappwnam/uid: replaced with getsampwnam/uid
	- other messing about bits which are probably going to annoy the
	  hell out of jean-francois (sorry!)

mkproto.awk:

	- added stuff to wrap ldap.c protos with #ifdef USE_LDAP
	- added uid_t and gid_t return results to the prototype generation

passdb.c:

	- created getsam21pwent, add_sam21pwd_entry, mod_sam21pwd_entry.
	- modified getsampwnam/uid and created getsam21pwnam/rid functions
	  to replace the local get_smbpwd_entry() and get_ldappwd_entry()
	  functions, which jeremy didn't like anyway because they were
	  dual-purpose.
	- added utility routines which are or may be useful to all the
	  password database routines.

password.c:

	- renamed "machine_" to "trust_" everywhere.

smbpass.c:

	- removed get_smbpwd_entry function: replaced it with get_sampwd_entry
	  functions in passdb.c
	- moved code that decoded acct_ctrl into passdb.c
	- moved encode_acct_ctrl into passdb.c
	- removed getsmbpwnam/uid: replaced with getsampwnam/uid
	- renamed "machine_" to "trust_" everywhere.

smbpasswd.c:

	- renamed "machine_" to "trust_" everywhere.

util.c:

	- moved gethexpwd function into passdb.c

lib/rpc/server/srv_util.c:

	- moved user_rid_to_uid, group_rid_to_rid etc etc into passdb.c
(This used to be commit 673ab50c4c)
1998-05-11 15:56:01 +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
Luke Leighton
b543829dfc moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c
(This used to be commit abe261b2f5)
1998-05-07 19:59:32 +00:00
Jeremy Allison
01df1ed95f This should (hopefully :-) be the final fix for the %U %G substitution
problem....
smbpass.c: Removed Luke's dire warning - as some of the functions in here
*need* to be called externally :-).
Jeremy.
(This used to be commit 1fd8d12ca4)
1998-05-07 19:04:14 +00:00
Jeremy Allison
b54509045d loadparm.c: Added #ifdef USE_LDAP around ldap code.
server.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
smbpass.c: Partial tidyup of machine_password_lock() code - not finished yet.
util.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
lib/rpc/server/srv_ldap_helpers.c: Added #ifdef USE_LDAP around ldap code.
lib/rpc/server/srv_samr.c: Added #ifdef USE_LDAP around ldap code.
Jeremy.
(This used to be commit 446b98ca07)
1998-05-06 18:14:02 +00:00
Andrew Tridgell
f714ff9098 much faster pstrcpy() and fstrcpy()
also print out the first 50 chars of an overflowing string so we have
some chance of working out what is causng them.
(This used to be commit 7a67e76722)
1998-05-06 02:30:52 +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
041a292c43 ipc.c: Fix for printer queue spinning with Win95.
nmbd.c: Fix for always overwriting log despite append setting.
smb.h: Addition of last time password changed entry to account info.
smbpass.c: Changes to support last time changed field in smbpasswd file.
smbpasswd.c: Changes to support last time changed field in smbpasswd file.
util.c: Fix for always overwriting log despite append setting.
Jeremy.
(This used to be commit eb4fe9ecdf)
1998-04-15 20:00:41 +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
Andrew Tridgell
9a3537e068 minor reformatting of debug messages (so people don't think there is a
. on the end of their host names)
(This used to be commit dd3fe9fb47)
1998-04-12 02:54:31 +00:00
Jeremy Allison
af80d8e98f Makefile, loadparm.c, server.c, smb.h, util.c: Patch from
stn@techfak.uni-kiel.de (Stefan Nehlsen) to get homes from
the NIS+ map.
smbpasswd.c: Tidy up of cli_state structure.
Jeremy.
(This used to be commit fc2295e0f5)
1998-04-09 20:48:48 +00:00
Luke Leighton
0f8acce8eb want all of data in show_msg at log levels > 50.
(This used to be commit 2245f4908e)
1998-04-07 15:59:05 +00:00
Jeremy Allison
811a075e39 Fix for is_in_path from "Steven Hartland" <steven_hartland@pa.press.net> -
hide files was not working.
Jeremy.
(This used to be commit 8d686f3b6b)
1998-03-25 20:10:58 +00:00
Jeremy Allison
e2060b58e0 Fixed 'unused variable' warnings found with gcc -Wall -Werror.
Jeremy.
(This used to be commit 6eca266fe5)
1998-03-24 19:56:24 +00:00
Samba Release Account
1a264998ca ypserver not available: AUTOMOUNT server and path don't work.
fix: set default values to local server / path _before_ attempting to
find the ypserver's auto.home entry.
(This used to be commit 051ec104fe)
1998-03-24 19:21:27 +00:00
Jeremy Allison
5d7c8375e4 clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb).
quotas.c: Linux quota fix.
util.c: Ensure smb_read_error is zero in all calls that can set it.
lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h
lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c
lib/rpc/server/srv_netlog.c : Modify Luke's code to call
SamOEMhash().

Jeremy.
(This used to be commit 7f74970838)
1998-03-24 00:37:53 +00:00
Andrew Tridgell
e0b8bc8ab1 a pointless commit to check on a problem Luke reported with CVS
(This used to be commit a947d9ceba)
1998-03-23 01:17:51 +00:00
Andrew Tridgell
f996885676 this isn't a big commit, it just looks like it :-)
I needed the client_name() and client_addr() functions in swat so I
could tell who was connecting from where. The problem was that these
functions didn't take a file descriptor parameter they just used
the global "Client".

So I needed to change all calls to pass a parameter ... lots of files.
(This used to be commit a776058900)
1998-03-17 12:31:43 +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
c063e9ec3e added the ability to start/stop the server from SWAT.
I needed to modify the way the pidfile is handled in nmbd and smbd to
do this. Jeremy, you may wish to look at what I've done as it probably
breaks the Whistle use of pidfiles. In particular I've removed the -f
option and instead smbd and nmbd always create a pidfile in the lock
directory.
(This used to be commit 20bb22d61b)
1998-03-14 12:57:58 +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
Jeremy Allison
834ef56244 nmbd_incomingdgrams.c: Fix for typo.
nmbd_sendannounce.c: Remote announcement was announcing to the wrong name !
nmblookup.c: Fix for substitutions not seeing hostname.
testparm.c: Fix for substitutions not seeing hostname.
wsmbstatus.c: Fix for substitutions not seeing hostname.
util.c: Change read_udp_socket to use sockaddr_in rather than dubiously
messing around with an opaque data type (sockaddr).
Jeremy.
(This used to be commit 776ccf5c06)
1998-02-24 17:59:34 +00:00
Jeremy Allison
c16d4aec00 nmbd_packets.c: nmbd_subnetdb.c: Patch from Andrey Alekseyev <fetch@muffin.arcadia.spb.ru>
to fix the fact that retransmit_or_expire_response_records() wasn't looking
at the WINS subnet.
server.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution.
smbpass.c: Fix to stop parsing failing on non-valid lines.
trans2.c: Fix for volume serial number code.
util.c:  Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution.
         Fix for warnings under RH5. gcc 2.8.
Jeremy.
(This used to be commit e58ab3bbe6)
1998-02-20 19:48:01 +00:00
Jeremy Allison
c57e8d404d Fix to make us compile cleanly with gcc 2.8.
Jeremy.
(This used to be commit 0a53568007)
1998-02-14 14:32:36 +00:00
Jeremy Allison
99e11e171e Makefile: Added AIX 3.2.5.
loadparm.c: Added "win95 bug compatibility" parameter.
local.h: Replaced MAX_OPEN_FILES back to 100 from 10 (oops).
reply.c: Fixed ulogoff check against uid - changed to vuid.
server.c: Changed file struct save of uid - changed to vuid.
smb.h: Changed id in struct current_user to vuid.
       Changed file struct uid to vuid.
time.c: Added "win95 bug compatibility" atime -> mtime return.
trans2.c: Added "win95 bug compatibility" fixes.
uid.c: Changed id in struct current_user to vuid - added checks
       to set/reset it.
util.c: Added code to expand environment variables.
version.h : still at 1.9.18 (head branch doesn't matter too much at present).
Jeremy.
(This used to be commit adc903bcf5)
1998-02-11 11:07:14 +00:00
Jeremy Allison
5546e28e69 A small raft of changes, I will sync up with 1.9.18 also.
chgpasswd.c: Fixed typo in debug message.
includes.h: Fix include for aix.
kanji.c: Added cap_to_sj as inverse of sj_to_cap.
loadparm.c:
local.h:
password.c: Added code for "networkstation user login" parameter.
- patch from Rob Nielsen <ran@adc.com>.
printing.c: Added further aix printing fixes.
reply.c: Changed access time fetch to a function.
trans2.c: Changed access time fetch to a function.
time.c: Changed access time fetch to a function.
server.c: Made NT redirector workaround final.
util.c: Added debug for write_socket failing.
Jeremy.
(This used to be commit a031404623)
1998-02-07 12:15:20 +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
Jeremy Allison
118213c059 printing.c: Bug fix for lpng reporting.
server.c: Large fix for oplock deadlock bug.
util.c: Fix for oplock deadlock bug.
Jeremy.
(This used to be commit 4cae830ab3)
1998-01-22 09:25:05 +00:00
Jeremy Allison
1ea8ceac45 charcnv.c: Added codepage 866 support onto the file system. Patch
from Max Khon <max@iclub.nsu.ru>.
chgpasswd.c: Allow old RAP change password to work with encrypted
passwords. Samba can now allow Windows 95/NT clients to securely
change the Lanman password ! (But not the NT hash - that gets lost).
ipc.c:
smbdes.c:
smbpass.c: Support for the above.
server.c: #ifdef'ed out fix for NT redirector bug.
util.c: Fix NIS bug with server name.
Jeremy.
(This used to be commit cd9fad92d0)
1998-01-17 07:08:21 +00:00
Andrew Tridgell
ed2ed5671b fixed a couple of illegal uses of scanf() in the nmbd wins code. They
caused a core dump under IRIX when compiled with -64.
In general you cannot assume things about variable sizes. In
particular sizeof(time_t) may not equal sizeof(long) and
sizeof(uint16) may not equal sizeof(short).
There are probably other bugs like this. We'll need to check all
format statements for use of %ld, %hx etc. In general these should not
be used unless you have an explicit cast to the appropriate type.
(This used to be commit 6ea907e786)
1997-12-26 10:01:57 +00:00
Jeremy Allison
aef2c5d699 Added SIGUSR1/SIGUSR2 handling.
Sending nmbd/smbd a SIGUSR1 will raise the debug level by one (capped at 10)
sending a SIGUSR2 will lower it (lower limit at zero).
Jeremy.
(This used to be commit 6a3cb6f4b4)
1997-12-24 09:30:56 +00:00
Jeremy Allison
d1e796d857 Fixes to compile under OpenBSD from "Todd T. Fries" <toddf@acm.org>
Jeremy.
(This used to be commit 3c92925059)
1997-12-23 07:15:59 +00:00
Jeremy Allison
6f56211721 Fixed stupid bug in read_smb_len where I was calling itself - now
calling the correct fn.
Jeremy.
(This used to be commit c62aa0a760)
1997-12-20 14:52:48 +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
Jeremy Allison
d57c055478 loadparm.c: Added fix for veto oplock files bug from Charles Hoch <hoch@hplcgh.hpl.hp.com>
server.c, util.c: Added fix for oplock break requests blocking due to server being
                  blocked in read call. Bug found by Charles Hoch <hoch@hplcgh.hpl.hp.com>.
Jeremy.
(This used to be commit 209f894fdb)
1997-12-20 10:52:00 +00:00
Jeremy Allison
42e0d9a1f0 trans2.c: Forced trans2_findfirst to behave as NT does in error returns.
util.c: Applied fix from Branko Cibej <branko.cibej@hermes.si> where
StrnCaseCmp tests one character too many.
Jeremy.
(This used to be commit cb771b2667)
1997-12-20 05:25:37 +00:00
Andrew Tridgell
cc12fc66d1 I'm slowly getting though the todo list :-)
This change allows people to select the SYSLOG_FACILITY in local.h, or
add it to the Makefile if they want to.
(This used to be commit afe88facbf)
1997-12-03 03:21:25 +00:00
Andrew Tridgell
7b10574429 dont try getpeername() when Client isn't initialised
(This used to be commit a32ca542ad)
1997-12-02 23:24:26 +00:00
Andrew Tridgell
ec8e33cde6 use -1 not 0xffffffff in SIVALS() macros
use the same process_exists() code on all systems (it's probably
faster anyway)
(This used to be commit 901b95aa77)
1997-11-29 13:29:13 +00:00
Andrew Tridgell
cf9d07cc7d added a sent_oplock_break element to Files[] as a paranoia check so we
can't sent a oplock break twice on the same file.

changed some debug levels in the oplock code to level 0 so we can
track down a bug

zero the returned Files[] entry in find_free_file()

don't try to overcome client bugs in the handling of non-encrypted
passwords if in server level security mode

added paranoid null termination of password buffers

slight change to my ajt_panic() routine
(This used to be commit e360c79c9c)
1997-11-29 02:40:31 +00:00
Jeremy Allison
cdc6099647 Rolling back the files
loadparm.c : to equivalent to version 1.67
reply.c : to equivalent to version 1.69
server.c : to equivalent to version 1.122
util.c : to equivalent to version 1.98

to remove the incorrect changes.

proto.h: The usual.

rpc_pipes/smbparse.c : Backeting stuff that SHOULD NOT BE IN THE
                       none-NTDOMAIN build !

Jeremy.
(This used to be commit 6064c9d80f)
1997-11-03 19:24:45 +00:00
Luke Leighton
b26623bc3a Christian Lademann's contribution: new capabilities in smb.conf.
'<' and '|' characters indicate read file and execute command respectively,
and feed the output into the parameter (!!!).

'<$' and '|$' means run standard_sub_basic() on them.

this is going to be fun to document in smb.conf.5....

also, Christian created a new "online" service parameter.  services can
be taken "off-line"....
(This used to be commit 15f44d2891)
1997-11-02 20:35:20 +00:00
Luke Leighton
520878fd1f ipc.c ntclientpipe.c:
response to Bind Acknowledgment needs a lookup table for the PIPE string
	(secondary address in RPC_HDR_BA structure).

smbparse.c util.c :

	interesting problem, i think caused by us typecasting a uint16* buffer
	to char*.  found on a SPARC.
(This used to be commit 420408ee83)
1997-10-29 19:05:34 +00:00
Luke Leighton
ebafb1e288 called dump_data() from show_msg().
(This used to be commit 89664898e2)
1997-10-29 15:35:53 +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
a60ad7bef3 default server_name if NIS server is unavailable should be the local
machine, not a NULL string.
(This used to be commit 5b15b17fc6)
1997-10-24 13:58:21 +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
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
2e8cedba64 loadparm.c :
added "domain other sids" parameter

pipenetlog.c :

	using "domain other sids" parameter in SAM Logon response.
	using new name_to_rid() function for r_uid and r_gid.

pipentlsa.c :

	minor mods to do with new name_to_rid() function.

pipesrvsvc.c :

	in the "net share enum" response, allocate some more space for the buffer.
	there can be only 32 share entries in the response anyway.  this needs
	to be dealt with.

pipeutil.c :

	modified name_to_rid() function to use new parameters "domain admin users"
	and "domain guest users", but will otherwise do unix uid + 1000.

	moved make_dom_gids() here.

proto.h:

	the usual.

smb.h smbparse.c :

	renamed sid_no to sid_rev_num in DOM_SID, and gid to r_gid in DOM_GID.

util.c :

	moved make_dom_gids() from here.
	created char *unistrn2(uint16* uni_buffer, int max_len)
(This used to be commit ec60e48d79)
1997-10-22 11:31:37 +00:00
Luke Leighton
efe9b26a7b loadparm.c :
added "domain admin users" parameter
	added "domain guest users" parameter

	these two complement the "domain groups" parameter.  the "domain groups"
	parameter should be for your own groups, and well-known aliases.

util.c :

	added ability to do "domain groups = power_users admin_users backup_ops"
	which are well-known RID aliases, not well-known RID groups.

pipenetlog.c :

	combine the "domain admin users"; "domain guest users" and "domain groups"
	parameters to give an array of RID groups to include in the SAM Logon
	response.

ipc.c smb.h :

	moved REALLOC() into smb.h
	added RID #defines.

proto.h:

	usual.
(This used to be commit f2554f231d)
1997-10-21 18:25:14 +00:00
Luke Leighton
77a9385525 added "domain groups" parameter, allowing you to specify the groups that
the user belongs to.

it would be nice to know exactly what the domain groups _are_....
(This used to be commit c6e37d8db0)
1997-10-20 16:25:19 +00:00
Luke Leighton
423a7c4171 util.c password.c :
added automount_server() function which, if -DAUTOMOUNT is in use,
	returns the server name of the NIS auto.map entry.  otherwise,
	it returns local_server.

	added use of automount_server() for a new substitution %N for NIS
	home server.  this defaults, via automount_server(), to the same
	functionality as %L if -DAUTOMOUNT is not used.

	removed vuser->home_share.  moved code that grabbed the servername
	into the separate function automount_server().

loadparm.c :

	created "logon drive" (default of "")
	created "logon home"  (default of "\\%N\%U")
	changed default of "logon path" from NULL to "\\%N\%U\profile".

ipc.c pipenetlog.c :

	use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their
	now easier-to-use form (don't have to check if *lp_logon_path() and
	manually substitute a default of \\%L\%U and do a standard_sub_basic()
	on the result, because the default automatically does this.
(This used to be commit c6c28a4c3c)
1997-10-20 12:10:58 +00:00
Andrew Tridgell
f4b4b3e6e3 casting cleanups
(This used to be commit ab849a9782)
1997-10-20 02:50:12 +00:00