samba.git
25 years agoinitialise some variables (stops warning)
Andrew Tridgell [Wed, 13 May 1998 05:07:55 +0000 (05:07 +0000)]
initialise some variables (stops warning)

25 years agotest for overflow in nmb name parsing code
Andrew Tridgell [Wed, 13 May 1998 05:03:17 +0000 (05:03 +0000)]
test for overflow in nmb name parsing code

25 years agoinitialise a variable
Andrew Tridgell [Wed, 13 May 1998 05:02:31 +0000 (05:02 +0000)]
initialise a variable

25 years agowe don't need a typedef for string
Andrew Tridgell [Wed, 13 May 1998 05:01:36 +0000 (05:01 +0000)]
we don't need a typedef for string

25 years agoincludes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don't
Jeremy Allison [Tue, 12 May 1998 22:11:24 +0000 (22:11 +0000)]
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.

25 years ago- removed ldap_get_trust()
Luke Leighton [Tue, 12 May 1998 16:49:26 +0000 (16:49 +0000)]
- removed ldap_get_trust()

- #ifdef around putting 16 byte hashes instead of plaintext password.

25 years agofunction comments wrong
Luke Leighton [Tue, 12 May 1998 16:43:52 +0000 (16:43 +0000)]
function comments wrong

25 years agoremoved lp_domain_workstation() parameter
Luke Leighton [Tue, 12 May 1998 14:04:46 +0000 (14:04 +0000)]
removed lp_domain_workstation() parameter

25 years agoretired this file: it's not actually needed now that passdb.c provides
Luke Leighton [Tue, 12 May 1998 14:01:56 +0000 (14:01 +0000)]
retired this file: it's not actually needed now that passdb.c provides
the interface point.

25 years agoa new slprintf() function. This one is totally portable but a bit of a
Andrew Tridgell [Tue, 12 May 1998 12:48:54 +0000 (12:48 +0000)]
a new slprintf() function. This one is totally portable but a bit of a
kludge. It is a safe kludge with our current code but I would like to
revisit it at some point in the future.

The problem with the one I committed yesterday is it used non-portable
functions. (it also had a bug in it, but that's another matter)

This one works by just using vsprintf() into a 8k buffer and a memcpy
from there. No memory protection tricks or other non-portable
stuff. This is safe because all calls to slprintf() in samba use
strings which have been through a pstrcpy and thus are less than 1024
bytes. No call uses more than 2 of these strings. See what I mean by
kludge? Note that the 8k is way overkill but I like overkill :)

Someday (after autoconf) we will replace this with something better,
but meanwhile this is simple, secure and portable.

25 years agoThis is a security audit change of the main source.
Jeremy Allison [Tue, 12 May 1998 00:55:32 +0000 (00:55 +0000)]
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.

26 years agopassword back-end database support
Luke Leighton [Mon, 11 May 1998 18:03:01 +0000 (18:03 +0000)]
password back-end database support

ldap.c :

- added getldap21pwent() function

passdb.c :

- getsam21pwent() no longer a stub: calls ldap21 or smb21

smbpass.c :

- added getsmb21pwent() function (he he :-)

lib/rpc/server/srv_samr.c :

- removed "specific" calls to ldap functions; replaced with
  call to get_sampwd_entries instead (which is unfinished).

- rewrote get_user_info_21 function to call getsam21pwrid.

26 years agoreply.c: Added code to not overwrite sesssetup_user when in share level security
Jeremy Allison [Mon, 11 May 1998 17:53:37 +0000 (17:53 +0000)]
reply.c: Added code to not overwrite sesssetup_user when in share level security
and null session setup done.
smbpasswd.c: Fix from Gerald Carter <cartegw@Eng.Auburn.EDU> to fix incorrect
             use of pointer.
Jeremy.

26 years agoadd lp_domain_workstations() parameter. this is a list of workstation names
Luke Leighton [Mon, 11 May 1998 17:34:39 +0000 (17:34 +0000)]
add lp_domain_workstations() parameter.  this is a list of workstation names
from which an NT user can log in from.  empty (default) indicates no
restrictions.  exactly how this is enforced is unknown.  from past experience
it's likely that the enforcement is left to the client to carry out...

26 years agoldap back-end database development
Luke Leighton [Mon, 11 May 1998 15:56:01 +0000 (15:56 +0000)]
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

