Improved Winbind support in Samba module, thanks to Caspar Smit

This commit is contained in:
Jamie Cameron
2011-05-30 12:04:36 -07:00
parent e6ae025e18
commit e68627490e
8 changed files with 52 additions and 0 deletions

View File

@@ -28,3 +28,5 @@ Fix list of users for a share to show open files correctly, and not show the sam
Try to use the smbpasswd command to create or delete users, if installed.
---- Changes since 1.520 ----
Add support for the locked account flag for users, thanks to Juan Miguel Corral Cano.
---- Changes since 1.550 ----
Added improved Winbind support, thanks to Caspar Smit.

View File

@@ -37,6 +37,11 @@ print "<td>",&ui_radio("groups",
&istrue("winbind enum groups") ? 1 : 0,
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"</td>\n";
print "<tr> <td><b>$text{'bind_defaultdomain'}</b></td>\n";
print "<td>",&ui_radio("defaultdomain",
&istrue("winbind use default domain") ? 1 : 0,
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"</td>\n";
print "<tr> <td><b>$text{'bind_realm'}</b></td>\n";
printf "<td><input name=realm size=20 value='%s'></td>\n",
&getval("realm");

View File

@@ -5,6 +5,7 @@ samba_password_program=/usr/bin/smbpasswd
samba_status_program=/usr/bin/smbstatus
samba_server=/usr/sbin/smbd
name_server=/usr/sbin/nmbd
winbind_server=/usr/sbin/winbindd
smb_conf=/etc/smb.conf
text_lists=0
run_from_inetd=1

View File

@@ -8,9 +8,12 @@ samba_status_program=Full path to smbstatus,0
samba_password_program=Full path to smbpasswd,0
samba_server=Full path to smbd,0
name_server=Full path to nmbd,0
winbind_server=Full path to winbindd,0
swat_path=Full path to swat,3,None
smbgroupedit=Full path to smbgroupedit,3,None
pdbedit=Full path to pdbedit,3,None
net=Full path to net command,3,None
start_cmd=Command to start Samba servers,3,Automatic
stop_cmd=Command to stop Samba servers,3,Just kill processes
start_cmd_wb=Command to start Winbind servers,0
stop_cmd_wb=Command to stop Winbind servers,0

View File

@@ -276,6 +276,24 @@ if ($access{'apply'}) {
$text{'index_stopmsg'});
}
print &ui_buttons_end();
if (&has_command("winbindd")) {
$isrun2 = &is_winbind_running();
print &ui_hr();
print &ui_buttons_start();
if ($isrun2 == 0) {
# Start button
print &ui_buttons_row("start_wb.cgi", $text{'index_start_wb'},
$text{'index_startmsg_wb'});
}
elsif ($isrun2 == 1) {
# Restart / stop buttons
print &ui_buttons_row("restart_wb.cgi", $text{'index_restart_wb'},
$text{'index_restartmsg_wb'});
print &ui_buttons_row("stop_wb.cgi", $text{'index_stop_wb'},
$text{'index_stopmsg_wb'});
}
}
print &ui_buttons_end();
}
&ui_print_footer("/", $text{'index'});

View File

@@ -29,12 +29,18 @@ index_createprnshare=Create a new printer share.
index_createcopy=Create a new copy.
index_view=View all connections.
index_start=Start Samba Servers
index_start_wb=Start Winbind Servers
index_startmsg=The Samba servers do not appear to be running on your system. This means that the shares listed above will not be accessible to other computers.
index_startmsg_wb=The Winbind servers do not appear to be running on your system.
index_restart=Restart Samba Servers
index_restart_wb=Restart Winbind Servers
index_restartmsg=Click this button to restart the running Samba servers on your system. This will force the current configuration to be applied.
index_restartmsg_wb=Click this button to restart the running Winbind servers on your system.
index_restartmsg2=This will also disconnect any connections to the server, so if you do not want the current configuration to be applied immediately you should just wait 1 minute until Samba reloads the configuration automatically.
index_stop=Stop Samba Servers
index_stop_wb=Stop Winbind Servers
index_stopmsg=Click this button to shut down the running Samba servers on your system. All currently logged in users will be forcibly disconnected.
index_stopmsg_wb=Click this button to shut down the running Winbind servers on your system.
index_einclude=Warning - Your Samba configuration file $1 contains the $2 or $3 directive. This may cause Webmin to modify the file incorrectly.
index_delete=Delete Selected Shares
@@ -399,8 +405,10 @@ savesmb_server=You must enter a password server
start_err=Failed to start Samba servers
start_fail=$1 failed
start_err_wb=Failed to start Winbind servers
restart_err=Failed to restart Samba servers
restart_err_wb=Failed to restart Winbind servers
swats_fail=Failed to save username
swats_user=Missing SWAT username
@@ -422,8 +430,11 @@ viewu_kill=Disconnect Selected Users
viewu_enone=No users selected
log_apply=Restarted Samba servers
log_apply_wb=Restarted Winbind servers
log_stop=Stopped Samba servers
log_stop_wb=Stopped Winbind servers
log_start=Started Samba servers
log_start_wb=Started Winbind servers
log_save_fshare=Modified file share $1
log_save_pshare=Modified printer share $1
log_save_sec=Modified security and access control for share $1
@@ -628,6 +639,7 @@ bind_local=Enable Winbind for local accounts?
bind_trust=Trust domain server users?
bind_users=Disallow listing of users?
bind_groups=Disallow listing of groups?
bind_defaultdomain=Always use default domain?
bind_realm=Kerberos realm on domain server
bind_cache=Seconds to cache user details for
bind_uid=Range of UIDs for Windows users

View File

@@ -734,6 +734,15 @@ return !$found_inet && !@smbpids && !@nmbpids ? 0 :
!$found_inet ? 1 : 2;
}
# is_winbind_running()
# Returns 0 if not, 1 if it is
sub is_winbind_running
{
local (@wbpids);
@wbpids = &find_byname("winbindd");
return !@wbpids ? 0 : 1;
}
# can($permissions_string, \%access, [$sname])
# check global and per-share permissions:
#

View File

@@ -21,6 +21,8 @@ $global = &get_share("global");
&setval("winbind enum groups", $in{'groups'} ? "yes" : "no");
&setval("winbind use default domain", $in{'defaultdomain'} ? "yes" : "no");
$in{'realm'} eq "" || $in{'realm'} =~ /^\S+$/ || &error($text{'bind_erealm'});
&setval("realm", $in{'realm'});