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

1439 Commits

Author SHA1 Message Date
Andrew Bartlett
c28668068b A few things in this commit:
cleanup some of the code in net_rpc_join re const warnings and
fstrings.

Passdb:

Make the %u and %U substituions in passdb work.
This is done by declaring these paramters to be 'const' and doing
the substitution manually.  I'm told this is us going full circle,
but I can't really see a better way.

Finally these things actually seem to work properly...

Make the lanman code use the pdb's recorded values for homedir etc
rather than the values from lp_*()

Add code to set the plaintext password in the passdb, where it can
decide how to store/set it.  For use with a future 'ldap password
change' option, or somthing like that...

Add pdb_unix, so as to remove the 'not in passdb' special cases from the
local_lookup_*() code.  Quite small, as it uses the new 'struct passwd ->
SAM_ACCOUNT' code that is now in just one place.  (also used by pdb_smbpasswd)

Other:
Fix up the adding of [homes] at session setup time to actually pass
the right string, that is the unix homedir, not the UNC path.

Fix up [homes] so that for winbind users is picks the correct name.
(bad interactions with the default domain code previously)

Change the rpc_server/srv_lsa_nt.c code to match NT when for the
SATUS_NONE_MAPPED reply:  This was only being triggered on
no queries, now it is on the 'no mappings' (ie all mappings failed).
Checked against Win2k.

Policy Question:  Should SID -> unix_user.234/unix_group.364 be
considered a mapping or not?  Currently it isn't.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jim McDonough
1c9387330f Don't forget the semicolon, you fool! 0001-01-01 00:00:00 +00:00
Jim McDonough
85ab07bdc1 Fix usage of va_list passed as an arg. Use __va_copy before using it
when it exists.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e1daf816f3 Make Get_Pwnam use getpwnam_alloc() in an attempt to make it segfault rather
than allow silent reuse of stale static buffer.

Next step is to make this fn return that allocated buffer.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b04561d3fd This removes --with-ssl from Samba.
This option was badly maintained, useless and confused our users and
distirbutors.  (its SSL, therfore it must be good...)

No windows client uses this protocol without help from an SSL tunnel.

I can't see any reason why setting up a unix-side SSL wrapper would
be any more difficult than the > 10 config options this mess added
to samba in any case.

On the Samba client end, I think the LIBSMB_PROG hack should be
sufficient to start stunnel on the unix side.  We might extend this
to take %i and %p (IP and port) if there is demand.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jim McDonough
2605e483b3 Add __va_copy to talloc functions. talloc_asprintf was causing all kinds
of problems on Linux/390 systems...
0001-01-01 00:00:00 +00:00
Simo Sorce
2f30c2edfd move vsyslog() from snprintf.c to replace.c
tx Elrond for prosecuting cleanness :)
0001-01-01 00:00:00 +00:00
Jeremy Allison
2b49d727b0 NT uses NT_STATUS_OBJECT_NAME_NOT_FOUND not NT_STATUS_NO_SUCH_FILE for ENOENT.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6f2b76c239 We were mapping the open of name1/name2 where name1 wasn't a directory
(ie. ENOTDIR) to the NT status code NT_STATUS_NOT_A_DIRECTORY. NT seems
to use NT_STATUS_OBJECT_PATH_NOT_FOUND. I'm hoping this will fix the
access binaries served from a Samba share bug...
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
c26ce496e8 merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Gerald Carter
19b9b50d90 pidfile merge from SAMBA_2_2 (including --with-fhs) and a few other minor things; compiles and shouldnt break, but needs testing 0001-01-01 00:00:00 +00:00
Jeremy Allison
6d95792457 Merge in Jerry's called name fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
38fd99e841 patch from Alexander Bokovoy needed for dlopen on bsd systems 0001-01-01 00:00:00 +00:00
Jeremy Allison
1d66e53a64 We cannot set errno=0 in any of the wrapper calls as this breaks UNIX error
returns to the client.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
65742067e0 Fix different args to sys_fcntl without going varargs....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7adcc930ca Fixed one more sendto.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c7ff521bab Added sys_fcntl (not to be used everywhere). Added sys_read/sys_write
for transfer_file.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
64974fa334 Fixed sendto in oplock code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8cbc24c3bd Fix send and recvfrom.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
48475a7a69 First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
546764f3cb nicer strndup() function 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e8fbf853e0 make suure we get the return value from the pull_*() functions right
for both null terminated and buffer length terminated strings
0001-01-01 00:00:00 +00:00
Simo Sorce
18d5ffd835 sync with 2.2 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a538efe7d0 stricter conditions on termination in strings
this was a very nasty bug with filename corruption and NT4 clients. The
exact termination conditions are quite critical ...
0001-01-01 00:00:00 +00:00
Simo Sorce
415f9d92bc Fix incorrect zpadlen handling in fmtfp.
Thanks to Ollie Oldham <ollie.oldham@metro-optix.com> for spotting it.
few mods to make it easier to compile the tests.
addedd the "Ollie" test to the floating point ones.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dbc6b137a8 fixed the handling of STR_TERMINATE 0001-01-01 00:00:00 +00:00
Andrew Tridgell
bac0093a97 i forgot to commit these parts of the string handling patch earlier. Sorry. 0001-01-01 00:00:00 +00:00
Tim Potter
0e3be3603e Merge of comment fix. 0001-01-01 00:00:00 +00:00
Tim Potter
3b6df44ddc Fixed incorrect debug. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
0bdd94cb99 Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly
enumerate its trusted domains - by exaimining the keys in the secrets.tdb file.