26 years agodon't use system functions as arguments to qsort() as otherwise you
Andrew Tridgell [Mon, 11 May 1998 08:41:09 +0000 (08:41 +0000)]
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

26 years agoinclude includes.h in all the ubiqx files. I know Chris won't like
Andrew Tridgell [Mon, 11 May 1998 08:32:37 +0000 (08:32 +0000)]
include includes.h in all the ubiqx files. I know Chris won't like
this but it really is necessary (sorry Chris!)

ubiqx code didn't compile on SunOS4 otherwise as stdlib didn't define
NULL.

26 years agochanged to use slprintf() instead of sprintf() just about
Andrew Tridgell [Mon, 11 May 1998 06:38:36 +0000 (06:38 +0000)]
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.

26 years agochanged to use slprintf() instead of sprintf() just about
Andrew Tridgell [Mon, 11 May 1998 06:35:45 +0000 (06:35 +0000)]
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.

26 years agoUpdated OSF1_ENH_SEC mode password handling.
John Terpstra [Sun, 10 May 1998 06:20:27 +0000 (06:20 +0000)]
Updated OSF1_ENH_SEC mode password handling.
This now tries Enhanced passwords first and if this fails trys Basic
mode (ie: Unix /etc/passwd) authentication. This only happens when
OSF1_ENH_SEC is defined at compilation.

26 years agoadded sam_passwd structure: don't want smb_passwd to be "polluted".
Luke Leighton [Fri, 8 May 1998 17:53:17 +0000 (17:53 +0000)]
added sam_passwd structure: don't want smb_passwd to be "polluted".

26 years agomove things around to get rid of make clean warning messages
Herb Lewis [Fri, 8 May 1998 17:30:48 +0000 (17:30 +0000)]
move things around to get rid of make clean warning messages

26 years agoremoved proto.h from cvsignore
Luke Leighton [Fri, 8 May 1998 17:01:25 +0000 (17:01 +0000)]
removed proto.h from cvsignore

26 years agoclitar.c: #ifdef'ed out all the bits that were giving 'defined but not used'
Jeremy Allison [Fri, 8 May 1998 16:59:30 +0000 (16:59 +0000)]
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.

26 years agoHo hum, someone deleted proto.h from cvs... re-adding.
Jeremy Allison [Fri, 8 May 1998 16:49:10 +0000 (16:49 +0000)]
Ho hum, someone deleted proto.h from cvs... re-adding.
Jeremy.

26 years agoproto.h was being a pain. use "make proto" instead. check release and
Luke Leighton [Fri, 8 May 1998 14:41:35 +0000 (14:41 +0000)]
proto.h was being a pain.  use "make proto" instead.  check release and
release-alpha scripts operate correctly when it comes to generating
a release or alpha release.

26 years agoadded proto.h to .cvsignore
Luke Leighton [Fri, 8 May 1998 14:14:26 +0000 (14:14 +0000)]
added proto.h to .cvsignore

26 years agoadded smb_grpid to smb_passwd struct
Luke Leighton [Fri, 8 May 1998 14:09:13 +0000 (14:09 +0000)]
added smb_grpid to smb_passwd struct

26 years agoSe-submitting clitar.c/
Richard Sharpe [Fri, 8 May 1998 13:51:17 +0000 (13:51 +0000)]
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

26 years agorenamed last_change_time to pass_must_change_time. removed "if (bool==True)"
Luke Leighton [Fri, 8 May 1998 11:31:55 +0000 (11:31 +0000)]
renamed last_change_time to pass_must_change_time.  removed "if (bool==True)"
and "if (bool==False)" code from ldap.c - a boolean test may not necessarily
return exactly True or exactly False: True may be defined to be -1: you never
know...

26 years agoadded extra fields to struct smb_passwd
Luke Leighton [Fri, 8 May 1998 11:30:17 +0000 (11:30 +0000)]
added extra fields to struct smb_passwd

the smbpw functions are expected to fill in the blanks by reading the
appropriate smb.conf parameters.

the ldappw functions are expected to fill in the fields from the ldap
database.  a separate utility can be written to fill in the ldap database
fields from the smb.conf parameters, at a later date.

