summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-06-15 12:38:13 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-06-15 12:38:13 +0000
commitac08646c374cd70e47301bce3e031b35cb220347 (patch)
tree5e302cfd5bfe703ad0fbe7614f656bf7595691a8 /source3/lib
parent843a467f21b48c5fc77c6c2d2db6553e5066a0c5 (diff)
downloadsamba-ac08646c374cd70e47301bce3e031b35cb220347.tar.gz
samba-ac08646c374cd70e47301bce3e031b35cb220347.tar.bz2
samba-ac08646c374cd70e47301bce3e031b35cb220347.zip
Rework much of the service.c code:
The aim of this execise is to give the 'security>=user' code a straight paper path. Security=share will sill call authorise_login(), but otherwise we avoid that mess. This allow *much* more accurate error code reporting, beocuse we don't start pretending that we can use the (nonexistant) password etc. Also in this patch is code to create the 'homes' share at session setup time (as we have done in the past - been broken recently) and to record this on the user's vuser struct for later reference. The changes here should also allow for much better use of %H (some more changes to come here). The service.c changes move a lot of code around, but are not as drastric as they look... (Also included is a fix to srv_srvsvc_nt.c where 'total_entries' not '*total_entries' was compared). This code is needs testing, but passes my basic tests. I expect we have lost some functionality, but the stuff I had expected to loose was already broken before I started. In particular, we don't 'fall back' to guest if the user cannot access a share (for security=user). If you want this kind of stuff then you really want security=share anyway. Andrew Bartlett (This used to be commit 4c0cbcaed95231f8cf11edb43f6adbec9a0d0b5c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/substitute.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 6c56cdd480..eea720c014 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -226,7 +226,9 @@ void standard_sub_basic(const char *smb_name, char *str)
Do some standard substitutions in a string.
****************************************************************************/
-static void standard_sub_advanced(int snum, const char *user, const char *connectpath, gid_t gid, const char *smb_name, char *str)
+static void standard_sub_advanced(int snum, const char *user,
+ const char *connectpath, gid_t gid,
+ const char *smb_name, char *str)
{
char *p, *s, *home;
@@ -345,7 +347,8 @@ void standard_sub_conn(connection_struct *conn, char *str)
share. No user specific snum created yet so servicename should be the username.
****************************************************************************/
-void standard_sub_home(int snum, const char *user, char *str)
+void standard_sub_home(int snum, const char *share,
+ const char *user, const char *homedir, pstring str)
{
char *p, *s;
@@ -353,8 +356,12 @@ void standard_sub_home(int snum, const char *user, char *str)
int l = sizeof(pstring) - (int)(p-str);
switch (*(p+1)) {
+ case 'H':
+ string_sub(p,"%H", homedir, l);
+ break;
+
case 'S':
- string_sub(p,"%S", user, l);
+ string_sub(p,"%S", share, l);
break;
case 'p':
string_sub(p,"%p", automount_path(user), l);