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

69 Commits

Author SHA1 Message Date
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52)
2002-08-17 17:00:51 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
bffc4efd0f Merge of comment fix.
(This used to be commit 0e3be3603e)
2002-04-15 03:46:30 +00:00
Andrew Bartlett
d6d9d6debd Update some of the DEBUG()s in Get_Pwnam_internal()
Andrew Bartlett
(This used to be commit 20f6f9e3a2)
2002-03-23 08:40:15 +00:00
Andrew Bartlett
f8711444cf Make this function static
(This used to be commit 85974e6c43)
2002-02-27 11:47:33 +00:00
Andrew Bartlett
5294b48bb8 Thanks to David Edward Shapiro <David.Edward.Shapiro@btitele.com> for spotting
this!

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

Andrew Bartlett
(This used to be commit 5aed3759d8)
2002-02-20 21:36:12 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Andrew Bartlett
7b671e34f5 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
(This used to be commit f1d8d50976)
2002-01-27 12:12:22 +00:00
Andrew Bartlett
670f46fd4c 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.
(This used to be commit 151dd7bc6c)
2002-01-26 10:10:25 +00:00
Andrew Bartlett
1fb9ccc4e2 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
(This used to be commit 07a21fcd23)
2002-01-18 02:37:55 +00:00
Andrew Bartlett
c311d24ce3 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
(This used to be commit 1d86c7f942)
2002-01-17 08:45:58 +00:00
Jeremy Allison
08019e8a33 Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
(This used to be commit c1b97226db)
2002-01-16 23:53:10 +00:00
Jeremy Allison
5cf6457bcc Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
(This used to be commit 0fcca6c627)
2002-01-16 23:32:10 +00:00
Andrew Tridgell
93d458c5f6 fixed warnings on irix and crash bug on big endian machines
(This used to be commit cc6c263993)
2001-12-20 10:02:30 +00:00
Tim Potter
f0e8a3d5e8 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?
(This used to be commit c15dec74a3)
2001-12-18 06:11:32 +00:00
Jeremy Allison
43e325d991 Added the group enum code from 2.2
Jeremy.
(This used to be commit 59e01a22c5)
2001-12-14 21:51:09 +00:00
Simo Sorce
ee33b2d3e2 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
(This used to be commit d0614b2e66)
2001-12-14 18:49:02 +00:00
Jeremy Allison
6f0e7b69b7 winbindd friendly user_in_list code. Tested on a 65k user domain.
Jeremy.
(This used to be commit 5215bcca15)
2001-12-04 05:13:04 +00:00
Jeremy Allison
8e99888e7b Moved name_is_local to the correct place. Ooops.
Jeremy.
(This used to be commit 708c0a8d16)
2001-12-04 03:47:44 +00:00
Jeremy Allison
c2e3d8ba01 Tidyup of lib/username. Add name_is_local fn to determine if name is
winbindd. Getting ready for efficiency fix in group lookups.
Jeremy.
(This used to be commit 8d41dfd149)
2001-12-04 02:58:22 +00:00
Jeremy Allison
35da7fae5e Look for DOMAIN\group in group lists and ask winbind.
Jeremy.
(This used to be commit 763fd1c787)
2001-11-13 22:49:50 +00:00
Andrew Bartlett
d9d7f023d8 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
(This used to be commit c95f5aeb93)
2001-10-29 07:35:11 +00:00
Andrew Bartlett
2038649e51 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
(This used to be commit e7634f81c5)
2001-10-29 07:28:32 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
484a7c0341 move to SAFE_FREE()
(This used to be commit 60e907b7e8)
2001-09-17 02:19:44 +00:00
Andrew Tridgell
79139fe8d8 convert more code to use XFILE
(This used to be commit fe6679dffb)
2001-09-10 12:46:42 +00:00
Simo Sorce
1cbae7315f Convert other parameters (read list, write list, valid users...) to the P_LIST format.
changed functions to use list instead of strings
addedd lp_list_substitute function
(This used to be commit 7257d07563)
2001-07-24 20:02:48 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Jeremy Allison
fd4c525d58 If we can't open the username map file, at least print the strerror.
Jeremy.
(This used to be commit abf436153a)
2001-04-06 17:13:16 +00:00
Gerald Carter
ba3ee7fdaa fixed typo in debug statement
jerry
(This used to be commit a28d384e4d)
2001-01-24 15:41:07 +00:00
David O'Neill
0407ba8b1b Cleanup of Get_Pwnam(). Adds debugging, cleans up the allow_change
codepath.
(This used to be commit 767f73aee6)
2001-01-17 22:33:07 +00:00
Gerald Carter
ea4a0d509e new version of Get_Pwnam()
o check the username in all lowercase
  o check the username as transmitted if this would be a different case
  o check the username in all upper case if this is a new version