26 years agoThe globals section now shows non-default variables (like the
Herb Lewis [Fri, 8 May 1998 01:45:12 +0000 (01:45 +0000)]
The globals section now shows non-default variables (like the
view config section does) in the basic view. There is also a
reset button to undo all changes you have made (that haven't
been committed). In addition each field now has a "Set Default"
button. Multi-choice fields are now select fields instead of
a set of radio buttons.

On the status screen I added a "restart" option for stopping then
starting smbd and nmbd.

26 years agoadded FLAG_BASIC to some browse options for swat.
Herb Lewis [Fri, 8 May 1998 01:41:27 +0000 (01:41 +0000)]
added FLAG_BASIC to some browse options for swat.

26 years agosmb.h: Supporting defines for NT trans calls.
Jeremy Allison [Fri, 8 May 1998 01:23:11 +0000 (01:23 +0000)]
smb.h: Supporting defines for NT trans calls.
trans2.c: Paranoia bugfixes added when studying nttrans.c.
Jeremy.

26 years agoInitial cut at the code that will do NT SMB calls. Not linked in, not
Jeremy Allison [Fri, 8 May 1998 01:22:16 +0000 (01:22 +0000)]
Initial cut at the code that will do NT SMB calls. Not linked in, not
compiled yet, just checked in for safe keeping :-).
Jeremy.

26 years agoadded first pass at start/get/end-ldappwent functions. unfortunately, lots
Luke Leighton [Thu, 7 May 1998 21:09:58 +0000 (21:09 +0000)]
added first pass at start/get/end-ldappwent functions.  unfortunately, lots
of information will be lost as these functions currently return
struct smb_passwd not SAM_USER_INFO_21 or any other type of structure...

26 years agoremove unused ldap functions: add stub start/get/endldappwent routines.
Luke Leighton [Thu, 7 May 1998 20:44:45 +0000 (20:44 +0000)]
remove unused ldap functions: add stub start/get/endldappwent routines.

26 years agomoving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c
Luke Leighton [Thu, 7 May 1998 19:59:32 +0000 (19:59 +0000)]
moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c

26 years agoThis should (hopefully :-) be the final fix for the %U %G substitution
Jeremy Allison [Thu, 7 May 1998 19:04:14 +0000 (19:04 +0000)]
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.

26 years agocreated "passdb.c" which is an interface point to (at present) either
Luke Leighton [Thu, 7 May 1998 18:19:05 +0000 (18:19 +0000)]
created "passdb.c" which is an interface point to (at present) either
smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP).

_none_ of the functions in ldap.c or smbpass.c should be called directly:
only those in passdb.c should be used.

-DUSE_LDAP is unlikely to compile at the moment.

26 years agoFixed changed calls to machine password locking code.
Jeremy Allison [Thu, 7 May 1998 02:06:53 +0000 (02:06 +0000)]
Fixed changed calls to machine password locking code.
Jeremy.

26 years agoAndrew redefines the free() function to do some memory management testing.
Christopher R. Hertel [Wed, 6 May 1998 19:22:45 +0000 (19:22 +0000)]
Andrew redefines the free() function to do some memory management testing.
He also suggested that some systems may implement free() as a macro (but
I think he was looking for an excuse ;).  Anyway, I've added a function
to mangle.c that calls free().
Chris -)-----

26 years agosmbpass.c: Fixed machine_passwd_lock() problems.
Jeremy Allison [Wed, 6 May 1998 18:45:57 +0000 (18:45 +0000)]
smbpass.c: Fixed machine_passwd_lock() problems.
password.c: Fixed machine_passwd_lock() problems.
lib/rpc/server/srv_ldap_helpers.c: Oops - broke proto.h with dummy function. Fixed now.
Jeremy.

26 years agoloadparm.c: Added #ifdef USE_LDAP around ldap code.
Jeremy Allison [Wed, 6 May 1998 18:14:02 +0000 (18:14 +0000)]
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.

26 years agoRolling back again to the equivalent of revision 1.22, as the current
Jeremy Allison [Wed, 6 May 1998 17:54:28 +0000 (17:54 +0000)]
Rolling back again to the equivalent of revision 1.22, as the current
CVS head branch will not compile.
Jeremy.

26 years agojean-francois micouleau's well-alpha code for ldap password database stuff!
Luke Leighton [Wed, 6 May 1998 17:43:44 +0000 (17:43 +0000)]
jean-francois micouleau's well-alpha code for ldap password database stuff!
he's going to hate me for checking this in so early, but...