This patch has been tested with both NT4 and rpcclient/wbinfo, and adds
some extra functionality to talloc and rpc_parse to allow it to deal with
already unicode strings.

Finally, this cleans up some const warnings that were in net_rpc.c by pushing
another dash of const into the rpc client code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5275c94cdf Better handling of uid/gid -> RID and RID -> uid/gid code.
All uids and gids must create valid RIDs, becouse other code expects this, and
can't handle the failure case. (ACL code in particular)

Allow admins to adjust the base of the RID algorithm, so avoid clashes with
users brought in from NT (for example).

Put all the algorithm code back in one place, so that this change is global.

Better coping with NULL sid pointers - but it still breaks a lot of stuff.

BONUS: manpage entry for new paramater :-)

counter based rids for normal users in tdbsam is disabled for the timebeing,
idra and I will work out some things here soon I hope.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
cvs2svn Import User
1c221b3e72 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7e92fb7453 added strndup() for systems that don't have it 0001-01-01 00:00:00 +00:00
Andrew Tridgell
bb173c1a7e this adds a completely new hash based mangling scheme
the hash for this scheme is *much* larger (approximately 31 bits) and
the code is written to be very fast, correctly handling multibyte
while not doing any actual multi-byte conversions in the vast majority
of cases

you can select this scheme using "mangling method = hash2", although I
may make it the default if it works out well.
0001-01-01 00:00:00 +00:00
Tim Potter
2bf6595a2a Also look for libinsure.so where the full version installs it. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e5c3648fe7 cope with a missing PAM define 0001-01-01 00:00:00 +00:00
Jeremy Allison
74eac41c68 Added sys_adminlog() system for info the appliance admins really
need to know about. Different from the DEBUG system.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ac1baba35d Removed HAVE_LIBDL from most places (except system.c). Added checks for
dlopen & friends into configure.in. This should help building on *BSD
where dl*** calls are in libc.
Jeremy
0001-01-01 00:00:00 +00:00
Jeremy Allison
ea60c50109 Allow hosts allow/deny to use xx.xx.xx.xx/yy syntax.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9fb6a47526 In msleep - never sleep for more than 1 second. Cope with time changes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e144c174ea Moved debug messages for grabbing/releasing mutex.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1b9f1a368f Don't hold the mutex for more than 20 seconds.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
619397cc90 OpenPrinter() merge from 2.2 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ce7990b4a4 add {push,pull}_ucs2{allocate,talloc}() functions.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
a5ac2ac4ad Spelling fixes. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
41dd5a4d29 Make a number of the lookup tables 'const'. I'm told this assists in sharing
memory between users of shared libs.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
20f6f9e3a2 Update some of the DEBUG()s in Get_Pwnam_internal()
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
9ab144810e Patch from Hasch@t-online.de (Juergen Hasch) to add allocate and talloc
push/pull utf8 functions.  To be used for international ADS support.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
3b1b8ac435 Fix the mp3 rename bug - also tidy up our open code and remove the special
cases for rename and unlink. Had to add desired_access into the share mode record.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
e66bdf1229 Stomped on some header file version numbers that have crept back in. 0001-01-01 00:00:00 +00:00
Herb Lewis
6fa09ee881 must use native endian index when creating default valid.dat table so it
is the same on big and little endian systems.
0001-01-01 00:00:00 +00:00
Martin Pool
098905bea2 Add assertions that kill() is never accidentally passed a non-positive
pid.  This follows a bug in rsync where it would accidentally
kill(-1), removing all the user's processes.  I can't see any way this
would directly happen in Samba, but having the assertions seems
beneficial.