-- jerry
(This used to be commit 059f4fee5d)
2000-12-11 17:48:26 +00:00
Jeremy Allison
f3a20ba1f3 Even when looking up a users groups via winbindd even if the lookup for
the list of groups a user is in succeeds via winbind, we must allow the
lookup of the group name -> gid we are checking if the user is a member
of to go via winbind or /etc/group - as it may be a group on the local
box we are checking against. This is a subtle one.....
Jeremy.
(This used to be commit 4ffda462b9)
2000-10-25 23:32:12 +00:00
Jeremy Allison
2094856942 John Reilly @ HP (who is a wonderful human being and *definately* needs
CVS commit access :-) has written a simple routine that peeks inside the
MS PE printer driver file format and can tell if a driver is W2K or NT4.x.
So we can now correctly return the driver version number. Hurrah !
JF - this is the code you always wanted ..... :-) :-).
Jeremy.
(This used to be commit fd17374e6d)
2000-10-25 17:56:38 +00:00
Jeremy Allison
6d475b7217 Added David O'Neills fix to HEAD (hmmm. how did this compile... :-).
Jeremy.
(This used to be commit e222057140)
2000-10-13 17:36:22 +00:00
Jeremy Allison
330d678fba Fix to allow smbd to call winbindd if it is running for all group enumeration,
falling back to the UNIX calls on error. This should fix all problems with
smbd enumerating all users in all groups in all trusted domains via winbindd.
Also changed GETDC to query 1C name rather than 1b name as only the PDC
registers 1b.
Jeremy.
(This used to be commit 5b0038a2af)
2000-10-13 01:59:14 +00:00
Jeremy Allison
d81a598230 Turns out we do need the pwnam check as on many systems the users
primary group is not listed in the groups file...
Jeremy.
(This used to be commit b1cb7bec51)
2000-10-11 22:38:38 +00:00
Jeremy Allison
4498212487 Fix to avoid calling getgrgid for no reason.
Jeremy.
(This used to be commit b057a7349b)
2000-10-11 03:46:14 +00:00
Andrew Tridgell
6c9f6b22cb don't return a passwd struct for usernames that don't
belong to us
(This used to be commit 2740a80e30)
2000-05-29 01:08:18 +00:00
Andrew Tridgell
479c73559e use "winbind separator" option for domain/user separator character
(This used to be commit 6cbb826b15)
2000-05-12 06:30:45 +00:00
Andrew Tridgell
43a3faab08 - changed smb_getpwnam() to use winbind style usernames
- finished ntdom -> winbind rename in head
(This used to be commit ada483cb56)
2000-05-10 14:48:33 +00:00
Andrew Tridgell
f6844e0b7e a minimal change to get appliance mode to work with winbindd
we needed to accept usernames of the form DOMAIN/user, which means we
needed to pass the domain to a getpwnam() like routine in certain
critical spots.

What I'd rather do is get rid of "char *user" everywhere and use the
new userdom_struct, but that will have to wait a few days.
(This used to be commit 8b7a10febe)
2000-05-04 16:01:47 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
f6276724ba changed function name of get_home_dir() to get_unixhome_dir(), to stop
clash with gnu readline library.

fixed issue with [homes] service not being there - call lp_add_home()
just before starting the msrpc processing.
(This used to be commit 054195df9b)
1999-12-12 21:00:35 +00:00
Luke Leighton
a0ba234cf9 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

the job is not _yet_ complete, as i need to be able to do a become_user()
call for security reasons.  i picked lsarpcd first because you don't
_need_ security on it (microsoft botched so badly on this one, it's not
real.  at least they fixed this in nt5 with restrictanonymous=0x2).
fixing this involves sending the current smb and unix credentials down
the unix pipe so that the daemon it eventually goes to can pick them
up at the other end.

i can't believe this all worked!!!
(This used to be commit 2245b0c6d1)
1999-12-06 00:44:32 +00:00
Luke Leighton
a0b0fa7bb1 using jeremy's sys_getpwnam() call in the more critical area: Get_Pwnam().
made sure that hashed_getpwnam() has the copy-passwd-struct-wrapper
around it, too.
TODO: replace all calls of getpwnam() with sys_getpwnam().
(This used to be commit 436a891455)
1999-07-06 22:08:55 +00:00
Luke Leighton
8c19a3be04 patch from michael stockman <pgmtekn-micke@algonet.se> to provide a static
struct passwd in _Get_Pwnam().  _Get_Pwnam() is responsible for malloc/
freeing the string pointers to this struct passwd, NOT the callers of
_Get_Pwnam().
(This used to be commit 41f071642d)
1999-07-06 19:08:40 +00:00
Luke Leighton
0f6896b7a0 #ifdef'd out hashed_getpwnam.
(This used to be commit 1d2557cc27)
1999-06-24 18:49:42 +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
48c3765a98 clean-up of cache-getpw-hash code needed (make proto showed up loads
of functions that should be static).
(This used to be commit 06fce76e53)
1999-05-06 18:13:23 +00:00