26 years agoAdded mksmbpasswd.sh to binary package
Volker Lendecke [Wed, 6 May 1998 16:13:31 +0000 (16:13 +0000)]
Added mksmbpasswd.sh to binary package

26 years agocompiler warning for unimportant uninitialised variable
Luke Leighton [Wed, 6 May 1998 12:11:35 +0000 (12:11 +0000)]
compiler warning for unimportant uninitialised variable

26 years agoReal fix for clitar.c problems. Have now made all the right
Richard Sharpe [Wed, 6 May 1998 02:35:56 +0000 (02:35 +0000)]
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. :-)

26 years agomuch faster pstrcpy() and fstrcpy()
Andrew Tridgell [Wed, 6 May 1998 02:30:52 +0000 (02:30 +0000)]
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.

26 years agoFixes for the %U and %G problems people have reported.
Jeremy Allison [Wed, 6 May 1998 01:34:51 +0000 (01:34 +0000)]
Fixes for the %U and %G problems people have reported.
Essentially, multiple session_setup_and_X's may be done
to an smbd. As there is only one global variable containing
the requested connection name (sessionsetup_user), then any
subsequent sessionsetups overwrite this name (causing %U
and %G to get the wrong name). This is particularly common
when an NT client does a null session setup to get a
browse list after the user has connected, but before
a share has been mounted.

These changes store the requested_name in the vuid structure
(so this only really works for user level and above security)
and copies this name back into the global variable before
the standard_sub call.

Jeremy.

26 years agogenrand.c: SGI compile warning fix.
Jeremy Allison [Tue, 5 May 1998 19:24:32 +0000 (19:24 +0000)]
genrand.c: SGI compile warning fix.
ipc.c: Fix for duplicate printer names being long.
loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c
protects us.
nmbd_logonnames.c:
nmbd_namequery.c:
nmbd_namerelease.c: Debug messages fix.
password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call.
reply.c: SGI compile warning fix.
server.c Debug messages fix.
smbpass.c: Fix for incorrect pointer.
Jeremy.

26 years agoadded definitions for "password chat debug" and "unix password sync"
Herb Lewis [Tue, 5 May 1998 19:23:40 +0000 (19:23 +0000)]
added definitions for "password chat debug" and "unix password sync"
from the 1.9.18 tree

26 years agoRolling clitar.c back to the previous rev 1.22 as the current one
Jeremy Allison [Tue, 5 May 1998 18:11:24 +0000 (18:11 +0000)]
Rolling clitar.c back to the previous rev 1.22 as the current one
needs fixing (sorry).
Jeremy.

26 years agoAdded bug fixes to clitar to ensure proper longfile name restores
Richard Sharpe [Tue, 5 May 1998 13:03:44 +0000 (13:03 +0000)]
Added bug fixes to clitar to ensure proper longfile name restores
occur.

Also getting ready for setting directory dates correctly

26 years agopatches from jean francois: couple of minor bugs
Luke Leighton [Tue, 5 May 1998 09:04:49 +0000 (09:04 +0000)]
patches from jean francois: couple of minor bugs

26 years agohere is a first cut at a "fixed up" help file
Herb Lewis [Fri, 1 May 1998 19:02:08 +0000 (19:02 +0000)]
here is a first cut at a "fixed up" help file

26 years agomkman - add argument for making html versions of man pages
Herb Lewis [Thu, 30 Apr 1998 16:00:18 +0000 (16:00 +0000)]
mkman - add argument for making html versions of man pages
idb.pl - minor fixups for sorting of output file.

26 years agoAdded patch from Bruce Tenison <btenison@dibbs.net> to allow encrypted
Jeremy Allison [Thu, 30 Apr 1998 01:39:22 +0000 (01:39 +0000)]
Added patch from Bruce Tenison <btenison@dibbs.net> to allow encrypted
passwords to be stored over time, allowing a smbpasswd file migration.
Adds new parameter "update encrypted".
Will also add to 1.9.18 branch.
Docs update to follow.
Jeremy.

26 years agoMakefile: Added files to smbpasswd.c.
Jeremy Allison [Wed, 29 Apr 1998 22:27:26 +0000 (22:27 +0000)]
Makefile: Added files to smbpasswd.c.
loadparm.c: Patch from tim@quiknet.com for static string problems.
server.c: Setup global_myname.
smbpass.c: Fix up locking. Add machine_password_delete() call.
smbpasswd.c: Added provisional code to add to a domain.
lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password.
lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password.
Jeremy.