http://cvs.samba.org/cgi-bin/cvsweb/rsync/util.c.diff?r1=1.108&r2=1.109&f=h
0001-01-01 00:00:00 +00:00
Jeremy Allison
ad1e858d8e Sync up vfs changes from 2.2.x.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
9836af7cd6 more verbose checking in talloc and util_pw
fixed tdbsam memory corruption (and segfault)
reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules.
0001-01-01 00:00:00 +00:00
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ad9965414d lower the debug level of failing to map a file 0001-01-01 00:00:00 +00:00
Gerald Carter
5760315c1d syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
0001-01-01 00:00:00 +00:00
Tim Potter
a3cea5e9ae getpid() -> sys_getpid() 0001-01-01 00:00:00 +00:00
Jeremy Allison
bcf38961a7 Add "Creator Group" - was in 2.2.x and I'm syncing up the two.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
58c1b11439 Fix typo. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3db97530b6 add a note about the meaning of global_sam_sid 0001-01-01 00:00:00 +00:00
Tim Potter
b9ab79f30a Doc. 0001-01-01 00:00:00 +00:00
Herb Lewis
e5d80779a3 fixed the upper/lower case table generation on big-endian machines
(tridge, using Herbs console)
0001-01-01 00:00:00 +00:00
Jeremy Allison
d2af6382b4 dos2unix not used in HEAD anymore.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
ba2570f518 Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants.
patch by Hasch@t-online.de (Juergen Hasch)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2a30960276 This should kill off the 'cannot convert' error messages on non-iconv hosts. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
85974e6c43 Make this function static 0001-01-01 00:00:00 +00:00
Jeremy Allison
330b0df960 bcopy must DIE ! Stop people creeping use of bcopy back into the code
(and yes I know who you are..... :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8220135fd1 Only set smb_read_error if not already set.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5aed3759d8 Thanks to David Edward Shapiro <David.Edward.Shapiro@btitele.com> for spotting
this!

(groupname and domain name paramaters swapped, giving 'interesting' results...)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
fa9d3060ff Patch from Hasch@t-online.de (Juergen Hasch) to add UTF-8 as an explict
character set for conversion.  To be used in Winbind and the 'net ads'
commands.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Tridgell
eb196070e6 serialise all domain auth requests
this is needed because W2K will send a TCP reset to any open
connections that have not done a negprot when a second connection is
made. This meant that under heavy netlogon load a Samba domain member
would fail authentications.

Jeremy, you may wish to port this to 2.2.x
0001-01-01 00:00:00 +00:00
Andrew Tridgell
569505b771 reverted tims patch that broke configure
why does anything but smbd care about sec_init() anyway??
0001-01-01 00:00:00 +00:00
Tim Potter
e7abb79fb3 Whoops, typo. 0001-01-01 00:00:00 +00:00
Tim Potter
1b941e2c63 Do a smb_panic() if sec_initial_[ug]id() or non_root_mode() is called
without before sec_init().  This should avoid the formation of another
magic function club.  (-:
0001-01-01 00:00:00 +00:00
Tim Potter
5efe39af0c int -> uint32 0001-01-01 00:00:00 +00:00
Martin Pool
b6d5d02aa1 Back out 1.16.2.3:
receive_smb: You might think that we ought to set smb_read_error here,
but apparently that breaks the recursive main loop in oplock.c.
Global variables suck. :-/
0001-01-01 00:00:00 +00:00
Andrew Bartlett
542e0e3745 Try to get this finally working. (Note to self: *always* check build farm...)
:-)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
59afc3d6da See if we can get slightly valid C for the non-PAM case here.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
dc1a72f896 Drastic impromvents to pam_winbind.
This adds code to do generic PAM -> NTSTATUS and NTSTATUS -> PAM error
conversions, and uses them to make the error handling in pam_winbind sane.

In particular, pam_winbind now uses PAM error codes, not silly '-1, -2 ...'
stuff, and logs the NTSTATUS error that winbind now sends over the pipe.

Added code to wbinfo to display these - makes a big difference in debugging
winbindd.

The main change here is the code to allow pam_winbind password changing to
correctly stack - This code ripped from pam_unix, and the copyright attached.
(Same as for all pam modules, including pam_winbind)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
d1e911afd0 Fix stupid typo !
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
e3bb686745 better debug messages! 0001-01-01 00:00:00 +00:00
Jeremy Allison
3af16ade17 Fix from Michael Steffens <michael_steffens@hp.com> to make signal
processing work correctly in winbindd. This is a really good patch
that gives full select semantics to the Samba modified select.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9930cf9733 this fixes the problem of not being able to add a SD to a file on a
non-domain Samba server from a NT4 client.

Note that this exactly reverses a change by Jeremy on the 18th of
December 2001, reverting the code back to what JF originally wrote. I
have looked carefully with a sniffer and JFs original NULL sid is
correct (ie. it matches what NT4 does) and also fixes the problem.

Sending a blank sid (which is what jeremy's patch did) causes NT4 to
give a classic "parameter is incorrect error" and prevents the
addition of new ACLs.
0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Simo Sorce
a034bfb9ef minor fix and checks 0001-01-01 00:00:00 +00:00
Andrew Bartlett
f1d8d50976 Some more 'winbind default domain' support patches from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

This patch is designed to remove the 'special cases' required for this support.

In particular this now kills off winbind_initgroups, as it appears no longer to
be required.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
151dd7bc6c Bring this code into line with new winbind_lookup_name() interface. I think
this might need a bit more work - or at least documentation.

This is certainly a worthwile little hack, as it avoids the need to invert the
group database.  I don't think we should allow unqualified domains here - as
that allows us to distinguish between (at least some) usernames and these
'special' groups.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
a41fe2f6c8 Remove the 'direct to winbind' hacks, as they should (if I understand
correctly) be no longer needed.  This is in aid of the 'winbind default domain'
code - which works much better when smbd always goes via the standard unix
interfaces.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
873dba59cf picky about realloc
J.F.
0001-01-01 00:00:00 +00:00
Simo Sorce
04f492980b minor fixes 0001-01-01 00:00:00 +00:00
Andrew Bartlett
f556ad67e8 getpwnam -> getpwnam_alloc.
idra has promised not to revert these this time :-)
0001-01-01 00:00:00 +00:00
Martin Pool
7f7d22880d We have to do some initialization before the string conversion
routines can work.  The code was copied into both convert_string and
convert_string_allocate -- I split it into a little static function,
and removed an apparently duplicate call to init_valid_table().
0001-01-01 00:00:00 +00:00
Tim Potter
e05c9b34f0 Added comment about running lp_load() before calling pidfile_create(). 0001-01-01 00:00:00 +00:00
Tim Potter
025a0ea8ba Having a const parameter for set_socket_options() causes too much confusion. 0001-01-01 00:00:00 +00:00
Jeremy Allison
61b4ce7aef Removed freebsd hack. Not correct.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
6380f9ff7a Spelling fix. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
8ef13cabdd This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets
and the matching operations inside smbd's RPC components.

This patch is designed for no change in behaviour, and my tests hold that to be
true.  This patch does however allow for the future loadable modules interface
to specify function pointers in replacement of the fixed state.

The pipes_struct has been split into two peices, with smb_np_struct taking the
information that should be generic to where the data ends up.

Some other minor changes are made: we get another small helper function in
util_sock.c and some of the original code has better failure debugs and
variable use. (As per on-list comments).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e870f0e727 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
997d6687fc Readline has problems on non tty fd's. Use readline replacement to in cases
where stdin is !isatty to allow stripts to work.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
80df5ab07e Added #ifdef for FreeBSD TCP bug.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
6b123adda9 fixes (asprintf) from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
478696e924 If 127.0.0.1 matches both allow & deny then allow. Patch from Steve Langasek vorlon@netexpress.net
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
07a21fcd23 This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.

This 'corrects' that - but is not without its own problems.

As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.

The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.

I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.

As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.

(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1d86c7f942 A nice *big* change to the fundemental way we do things.
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps
them around for a long time - often past the next call...

This adds a getpwnam_alloc and a getpwuid_alloc to the collection.

These function as expected, returning a malloced structure that can be
free()ed with passwd_free(&passwd).

This patch also cuts down on the number of calls to getpwnam - mostly by
taking advantage of the fact that the passdb interface is already
case-insensiteve.

With this patch most of the recursive cases have been removed (that I know
of) and the problems are reduced further by not using the sys_ interface
in the new code.  This means that pointers to the cache won't be affected.
(This is a tempoary HACK, I intend to kill the password cache entirly).

The only change I'm a little worried about is the change to
rpc_server/srv_samr_nt.c for private groups.  In this case we are getting
groups from the new group mapping DB.  Do we still need to check for private
groups?  I've toned down the check to a case sensitve match with the new code,
but we might be able to kill it entirly.

I've also added a make_modifyable_passwd() function, that copies a passwd
struct into the form that the old sys_getpw* code provided.  As far as I can
tell this is only actually used in the pass_check.c crazies, where I moved
the final 'special case' for shadow passwords (out of _Get_Pwnam()).

The matching case for getpwent() is dealt with already, in lib/util_getent.c

Also included in here is a small change to register the [homes] share at vuid
creation rather than just in one varient of the session setup.  (This picks
up the SPNEGO cases).  The home directory is now stored on the vuid, and I
am hoping this might provide a saner way to do %H substitions.

TODO:  Kill off remaining Get_Pwnam_Modify calls (they are not needed), change
the remaining sys_getpwnam() callers to use getpwnam_alloc() and move
Get_Pwnam to return an allocated struct.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
c1b97226db Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0fcca6c627 Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
16fcbf3c1c Fixup error mapping so we have only one table containing errno -> dos error -> NT STATUS
maps. Fixes problem with disk full returning incorrect error.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
cee0ec7274 Roll back PSTRING_SANCTIFY patch; just leave non-controversial type
and constness changes.
0001-01-01 00:00:00 +00:00
Martin Pool
bf513668cb #ifdef variable that's not used without dmalloc 0001-01-01 00:00:00 +00:00
Martin Pool
8d106dc1f4 Add constness to filenames passed to functions. 0001-01-01 00:00:00 +00:00
Martin Pool
682e7cd394 FIXME We should turn the global list off when using Insure++,
otherwise all the memory will be seen as still reachable.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7417d6f931 A couple of coding syle updates to follow the re-indent. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
e20d69d518 Re-indent these two functions to make it actually possible to understand their
contents...

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e6a3a01f79 I'm doing some things towards the NamedPipes game with lckl and he has asked me
to move this from being a static to matching its mate in lib/util_sock.c.

In any case, this should discorage anybody from using the 'wrong' version of
this function.  (ie the one from TNG, which needs a bit more error checking
depending on use).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
2603ab3c68 Round and round we go....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
24ee18c77e Latest attempt at changeid.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
01ff6ce496 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
85d3ffb270 Spelling fix. 0001-01-01 00:00:00 +00:00
Jeremy Allison
6210d4aa19 Getting ready to add UNIX extensions in HEAD also.
Jeremy
0001-01-01 00:00:00 +00:00
Martin Pool
bcb443c5c4 Add two more memory-debug smbcontrol messages: these ones should
prompt dmalloc to log information about what happening, so you can see
in flight why smbd is getting bloated.
0001-01-01 00:00:00 +00:00
Martin Pool
3ef135e91a Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.

msg_pool_usage: assert msg_type is as expected.
0001-01-01 00:00:00 +00:00
Martin Pool
a823e3f8b2 Add harmless parentheses so that dmalloc doesn't get confused by a
variable called 'free'.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ec71f1732b Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
0001-01-01 00:00:00 +00:00
Herb Lewis
39d6b31e14 merge changes from 2.2 branch to prevent smb.conf from changing debug level
of commands when specified on command line.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
08bb2dfec2 simple fix for creating blank data blobs 0001-01-01 00:00:00 +00:00
Andrew Bartlett
207ee8aac4 Add a talloc varient of the data_blob functions.
Also change the structure so it has its own (optional) 'free' pointer - so we
don't free() a talloc'ed version.

also split out the data_blob_clear() functionaility.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
a0cdec3acc Fixed nasty cast of tdb_delete in traversals.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8aee8211cd Don't use static memory, malloc it...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
73cf9d04f6 Fix the fix.... (sigh).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b52c3219d6 Fixed embarressing 16k strack trashing bug :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
4877501da9 Make talloctort call talloc_describe_all before exiting 0001-01-01 00:00:00 +00:00
Martin Pool
86abefc172 Cope nicely with pools with no name. 0001-01-01 00:00:00 +00:00
Martin Pool
cd25d01e42 talloc accounting now includes number of chunks and bytes allocated. 0001-01-01 00:00:00 +00:00
Martin Pool
7cb8e95f93 Send back talloc allocation information when POOL_USAGE is received. 0001-01-01 00:00:00 +00:00
Martin Pool
53723e8748 Add talloc_asprintf_append, which grows an existing string buffer to
contain new print-formatted information.  (Also
talloc_vasprintf_append.)  Idea borrowed from glib.
0001-01-01 00:00:00 +00:00
Martin Pool
9b217dce7f smbd now sends a reply to MSG_REQ_POOL_USAGE, though it's pretty
boring so far.
0001-01-01 00:00:00 +00:00
Martin Pool
830a126a44 smbd should register to receive MSG_REQ_POOL_USAGE. Response should
be information about memory usage, but this is not done yet.
0001-01-01 00:00:00 +00:00
Martin Pool
53dd8b4539 If we receive a message that is not handled then emit a gentle warning
to the log.
0001-01-01 00:00:00 +00:00
Martin Pool
6bd5b7ce8e debug output on receipt of message. 0001-01-01 00:00:00 +00:00
Simo Sorce
c0904d9617 const religion 0001-01-01 00:00:00 +00:00
Andrew Tridgell
65e857b36e more irix -64 portability fixes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
48aa90c48c - portablitity fixes for cc -64 on irix
- fixed gid* bug in rpc_server
0001-01-01 00:00:00 +00:00
Simo Sorce
ce7e89949a freeing the wrong pointer, sorry my mistake. 0001-01-01 00:00:00 +00:00
Simo Sorce
49f5cb7a3d util_sid.c - respect a const variabile (addedd strdup)
cli_reg.c  - indentation
pdb_ldap.c - some checks on init fns parameters
pdb_tdb.c  - some checks on init fns parameters + make sure we close the db on failure
0001-01-01 00:00:00 +00:00
Andrew Tridgell
da353bc539 fixed a typo in vsyslog() 0001-01-01 00:00:00 +00:00
Martin Pool
22e510ea0d Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
cc6c263993 fixed warnings on irix and crash bug on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0cfd0a5e54 much better auto-init of valid_table[]. This should just about remove
the need for valid.dat
0001-01-01 00:00:00 +00:00
Andrew Tridgell
85f04fa61d mark '.' as a valid character 0001-01-01 00:00:00 +00:00
Martin Pool
e76d27fcdb Add --enable-dmalloc to link against the dmalloc malloc debugger.
It's not as strong as Insure, but it's free, reasonably efficient and
works on every platform.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ab2e55cdb3 Added AC_CHECK_FUNCS(syslog vsyslog).
nsswitch code uses vsyslog without checking for it.
Provide replacement for vsyslog in lib/snprintf if not found by configure.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c11c27b281 fixed sid_compare_domain() 0001-01-01 00:00:00 +00:00
Martin Pool
a7b052d991 Use less memory, but scribble all over it, just in case there's
something wrong with the way it's allocated.
0001-01-01 00:00:00 +00:00
Martin Pool
e2b080587c Doc how to reply to messages. 0001-01-01 00:00:00 +00:00
Martin Pool
4c6c03c8c7 Make TALLOC_CTX and talloc_chunk private to talloc.c.
Add a global singly-linked list of all active talloc pools, so that we
can eventually show how much memory is used for different purposes.
This also gives a check that pools are not being doubly freed.

talloc_init_named now handle a NULL name properly (ie does nothing)

Add accessor talloc_pool_name().
0001-01-01 00:00:00 +00:00
Martin Pool
7da982e926 Doc 0001-01-01 00:00:00 +00:00
Martin Pool
5dc2827b6e Doc 0001-01-01 00:00:00 +00:00
Martin Pool
e6be48671d Put PRINTF_ATTRIBUTE on talloc_init_named, talloc_asprintf,
talloc_vasprintf.
0001-01-01 00:00:00 +00:00
Martin Pool
5b6c22a209 Doc. 0001-01-01 00:00:00 +00:00
Martin Pool
25b97a7435 Start adding some debugging features to talloc based on Samba's
ancient mem_man.c:

Each TALLOC_CTX now has a field to store its purpose, to aid in
tracking down memory bloat.  A new call talloc_init_named() should be
used instead of talloc_init() so that this is set.

Added talloc_vasprintf to be called by varargs functions.
0001-01-01 00:00:00 +00:00
Martin Pool
e339066995 Add a very trivial talloc torture program, bin/talloctort. Not built
by default.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7b8fb8d85c Fixup JF's weird SID return :-).
Jeremy
0001-01-01 00:00:00 +00:00
Tim Potter
c15dec74a3 A fix to override the location of a user's home directory if it is
specified in the [homes] section of the smb.conf file.

Jeremy, can you take a look at this?  This is in response to someone on the
samba mailing list worrying about it.


Tim.

From: Phil Thompson <philnanne@mediaone.net>
To: samba@lists.samba.org
Subject: Different [homes] behavior in 2.2.2
X-Original-Date: Mon, 17 Dec 2001 23:09:28 -0500


Is it possible to configure samba to disregard the home directory in the
passwd file when using [homes]?  Even though an alternate "path" is set
in [homes], the service fails since the unix home directory is invalid
(nonexistent) on the server.

[...]

This behavior of validating the user's home dir as set in the passwd
files appears to be new
in 2.2.2 and the latest CVS. Anyway to work around this?
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c44f4e9e33 tidy up debug
J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
505a1bdd15 obey "use mmap" on case tables 0001-01-01 00:00:00 +00:00
Jeremy Allison
6d03184f8c Added HPUX ACL code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
59e01a22c5 Added the group enum code from 2.2
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
d0614b2e66 I see no reasons why we should limit username lenght while checking
see bug 22130

jeremy, probably this should be fixed also in 2_2
0001-01-01 00:00:00 +00:00
Martin Pool
a4cc69d945 Explain why snprintf has to be overridden in this way. 0001-01-01 00:00:00 +00:00
Tim Potter
62dfda654b Typo spotting. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a6d297686 make sid_binstring available without HAVE_ADS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fa1e7a62ac add smb_xvasprintf() panic wrapper around vasprintf 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
fef52c4b96 again an intrusive patch:
- removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the
definition of standard_sub_basic() to cope with that.

- removed the smb.conf: 'domain admin group' and 'domain guest group'
parameters ! We're not playing anymore with the user's group RIDs !

- in get_domain_user_groups(), if the user's gid is a group, put it first
in the group RID list.

I just have to write an HOWTO now ;-)

        J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2b2155beae fixed an off by 1 bug in talloc_asprintf() 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
6c87e96149 added a boolean to the group mapping functions to specify if we need or
not the privileges. Usually we don't need them, so the memory is free
early.

lib/util_sid.c: added some helper functions to check an SID.

passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass
an RID all the way. If the group doesn't exist on the domain SID,
don't return a faked one as it can collide with a builtin one. Some rpc
structures have been badly designed, they return only rids and force the
client to do subsequent lsa_lookup_sid() on the domain sid and the builtin
sid !

rpc_server/srv_util.c: wrote a new version of get_domain_user_groups().
Only the samr code uses it atm. It uses the group mapping code instead of
a bloody hard coded crap. The netlogon code will use it too, but I have to
do some test first.

	J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e908f304a2 moved init_account_policy() to the right place 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ea5d285721 const religion in talloc calls 0001-01-01 00:00:00 +00:00
Jeremy Allison
5215bcca15 winbindd friendly user_in_list code. Tested on a 65k user domain.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
708c0a8d16 Moved name_is_local to the correct place. Ooops.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8d41dfd149 Tidyup of lib/username. Add name_is_local fn to determine if name is
winbindd. Getting ready for efficiency fix in group lookups.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bc28a8eebd added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain

we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?

alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)

        J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
