summaryrefslogtreecommitdiffstats
path: root/source3/lib/substitute.c
Commit message (Collapse)AuthorAgeFilesLines
* Correctly check for errors in strlower_m() returns.Jeremy Allison2012-08-091-3/+12
|
* lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij2012-03-241-1/+1
| | | | | | | | | The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
* s3-lib: Remove unused standard_sub_conn()Andrew Bartlett2012-02-171-19/+0
|
* Finally remove all malloc()'s from the substitute code. Now totallyJeremy Allison2012-01-271-91/+56
| | | | | | | talloc() based. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jan 27 03:43:21 CET 2012 on sn-devel-104
* Fix a really slow memory leak (in master at least). Found by Ira Cooper ↵Jeremy Allison2012-01-271-2/+7
| | | | | | | | | <ira@wakeful.net>. Bug #8724 - Memory leak in parent smbd on connection. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jan 27 01:26:28 CET 2012 on sn-devel-104
* s3-auth Use struct auth_user_info_unix for unix_name and sanitized_usernameAndrew Bartlett2011-07-201-2/+3
| | | | | | | | This is closer to the layout of struct auth_session_info in auth.idl Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-auth Use *unix_token rather than utok in struct auth3_session_infoAndrew Bartlett2011-07-201-1/+3
| | | | | | | | | | | | | | | | This brings this structure one step closer to the struct auth_session_info. A few SMB_ASSERT calls are added in some key places to ensure that this pointer is initialised, to make tracing any bugs here easier in future. NOTE: Many of the users of this structure should be reviewed, as unix and NT access checks are mixed in a way that should just be done using the NT ACL. This patch has not changed this behaviour however. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-param Remove %(DomainSID) supportAndrew Bartlett2011-06-241-102/+0
| | | | | | | | | | | | | | | This also removes the now unused longvar support. This experiment never took off. Fixing this allows me to resolve the the library loop between libsmbconf and SECRETS3/passdb. Andreas correctly points out that this loop originally comes from my patch to obtain the domain sid from passdb (25cfa29e29bdbb6c84bd85ea02ec542228ae585f), but as I would prefer to keep that feature, I'm hoping to break the loop here instead. Andrew Bartlett
* s3-param Remove special case for global_myname(), rename to lp_netbios_name()Andrew Bartlett2011-06-091-3/+3
| | | | | | | | There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
* s3-lib Move realloc based string substitution functions out of util_str.cAndrew Bartlett2011-05-311-0/+29
| | | | | | | This makes the dependency set for source3/lib/util_str.c simpiler, which in turn makes it easier to build a dependency tree. Andrew Bartlett
* s3-lib Replace StrnCaseCmp() with strncasecmp_m()Andrew Bartlett2011-05-181-1/+1
| | | | | | | strncasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett
* s3-auth: use auth.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/passwd.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_infoAndrew Bartlett2011-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Set the client_id in substitute.c onceVolker Lendecke2010-08-291-12/+33
| | | | | This never changes during a client connection's life, so we can set it once.
* s3: Fix a (highly unlikly) memleak in set_local_machine_name()Volker Lendecke2010-08-281-4/+4
|
* s3: Remove smbd_server_fd() from set_local_machine_name()Volker Lendecke2010-08-281-15/+0
|
* s3: Remove get_client_fd()Volker Lendecke2010-08-161-5/+8
|
* s3-secrets: only include secrets.h when needed.Günther Deschner2010-08-051-0/+1
| | | | Guenther
* s3:dom_sid Global replace of DOM_SID with struct dom_sidAndrew Bartlett2010-05-211-1/+1
| | | | | | | | | | This matches the structure that new code is being written to, and removes one more of the old-style named structures, and the need to know that is is just an alias for struct dom_sid. Andrew Bartlett Signed-off-by: Günther Deschner <gd@samba.org>
* s3: Make alloc_sub_basic() staticVolker Lendecke2009-11-211-2/+5
|
* s3: Fix some nonempty blank linesVolker Lendecke2009-11-211-27/+26
|
* Convert Samba3 to use the common lib/util/charset APIAndrew Bartlett2009-04-141-4/+4
| | | | | | | | | | | | This removes calls to push_*_allocate() and pull_*_allocate(), as well as convert_string_allocate, as they are not in the common API To allow transition to a common charcnv in future, provide Samba4-like strupper functions in source3/lib/charcnv.c (the actual implementation remains distinct, but the API is now shared) Andrew Bartlett
* "userdom_struct" does not need "full_name" anymore -- unusedVolker Lendecke2009-01-201-2/+1
|
* s3: make better use of ccache by not including version.h in every C-file.Michael Adam2009-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael
* Remove unused extern struct current_user from substitute.cVolker Lendecke2008-07-271-2/+0
| | | | | A bit hard to believe, but substitute.c does not use current_user anymore. (This used to be commit de5d27d70abcad996af91b4e93879fc415f2b38d)
* Wrap the unix token info in a unix_user_token in auth_serversupplied_infoVolker Lendecke2008-06-191-1/+1
| | | | | No functional change, this is a preparation for more current_user ref removal (This used to be commit dcaedf345e62ab74ea87f0a3fa1e3199c75c5445)
* Fix Bug #5548 (segfauls in handle_include with %m macro expansion).Michael Adam2008-06-181-1/+4
| | | | | | | | | In alloc_sub_basic, when expanding '%m', substitute "" instead of NULL for remote_machine when this is NULL. Else a NULL string is returned. Michael (This used to be commit c65b456c6a145d15b7fd27a2a3440a0709fc3277)
* Remove "user" from connection_structVolker Lendecke2008-05-101-1/+1
| | | | (This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5)
* Remove the unix token info from connection_structVolker Lendecke2008-05-101-1/+1
| | | | (This used to be commit 2834dacc8d49f77fe55fb5d7e3eb2dda431d1d3d)
* Remove "userdom_struct user" from "struct user_struct"Volker Lendecke2008-05-051-2/+9
| | | | (This used to be commit 420de035237bb08bc470c9eb820f3da2edaa6805)
* Add a talloc context parameter to current_timestring() to fix memleaks.Michael Adam2008-03-281-9/+15
| | | | | | | | | | | | | | current_timestring used to return a string talloced to talloc_tos(). When called by DEBUG from a TALLOC_FREE, this produced messages "no talloc stackframe around, leaking memory". For example when used from net conf. This also adds a temporary talloc context to alloc_sub_basic(). For this purpose, the exit strategy is slightly altered: a common exit point is used for success and failure. Michael (This used to be commit 16b5800d4e3a8b88bac67b2550d14e0aaaa302a9)
* Fix Coverity ID 537Volker Lendecke2008-03-211-3/+3
| | | | (This used to be commit b19ea3635ccc1f2c7cd6c7f2d179264fbdce13a7)
* Fix Coverity ID 538Volker Lendecke2008-03-211-3/+3
| | | | (This used to be commit d69b8b19aeac2266fb5e5ee280ffffe48a690099)
* Fix %I macro expansion for IPv4 mapped IPv6 addresses.Michael Adam2008-03-131-2/+8
| | | | | | | | | | | On some systems (linux e.g.), when listening on ipv6 and ipv4, addresses of ipv4 clients are printed as mapped ipv4 addresses by getnameinfo (e.g. ::ffff:127.0.0.1). This re-establishes the original behaviour of %I to expand to the plain ipv4 address for an ipv4 client. Michael (This used to be commit 0abc8863f87fe5d2473492797c010784cb086008)
* Add free_local_machine_name().Günther Deschner2008-01-071-0/+5
| | | | | Guenther (This used to be commit f3ebb4f96bb0364dae9924e798652e759b63bb52)
* Remove Get_Pwnam and its associated static variableVolker Lendecke2007-12-191-9/+17
| | | | | All callers are replaced by Get_Pwnam_alloc (This used to be commit 735f59315497113aebadcf9ad387e3dbfffa284a)
* s/sid_to_string/sid_to_fstring/Volker Lendecke2007-12-151-1/+1
| | | | | least surprise for callers (This used to be commit eb523ba77697346a365589101aac379febecd546)
* Replace sid_string_static with sid_to_stringVolker Lendecke2007-12-151-1/+2
| | | | | | This adds 28 fstrings on the stack, but I think an fstring on the stack is still far better than a static one. (This used to be commit c7c885078be8fd3024c186044ac28275d7609679)
* Remove pstring from automount lookups. Remove premature optimization.Jeremy Allison2007-12-041-3/+3
| | | | | Jeremy. (This used to be commit 6863fe51b5afea234b04b073d3e1b7608d60620e)
* Remove pstrings from everything except srv_spoolss_nt.c.Jeremy Allison2007-11-271-18/+16
| | | | | Jeremy. (This used to be commit 0002a9e96b0ef78316295a6eb94ff29b64e2f988)
* alpha_strcpy includes the space for the terminating nul.Jeremy Allison2007-11-151-3/+6
| | | | | Jeremy. (This used to be commit b3ed3f7e4e40c4f78d4c347411c75de81979455f)
* Remove more static fstring/pstrings. Fix socket optionJeremy Allison2007-11-091-91/+179
| | | | | | set on wrong fd (-1). Jeremy. (This used to be commit 52fe04df8e8c08126afe61d509fc1d3cb676e327)
* Remove most of the remaining globals out of lib/util_sock.c.Jeremy Allison2007-11-031-4/+5
| | | | | | | I have a plan for dealing with the remaining..... Watch this space. Jeremy. (This used to be commit 963fc7685212689f02b3adcc05b4273ee5c382d4)
* Remove more static data from lib/util_sock.c andJeremy Allison2007-11-031-2/+4
| | | | | | callers. Jeremy. (This used to be commit 35aaa36f82c70964cee5d0778eb04547b226dd3f)
* I can't get away without a 'length' arg. :-).Jeremy Allison2007-11-031-1/+2
| | | | | Jeremy. (This used to be commit 95d01279a5def709d0a5d5ae7224d6286006d120)
* Stop get_peer_addr() and client_addr() from using globalJeremy Allison2007-11-031-1/+2
| | | | | | statics. Part of my library cleanups. Jeremy. (This used to be commit e848506c858bd16706c1d7f6b4b032005512b8ac)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-5/+5
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter2007-10-101-0/+18
| | | | (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
* r25025: Remove an unused functionVolker Lendecke2007-10-101-5/+0
| | | | (This used to be commit 858f7b7d786ca352ffebb56b9fda40c636acef74)