26 years agoclientgen.c: Fixed null session setup bug.
Jeremy Allison [Wed, 29 Apr 1998 19:22:01 +0000 (19:22 +0000)]
clientgen.c: Fixed null session setup bug.
password.c: Stopped cli_nt_logout call (we don't have it correct yet).
            Added Luke object-orientation fix :-).
smb.h: Added clnt_name_slash to cli_state.
lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed.
lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error.
lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix.
lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1.
Jeremy.

26 years agoadd clean option
Herb Lewis [Wed, 29 Apr 1998 13:45:27 +0000 (13:45 +0000)]
add clean option

26 years agopassword.c:
Luke Leighton [Wed, 29 Apr 1998 11:00:12 +0000 (11:00 +0000)]
password.c:

added become_root / unbecome_root around the get machine account password.

smbpass.c:

cleaning up code.

- turning if (BOOL_expr == False) into if (BOOL_expr)
  what if you test if (BOOL_expr == True) and someone defines
  True to be -1 on one system and 1 on another?  or if you get
  inconsistent return results between developers

- removed if ((FILE*) == 0) and made this if ((FILE*) == NULL) -
  cannot assume that NULL is zero integer.  plus there are typecast
  issues to deal with

- removed return (ret == 0) ? True : False and made this return ret == 0
  rely on the compiler to return correct BOOL value: not all developers
  will return True or False #defines: stick with BOOL test (non-zero).

- removed if (ret == False) replaced with if (!ret)

- bug where instead of if (sizeof(pstring)-len-len-6 < 0) it had a
  boolean test if (pstring-len-len-6).

- removed "." after debugging of filenames: the "." - a fullstop -
  looked like it was part of the filename, making things difficult
  to sort out.

still to be resolved: the global_myname isn't set up, such that the
machine account password file is named "TEST3..mac".

26 years agoThis is the checkin that adds the security=domain functionality.
Jeremy Allison [Wed, 29 Apr 1998 00:02:57 +0000 (00:02 +0000)]
This is the checkin that adds the security=domain functionality.

WARNING - so far this has only been tested against a Samba PDC
(still waiting for IS to add me the machine accounts :-).

Still missing is the code in smbpasswd that will add a machine
account password and change it on the domain controller, but
this is not hard, and I will check it in soon.

Jeremy.

26 years agofix problem with output file not being properly sorted
Herb Lewis [Tue, 28 Apr 1998 18:58:20 +0000 (18:58 +0000)]
fix problem with output file not being properly sorted

26 years agoFixed checked in code that didn't compile.
Jeremy Allison [Tue, 28 Apr 1998 16:43:02 +0000 (16:43 +0000)]
Fixed checked in code that didn't compile.
Jeremy.

26 years agoadded NetShareEnum from Bartlomej Czardybon <czar@silesia.pik-net.pl>
Luke Leighton [Tue, 28 Apr 1998 09:53:42 +0000 (09:53 +0000)]
added NetShareEnum from Bartlomej Czardybon <czar@silesia.pik-net.pl>

26 years agoFirst version that compiles. Much more to do.....
Jeremy Allison [Tue, 28 Apr 1998 01:24:40 +0000 (01:24 +0000)]
First version that compiles. Much more to do.....
Jeremy.

26 years agoAdded SuSE packaging files.
Volker Lendecke [Mon, 27 Apr 1998 09:11:28 +0000 (09:11 +0000)]
Added SuSE packaging files.

Volker

26 years agoThis looks like a big change but really isn't.
Jeremy Allison [Sat, 25 Apr 1998 01:12:08 +0000 (01:12 +0000)]
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.

26 years agoABOUT time. dce/rpc long packet format now works, server-side.
Luke Leighton [Fri, 24 Apr 1998 21:01:08 +0000 (21:01 +0000)]
ABOUT time.  dce/rpc long packet format now works, server-side.
turns out that [it can be deduced that] microsoft ignores the SMBreadX
offset, and goes by the SMBreadX length only.  this makes for a lot simpler
code, in both client and server.