789833b44e put sid_to_name behind the winbindd backend interface
I spent quite a while trying to work out how to make this call
via ldap and failed. I then found that MS servers seem use rpc
for sid_to_name, and it works even when in native mode, I ended
up just implementing it via rpc
0001-01-01 00:00:00 +00:00
Andrew Tridgell
88241cab98 added a basic ADS backend to winbind. More work needed, but at
least basic operations work
0001-01-01 00:00:00 +00:00
Andrew Tridgell
21a366afbe re-enabled insure backtrace, calling /usr/bin/backtrace 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0216b0fca1 The beginnings of alternative backends for winbindd
This just splits off the dispinfo call behind a methods structure.
I'll split off a few more functions soon, then we will be ready for
LDAP replacement methods
0001-01-01 00:00:00 +00:00
Tim Potter
9712d3f15a Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
0001-01-01 00:00:00 +00:00
Jeremy Allison
518084a70d Ensured the %G substitution exactly matches what the man page states.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
624cb28271 fixed typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e6004062a5 fixed toupper_w() and friends on big-endian
this fixes the core dumps on sparc
0001-01-01 00:00:00 +00:00
Andrew Tridgell
80841f5763 2nd attempt at fixing lame char tables on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
568425709d fixed lame char tables on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
23ef22f117 fixed some krb5 ifdefs 0001-01-01 00:00:00 +00:00
Gerald Carter
c60aa6c06f merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8698f7ef3e turn off the insure xterm hack for now 0001-01-01 00:00:00 +00:00
Andrew Tridgell
91bc14f430 allow printing of NULL pointers with internal snprintf 0001-01-01 00:00:00 +00:00
Andrew Tridgell
96224fe2d4 reverted incorrect patch 0001-01-01 00:00:00 +00:00
Tim Potter
778f5f77a6 Got medieval on another pointless extern. Removed extern struct ipzero
and replaced with two functions:

	void zero_ip(struct in_adder *ip);
	BOOL is_zero_ip(struct in_addr ip);
