1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00

loadparm.c: Added #ifdef USE_LDAP around ldap code.

server.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
smbpass.c: Partial tidyup of machine_password_lock() code - not finished yet.
util.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
lib/rpc/server/srv_ldap_helpers.c: Added #ifdef USE_LDAP around ldap code.
lib/rpc/server/srv_samr.c: Added #ifdef USE_LDAP around ldap code.
Jeremy.
This commit is contained in:
Jeremy Allison
-
parent 18a0a10dcb
commit 446b98ca07
6 changed files with 43 additions and 38 deletions

View File

@@ -4000,32 +4000,16 @@ void standard_sub_basic(char *str)
{
char *s, *p;
char pidstr[10];
struct passwd *pass;
char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user;
for (s = str ; s && *s && (p = strchr(s,'%')); s = p )
{
switch (*(p+1))
{
case 'G' :
{
if ((pass = Get_Pwnam(sesssetup_user,False))!=NULL)
{
string_sub(p,"%G",gidtoname(pass->pw_gid));
}
else
{
p += 2;
}
break;
}
case 'N' : string_sub(p,"%N", automount_server(username)); break;
case 'I' : string_sub(p,"%I", client_addr(Client)); break;
case 'L' : string_sub(p,"%L", local_machine); break;
case 'M' : string_sub(p,"%M", client_name(Client)); break;
case 'R' : string_sub(p,"%R", remote_proto); break;
case 'T' : string_sub(p,"%T", timestring()); break;
case 'U' : string_sub(p,"%U", username); break;
case 'a' : string_sub(p,"%a", remote_arch); break;
case 'd' :
{