26 years agocli_pipe.c: Corrected cli_api_pipe() calls.
Jeremy Allison [Fri, 24 Apr 1998 00:34:21 +0000 (00:34 +0000)]
cli_pipe.c: Corrected cli_api_pipe() calls.
Jeremy.

26 years agoMakefile: Added nterr.c into the mix.
Jeremy Allison [Thu, 23 Apr 1998 22:59:19 +0000 (22:59 +0000)]
Makefile: Added nterr.c into the mix.
clientgen.c: Added nt_error as an entry in the struct client_state.
password.c: Open the netlogon pipe.
smb.h: Added nt_error as an entry in the struct client_state.
lib/rpc/parse/parse_net.c: Added comments on net logon.
lib/rpc/server/srv_netlog.c: Added comments on net logon.
Jeremy.

26 years agoThese don't compile yet - but they are the core code in what
Jeremy Allison [Thu, 23 Apr 1998 22:45:53 +0000 (22:45 +0000)]
These don't compile yet - but they are the core code in what
will be DOMAIN_CLIENT called code.
Jeremy.

26 years agoWe will need this new nterr.c for the DOMAIN_CLIENT code.
Jeremy Allison [Thu, 23 Apr 1998 22:08:39 +0000 (22:08 +0000)]
We will need this new nterr.c for the DOMAIN_CLIENT code.
Jeremy.

26 years agoclientgen.c: Added rap error codes to cli_error, moved from smbpasswd.c
Jeremy Allison [Thu, 23 Apr 1998 20:12:17 +0000 (20:12 +0000)]
clientgen.c: Added rap error codes to cli_error, moved from smbpasswd.c
password.c: Changed global cli -> pw_cli, removed strtok (bad strtok, bad :-)
use in security=server, started to extend security=domain code.
smbpasswd.c: Removed rap error code functions.
Jeremy.

26 years agogenrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file().
Jeremy Allison [Thu, 23 Apr 1998 18:54:57 +0000 (18:54 +0000)]
genrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file().
password.c: Started the initial code for domain_client_validate(). All
            bracketed with #ifdef DOMAIN_CLIENT for now.
reply.c: Call to domain_client_validate(). All
            bracketed with #ifdef DOMAIN_CLIENT for now.
smbpass.c: New code to get/set machine passwords. Tidied up nesting
           of lock calls.
Jeremy.

26 years agoFixed bug found by Gerald Carter <cartegw@Eng.Auburn.EDU> where
Jeremy Allison [Wed, 22 Apr 1998 17:59:44 +0000 (17:59 +0000)]
Fixed bug found by Gerald Carter <cartegw@Eng.Auburn.EDU> where
global myname was being overwritten incorrectly.
Jeremy.

26 years agogenrand.c: Improved generation of random values, more secure.
Jeremy Allison [Wed, 22 Apr 1998 00:56:38 +0000 (00:56 +0000)]
genrand.c: Improved generation of random values, more secure.
loadparm.c: Started add of 'security=domain' code.
password.c: Fix for security=server NT bugs.
reply.c: Started add of 'security=domain' code.
server.c: Started add of 'security=domain' code.
smb.h: Started add of 'security=domain' code.
Jeremy.

26 years agomany systems don't have /etc/shadow but do have another system for
Andrew Tridgell [Tue, 21 Apr 1998 07:26:15 +0000 (07:26 +0000)]
many systems don't have /etc/shadow but do have another system for
making encrypted passwords secret. For example, with secure NIS+ only
root can get the encrypted password.

hash in the encrypted password of "root" to provide a nice source of
secret on such systems. On systems that don't have this (ie. any user
can get roots encrypted password) then the security is so slack that
it probably doesn't matter what we do to generate the secret.

26 years agoimproved the secret buffer generation a bit. It now uses /etc/shadow
Andrew Tridgell [Tue, 21 Apr 1998 07:17:35 +0000 (07:17 +0000)]
improved the secret buffer generation a bit. It now uses /etc/shadow
and smbpasswd if possible, and doesn't put it all through a 32 bit
bottleneck.

26 years agoput server-side long dce/rpc code in main branch.
Luke Leighton [Tue, 21 Apr 1998 02:36:37 +0000 (02:36 +0000)]
put server-side long dce/rpc code in main branch.

26 years agoAdded cli_ulogoff() calls to all the exit code paths in security=server.
Jeremy Allison [Tue, 21 Apr 1998 02:27:12 +0000 (02:27 +0000)]
Added cli_ulogoff() calls to all the exit code paths in security=server.
Jeremy.