0001-01-01 00:00:00 +00:00
Andrew Tridgell
058a5aee90 added "net join" command
this completes the first stage of the smbd ADS support
0001-01-01 00:00:00 +00:00
Martin Pool
a875b3a6e7 More better now. 0001-01-01 00:00:00 +00:00
Martin Pool
6ddd8e7bf6 Quieten gcc const warning.
doxyfy.
0001-01-01 00:00:00 +00:00
Tim Potter
039ea0a0b9 Don't initialise static pointers to NULL. 0001-01-01 00:00:00 +00:00
Tim Potter
8fc772c9e5 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
0001-01-01 00:00:00 +00:00
Jeremy Allison
694372b2c4 Merged in JohnR's ping messaging extension.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
233fe71fbb added strlcpy() and strlcat() 0001-01-01 00:00:00 +00:00
Jeremy Allison
48a848f748 We don't actually use the horror that was lib/util_array.c :-).
More deleted code - hurrah !
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
32480d7aff Rename xmalloc, xmemdup, xstrdup to smb_$1 to avoid conflicts with the
versions defined by libreadline on SCO (!).
0001-01-01 00:00:00 +00:00
Martin Pool
2c1e68d4ce Fix typo. 0001-01-01 00:00:00 +00:00
Martin Pool
b792c9317a Detect libreadline>=4.0, and set HAVE_NEW_LIBREADLINE. At the moment
this is only to get the cast right, but it might help with other parts
of the API that changed later.
0001-01-01 00:00:00 +00:00
Tim Potter
dfaafcd622 Added comment about why not to cast the assignment of
rl_attempted_completion_function to rl_completion_function_t.
0001-01-01 00:00:00 +00:00
Martin Pool
868999ad3c LIBDIR and LOCKDIR are dynamically configured too. 0001-01-01 00:00:00 +00:00
Martin Pool
c4b44cfc3f Oops, Tim says rl_completion_func_t doesn't exist in all versions of
readline.
0001-01-01 00:00:00 +00:00
Martin Pool
d0a0d27caa Quieten compiler warnings about a callback function prototype that has
changed in recent versions of Readline.
0001-01-01 00:00:00 +00:00
Simo Sorce
37edaeddce fixed some bugs. 0001-01-01 00:00:00 +00:00
Jeremy Allison
d70674312d Fixed detection of RedHat headers. Removed another file !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6bf2505cce I *love* removing code :-). Removed 4 files that weren't being used.
All this stuff was being pulled in due to *one* unneeded call to
fetch a domain SID which smbpasswd already puts in the database...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a7b45bfb71 Tidyups in the merge process.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
7c6529c081 FALSE -> False 0001-01-01 00:00:00 +00:00
Tim Potter
c8c7da237d Removed unused variable. 0001-01-01 00:00:00 +00:00
Jeremy Allison
763fd1c787 Look for DOMAIN\group in group lists and ask winbind.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
023514a0b6 messed up with patches, this should be the right one,
sorry
0001-01-01 00:00:00 +00:00
Simo Sorce
8bb5cb27c2 some bugfix and new functions,
modified mangle.c to use mosltly acnv_????() functions.
this should make also build farm happy
0001-01-01 00:00:00 +00:00
Simo Sorce
64dde3b64f fixed, moved and added some functions
note the useful acnv_uxu2 and acnv_u2ux functions in charcnv.c
0001-01-01 00:00:00 +00:00
Simo Sorce
8b494b0be3 add convert_string_allocate() function 0001-01-01 00:00:00 +00:00
Tim Potter
4f21ddb873 Removed totally annoying verbose debug in sid_to_string() 0001-01-01 00:00:00 +00:00
Jeremy Allison
16c5d279b9 Added missing strchr_wa.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
ee19f7efb6 a big one:
- old mangle code has gone, the new one based on tdb seem resonably ok
   probably the valid.dat table need to be updated to treat wild chars as
   invalid ones (work ok without it)
 - a LOT of new string manipulation function for unicode, they are somewhat
   tested but a review would not be bad
 - some new function I will need for the new unix_convert function I'm writing,
   this will be renamed filename_convert and use only unicode strings.
 - charconv, I attached a comment, if someone wnat to look if I'm right or
   just was hacking to late in the night to make a sane one :)

