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

46 Commits

Author SHA1 Message Date
Gerald Carter
c53e6401eb r3049: fixing some calls in the printing code to stanard_sub_basic(); fix standard_sub_snum() to use the current user's gid; add some (snum == -1) checks to standard_sub_advanced()
(This used to be commit 8c3fd1908d)
2007-10-10 10:52:59 -05:00
Gerald Carter
348b01ff77 r647: fix for setting the called name to by our IP if the called name was *SMBSERVER and *SMBSERV -- fixes issue with connecting to printers via \ip.ad.dr.ess\printer UNC path
(This used to be commit 8ee268f0ed)
2007-10-10 10:51:32 -05:00
Gerald Carter
c24dccd413 BUG 417: fix %UuGg variables expansion in include lines setging the current_user_info struct in register_vuid() -- shouldn't be any more broken than we were
(This used to be commit a90c3bd281)
2004-03-19 22:06:54 +00:00
Gerald Carter
f141ad1a96 working on bug 687; protect against null src strings in alloc_sub_basic()
(This used to be commit 6cf91bce40)
2003-12-08 17:40:44 +00:00
Volker Lendecke
88b0120e56 Implement %i-Macro for the locally used IP address. With this you can again
have virtual hosts with different configurations on a single smbd even on port
445.

Volker
(This used to be commit 3a7c8c4f0e)
2003-11-07 10:11:48 +00:00
Gerald Carter
41316b5255 make sure that we expand %H (from vl); bug 612
(This used to be commit a77f592430)
2003-11-05 04:34:31 +00:00
Jeremy Allison
bb0598faf5 Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at
all and I really want to discourage that.
Jeremy.
(This used to be commit d7e35dfb92)
2003-10-22 23:38:20 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Jeremy Allison
fcdebdae6f Fix bug found by tridge in 2.2.x. Ensure that %U substitution is
restored on next valid packet if a logon fails. This has relevence
if people are using su.exe within logon scripts !
Jeremy.
(This used to be commit d405a93a9d)
2003-08-28 23:57:34 +00:00
Gerald Carter
8bfe26b62d metze's autogenerate patch for version.h
(This used to be commit ae452e51b0)
2003-08-20 17:13:38 +00:00
Andrew Bartlett
abcac3d186 If we strupper_m after the alpha_strcpy() we know that it is less likaly
to contain multibyte charcters, as these should have been stripped.

Andrew Bartlett
(This used to be commit 0f7c1dda22)
2003-07-27 02:43:22 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Volker Lendecke
ea1cec68bb Const fixes by metze
Volker
(This used to be commit c0e35f3be8)
2003-06-17 09:40:35 +00:00
Andrew Bartlett
95705e904f Fix this for both *SMBSERVER and *SMBSERV as per comments in loadparm.c.
Andrew Bartlett
(This used to be commit c6d416541b)
2003-04-23 01:34:56 +00:00
Andrew Bartlett
97a9832541 Try to avoid setting *SMBSERVER as a 'local name'.
Andrew Bartlett
(This used to be commit 5b5e167bb1)
2003-04-23 01:21:42 +00:00
Andrew Bartlett
cdc6fc8acb Add an extra parameter to our 'set_remote_machine_name' and
'set_local_machine_name' so that the client can't change it from under us.

(.NET RC2 and WinXP install calls the machine 'machinename' during NTLMSSP
on the domain join).

Andrew Bartlett
(This used to be commit 4c7163e7c2)
2003-03-18 09:52:55 +00:00
Andrew Tridgell
91b7ac9fb9 merged the %U changes to 3.0
(This used to be commit 58fa6bfee8)
2002-11-20 00:53:24 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
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
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
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
Simo Sorce
f30dd2ec5b const religion
(This used to be commit c0904d9617)
2001-12-31 15:48:32 +00:00
Jean-François Micouleau
e0066d2dd4 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.
(This used to be commit fef52c4b96)
2001-12-06 13:09:15 +00:00
Jeremy Allison
ed7feb560b Ensured the %G substitution exactly matches what the man page states.
Jeremy.
(This used to be commit 518084a70d)
2001-11-30 00:28:39 +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
Andrew Bartlett
0db1899256 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.
(This used to be commit 8f607810eb)
2001-10-29 07:24:49 +00:00
Andrew Tridgell
b67ca9cf8c removed an unused variable
(This used to be commit 9355f25165)
2001-10-20 06:28:11 +00:00
Jeremy Allison
9a903a08a7 Merge Gerry's %G change from 2.2.2.
Jeremy.
(This used to be commit d8262286dd)
2001-10-18 18:52:01 +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
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
38df1d94be Fixed %U and %D substitutions. %U is lowercase user name, %D is uppercase
domain name.
Jeremy.
(This used to be commit 5f005952f6)
2001-04-25 18:39:31 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Jeremy Allison
8600979fad Patch to make automount lookup fallback to get home directory from getpwnam.
From Robert Montjoy <Rob_Montjoy@ECECS.UC.EDU>.
Jeremy.
(This used to be commit 1fe60064bd)
2001-03-26 21:52:43 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
Andrew Tridgell
e1b9b33e2b - fixed the %U macro so that the old (and documented) semantics work
again. This got broken with one of the substitute.c updates a couple
of months ago.

- also fixed %u to return the username from the current_user structure
  when called via a method that does not have direct access to the
  username. I cache the uidtoname() result to prevent thrashing nss.
(This used to be commit 2520a0eff9)
2000-08-25 03:58:02 +00:00
Jean-François Micouleau
e58682eb07 do some standard_sub_advanced() in api_net_sam_logon on lp_logon_xxx().
and if you have unix realname=yes, you get the gecos name when locking the
station.

	J.F.
(This used to be commit b5ad24ae0b)
2000-06-09 14:13:11 +00:00
Andrew Tridgell
32d5416b6a split the username in the vuser structure into a separate
userdom_struct. As the name implies this also contains a domain
(unused at the moment).

This will be important shortly, as operation in appliance mode needs
the domain to be always carried with the username.
(This used to be commit ee8546342d)
2000-05-02 13:55:42 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Jeremy Allison
e82dbfcbe9 Now that fsp's are created on successful file open, the structure member
fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-).

NB for Luke, this patch also did not apply to TNG. TNG is not yet
identical w.r.t file serving with HEAD. This makes it impossible for
me to help maintain TNG. Please fix asap.

lib/substitute.c: Removed unused variable (pidstr).

Jeremy.
(This used to be commit 389b700a26)
2000-04-24 19:23:51 +00:00
Andrew Tridgell
b2461e93dd split out standard_sub_basic() again to fix a bug where %p was being
substituted in the loadparm code and thus leaving lpq with no printer
(This used to be commit b7c7a4d564)
2000-04-23 08:30:37 +00:00
Andrew Tridgell
612682354f - got rid of the "passive" option
- cleaned up the standard_sub_*() calls a lot
(This used to be commit 2c2d95d77d)
2000-04-19 04:01:16 +00:00
Andrew Tridgell
bb28f06eae moved standard_sub() and friends into a separate module
(This used to be commit 030ec8e71f)
2000-04-17 04:46:10 +00:00