26 years agoclientgen.c: Added cli_ulogoff() call.
Jeremy Allison [Tue, 21 Apr 1998 02:23:24 +0000 (02:23 +0000)]
clientgen.c: Added cli_ulogoff() call.
password.c: Added call to cli_ulogoff on successfull sessionsetup.
Jeremy.

26 years agogenrand.c: Improved filename based random seed generation.
Jeremy Allison [Mon, 20 Apr 1998 23:57:29 +0000 (23:57 +0000)]
genrand.c: Improved filename based random seed generation.
lib/rpc/server/srv_netlog.c: Changed to use generate_random_buffer().
Jeremy.

26 years agoAdded 'passwd chat debug' parameter to allow admins to debug their
Jeremy Allison [Mon, 20 Apr 1998 23:07:28 +0000 (23:07 +0000)]
Added 'passwd chat debug' parameter to allow admins to debug their
Samba passwd chat scripts.
Jeremy.

26 years agoMakefile: Added genrand.o
Jeremy Allison [Mon, 20 Apr 1998 22:43:54 +0000 (22:43 +0000)]
Makefile: Added genrand.o
clientgen.c: Changed to fill change password buffer with random stuff.
password.c: Changed to get challenge from genrand.c
server.c: Added #ifdef around O_SYNC.
version.h: Changed to 1.9.19prealpha.
genrand.c:

   New code to generate (hopefully) good random numbers for
use in crypto challenges/session keys etc.

PLEASE REVIEW THIS CODE AND SUGGEST IMPROVEMENTS !!!!!!

Jeremy.

26 years agoFixed bug that John found in WINS server code. When nmbd as a WINS
Jeremy Allison [Mon, 20 Apr 1998 20:32:50 +0000 (20:32 +0000)]
Fixed bug that John found in WINS server code. When nmbd as a WINS
server is sending out a name_query after a WACK, it needs to send
a packet with recursion_desired = 0 (yes Luke, you were right all
along :-). If it doesn't then if it's talking to itself then the
query packet ends up back in the WINS server instead of in the client
side code.
Makefile: Changed proto generation to stop including NMBDOBJ twice.
nmbd_namequery.c nmbd_packets.c nmbd_winsserver.c: Added extra
query_name_from_wins_server() code.

Jeremy.

26 years agoincludes.h: Added John's redhat fix for QSORT_CAST.
Jeremy Allison [Sat, 18 Apr 1998 02:00:39 +0000 (02:00 +0000)]
includes.h: Added John's redhat fix for QSORT_CAST.
smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested.
           Fixed codedump problems in add_smbpwd_entry().
smbpasswd.c: Removed all the code that manipulated the password file
             directly. Now *all* smbpasswd file changes are done through
             the interfaces defined in smbpass.c This should make
             the life of people adding alternate backend databases
             *much* easier.
lib/rpc/server/srv_netlog.c: Removed debug messages used to debug
                             machine password changing.
Jeremy.

26 years agoclientgen.c: Changes 'cli_xxx_' calls to use the following
Jeremy Allison [Fri, 17 Apr 1998 22:44:01 +0000 (22:44 +0000)]
clientgen.c: Changes 'cli_xxx_' calls to use the following
regularized parameter syntax:

   setup, setup_count, max_setup_count,
   params, params_count, max_params_count,
   data, data_count, max_data_count,

(and if a reply is needed)

   *reply_params, *reply_data_len
   *reply_data, *reply_data_len

This allows the pointers and the lengths
that relate to these pointers to be next
to each other in the parameter list. This
makes seeing what you are passing to these
functions much easier to see.

Getting ready for adding the lib/rpc/client
functions needed to do security=domain.

torture.c: Fixed it so it uses / rather than \\
internally for the //machine/share syntax.

Jeremy.

26 years agoChanging of machine passwords now works !!!!!!
Jeremy Allison [Fri, 17 Apr 1998 19:29:51 +0000 (19:29 +0000)]
Changing of machine passwords now works !!!!!!
smbdes.c: Added cred_hash3.
smbpasswd.c: Fixes for adding a machine account (needs more work).
lib/rpc/server/srv_netlog.c: Turn on the machine password changing
code by default (calls cred_hash3).
Jeremy.