of course any bug is my responsibility an will be pleased to see patches if
you find any. :-)

Simo.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5dd3c7b3fb remove {} from default valid char list 0001-01-01 00:00:00 +00:00
Jeremy Allison
ee5e7ca547 Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
eeaa80aa09 zero the data, not a pointer to the data ... 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3b5e72bda3 Small 'const' updates ahead of some AuthRewrite merging. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
0c8e9339d8 Parionia to ensure people don't install libsmb based programs setuid root.
libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing
all sort of fun and games.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b02ed7ee19 Add a bit of 'const' for the data_blob code.
Add a new data_blob_clear_free() function - that zero's out the buffer
when its done.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f019bed766 More spelling and grammer from Vance. <vance@digital-host.net>
Thanks!

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c95f5aeb93 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e7634f81c5 This commit is number 3 of 4.
In particular this commit focuses on:

Changing the Get_Pwnam code so that it can work in a const-enforced
environment.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for 'const' in the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8f607810eb This commit is number 2 of 4.
In particular this commit focuses on:

The guts of the moving about inside passdb.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for the introduction of  a large dose of 'const' to
the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

passdb/

	- Kill off disp_info stuff, it isn't used any more - Kill off
	support for writing to the old smbpasswd format, it isn't relevent
	to Samba 3.0

	- Move around and modify the pdb_...() helper functions, adding
	one that sets the last changed  time to 'now' and that sets the
	must change time appropriately.

	- Remove the ugly forced update of the LCT- value in
	pdb_smbpasswd.  - Remove the implicit modification of the ACB
	flags when both NT and LM passwords are set.

	- Removed substation in pdb_getsampwnam output, as a single
	password change will render them  inoperable in any case (they
	will be substituted and stored)

	- Added a default RID to the init_sam_from_pw() function, based on
	our rid algorithm.

	- Added checks that an smbpasswd stored user has a uid-based RID.

	- Fail to store tdb based users without a RID