26 years agoJust changed the date.
Christopher R. Hertel [Fri, 17 Apr 1998 15:22:33 +0000 (15:22 +0000)]
Just changed the date.

26 years agoreply.c: Fix bugs where debug statements were accessing the fd_ptr struct
Jeremy Allison [Thu, 16 Apr 1998 19:23:10 +0000 (19:23 +0000)]
reply.c: Fix bugs where debug statements were accessing the fd_ptr struct
internals after Andrews' code had memset it to zero (this was causing core
dumps).
charcnv.c: Fixes for ISO8859-2 from Petr Hubeny <psh@capitol.cz>.
Jeremy.

26 years agoMinor change to the wording. It used to say "files with the prefix 'ubi_'"
Christopher R. Hertel [Thu, 16 Apr 1998 15:48:07 +0000 (15:48 +0000)]
Minor change to the wording.  It used to say "files with the prefix 'ubi_'"
or some such.  Some future files won't have the ubi_ prefix.  -)----- Chris

26 years agoipc.c: Fix for printer queue spinning with Win95.
Jeremy Allison [Wed, 15 Apr 1998 20:00:41 +0000 (20:00 +0000)]
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.

26 years agoFixed some typecast and function pointer problems pointed out by a
Christopher R. Hertel [Tue, 14 Apr 1998 14:43:38 +0000 (14:43 +0000)]
Fixed some typecast and function pointer problems pointed out by a
programmer in Finland.

Chris -)-----

26 years agoModified interfaces to getting smb password entries from
Jeremy Allison [Tue, 14 Apr 1998 00:41:59 +0000 (00:41 +0000)]
Modified interfaces to getting smb password entries from
get_smbpwd_entry (now an internal function to smbpass.c)
to a more UNIX-like :

getsmbpwnam() - get entry by name.
getsmbpwuid() - get entry by uid.

Changed the type returned by the smbpasswd enumeration
functions to be a void * so that people don't come to
depend on it being a FILE *.

These abstractions should make it much easier to
replace the smbpasswd file with a better backend
in future.

Other files changed are to match the above changes.

Jeremy.

26 years agomake it look for only the proper lines to uncomment.
Herb Lewis [Mon, 13 Apr 1998 23:39:43 +0000 (23:39 +0000)]
make it look for only the proper lines to uncomment.

26 years agoFixed aggregate initializer problem for gcc.
Jeremy Allison [Mon, 13 Apr 1998 23:27:22 +0000 (23:27 +0000)]
Fixed aggregate initializer problem for gcc.
Jeremy.

26 years agoChanges include:
Christopher R. Hertel [Mon, 13 Apr 1998 22:45:52 +0000 (22:45 +0000)]
Changes include:

proto.h:  The unusual.  ;)
reply.c:  I changes some function names, and updated reply.c to match.
          See mangle.c below for more.
server.c: Changed function names and parameters in file mangle.c, so
          changed server.c calls to match.  See mangle.c below for more.

mangle.c:

  I replaced the caching mechanism used for caching reverse mangled name
  maps.  The old method was a large array of 256-byte strings.  Movement
  in the stack (including push and pop) was done by memcpy()ing whole
  chunks of memory around.

  The new system uses the ubi_Cache module which, in turn, uses a splay
  tree.  Entries are dynamically allocated using a minimum amount of
  memory.  Searches are non-linear, which should speed things up a bit,
  too.  Overall, this should save memory and be faster.

  Other changes:  I streamlined the is_mangled() test and made other
  speed enhancements including replacing some static functions with
  macros.  Added comments, etc.

Note:  Per an E'mail conversation with Andrew, the 'mangled stack'
       parameter in smb.conf doesn't do anything anymore.  The cache is
       now set for 16K bytes maximum memory usage.  The mangle stack
       parameter is silently ignored.  This can easily be changed, but
       I'd rather introduce a 'mangled cache memory' parameter and
       remove 'mangled stack'.

Remaining problems:
       While testing the module, I noticed that something is calling
       name_map_mangle() twice.  The result is that names which contain
       illegal characters are getting mangled twice.

       Also, the entire module works by overwriting the input string.
       This has a variety of nasty side effects.

Summary:

  There's a lot still to be done, but the changes I have in place *should*
  work in exactly the same way (except for the mangle stack parameter).
  The rest of the bugs and other issues are separate.

Chris -)-----