lib/
    - Change the substituion code to use global_myname if there is
      no connection (and therefore no called name) at the present time.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5a4d22dd66 smbd/notify_hash.c: Merged Herb's fix.
lib/debug.c: Fix for potential null pointer access.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5fda15463a A few spelling fixes from Vance. <vance@digital-host.net>
Thanks!
0001-01-01 00:00:00 +00:00
Jeremy Allison
57b8e6d742 Added || -> && fix from "Orwig, Paul" <PORWIG@PacificLife.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
ef06de2a1c Removed unused function. 0001-01-01 00:00:00 +00:00
Herb Lewis
51cb4411df get rid of compiler warnings (casts and delete unused variables) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f919b4360 a quick fix to get rpcclient working again. This just disables
NTLMSSP in cli_establish_connection()

What we really need to do is kill off the pwd_cache code. It is horrible,
and assumes the challenge comes in the negprot reply.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d01a9e5974 Added xstrdup, removed static version from smbpasswd.c
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2cc262278f Added xmalloc - calls smb_panic on zero size or malloc fail.
Added xmemdup - calls xmalloc.
Made data_blob() call xmemdup.
Defensive programming (I still hate the no error checking... :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
b16a15a13e Converted a bunch of 0x85 constants to SMBkeepalive. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9355f25165 removed an unused variable 0001-01-01 00:00:00 +00:00
Jeremy Allison
d8262286dd Merge Gerry's %G change from 2.2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b74fda69bf added basic NTLMSSP support in smbd. This is still quite rough, and
loses things like username mapping. I wanted to get this in then
discuss it a bit to see how we want to split up the existing
session setup code
0001-01-01 00:00:00 +00:00
Andrew Tridgell
acd84ed762 return of vsnprintf doesn't include termination
thanks to simo for spotting this
0001-01-01 00:00:00 +00:00