diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index af8152a0f..e45ca26fd 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -22,6 +22,8 @@ my %netsettings = (); my %ovpnsettings = (); my $message = ""; my $errormessage = ""; +my @Logs = qx(ls /var/log/samba/); +my $Log ='kein Log ausgewählt'; my $defaultoption= "[Share]\npath = /var/samba/share1\ncomment = Share - Public Access\nbrowseable = yes\nwriteable = yes\ncreate mask = 0777\ndirectory mask = 0777\nguest ok = yes\npublic = yes\nforce user = samba"; my $userentry = ""; my @user = (); @@ -53,6 +55,7 @@ my @shareline = (); my $sharefile = "/var/ipfire/samba/shares"; my $EOF = qx(cat $sharefile | wc -l); my $Status = qx(/usr/local/bin/sambactrl smbstatus); +$Status=~s/\n/
/g; @shares = `grep -n '^\\[' $sharefile`; foreach $shareentry (@shares) @@ -65,8 +68,8 @@ foreach $shareentry (@shares) #################################### Initialisierung von Samba Variablen fr global Settings ############################### $sambasettings{'WORKGRP'} = 'homeip.net'; -$sambasettings{'NETBIOSNAME'} = 'IPFIRE'; -$sambasettings{'SRVSTRING'} = 'Samba Server running on IPFire 2.0'; +$sambasettings{'NETBIOSNAME'} = 'IPFire'; +$sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.0'; $sambasettings{'INTERFACES'} = ''; $sambasettings{'SECURITY'} = 'share'; $sambasettings{'OSLEVEL'} = '65'; @@ -74,14 +77,17 @@ $sambasettings{'GREEN'} = 'on'; $sambasettings{'BLUE'} = 'off'; $sambasettings{'ORANGE'} = 'off'; $sambasettings{'VPN'} = 'off'; -$sambasettings{'WINSSRV'} = "$netsettings{'GREEN_NETADDRESS'}"; -$sambasettings{'WINSSUPPORT'} = 'off'; +$sambasettings{'WINSSRV'} = ''; +$sambasettings{'WINSSUPPORT'} = 'on'; +$sambasettings{'REMOTEANNOUNCE'} = ''; $sambasettings{'PASSWORDSYNC'} = 'off'; $sambasettings{'OTHERINTERFACES'} = ''; $sambasettings{'GUESTACCOUNT'} = 'samba'; $sambasettings{'MAPTOGUEST'} = 'Never'; +$sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:10 winbind:2'; ### Values that have to be initialized -$cgisettings{'ACTION'} = ''; +$sambasettings{'ACTION'} = ''; +$sambasettings{'LOGLINES'} = '15'; ################################################## Samba PDC Variablen ##################################################### @@ -100,7 +106,7 @@ my $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`; &Header::openbigbox('100%', 'left', '', $errormessage); ############################################################################################################################ -############################################# Samba Rootskript aufrufe fr SU-Actions ###################################### +############################################# Samba Rootskript aufrufe fr SU-Actions ####################################### if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system("/usr/local/bin/sambactrl smbuserdisable $sambasettings{'NAME'}");} if ($sambasettings{'ACTION'} eq 'smbuserenable'){system("/usr/local/bin/sambactrl smbuserenable $sambasettings{'NAME'}");} @@ -111,11 +117,38 @@ if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/usr/local/bin/sambactrl s if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl smbstart");} if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");} if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");} -if ($sambasettings{'ACTION'} eq 'globalreset'){system("/usr/local/bin/sambactrl smbglobalreset");} +if ($sambasettings{'ACTION'} eq 'globalresetyes') + { + system("/usr/local/bin/sambactrl smbglobalreset"); + $sambasettings{'WORKGRP'} = 'homeip.net'; + $sambasettings{'NETBIOSNAME'} = 'IPFire'; + $sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.0'; + $sambasettings{'INTERFACES'} = ''; + $sambasettings{'SECURITY'} = 'share'; + $sambasettings{'OSLEVEL'} = '65'; + $sambasettings{'GREEN'} = 'on'; + $sambasettings{'BLUE'} = 'off'; + $sambasettings{'ORANGE'} = 'off'; + $sambasettings{'VPN'} = 'off'; + $sambasettings{'WINSSRV'} = ''; + $sambasettings{'WINSSUPPORT'} = 'on'; + $sambasettings{'REMOTEANNOUNCE'} = ''; + $sambasettings{'PASSWORDSYNC'} = 'off'; + $sambasettings{'OTHERINTERFACES'} = ''; + $sambasettings{'GUESTACCOUNT'} = 'samba'; + $sambasettings{'MAPTOGUEST'} = 'Never'; + $sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:10 winbind:2'; +### Values that have to be initialized + $sambasettings{'ACTION'} = ''; + $sambasettings{'LOCALMASTER'} = 'off'; + $sambasettings{'DOMAINMASTER'} = 'off'; + $sambasettings{'PREFERREDMASTER'} = 'off'; + $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`; + } # smbsafeconf is directly called by the if clause -if ($sambasettings{'ACTION'} eq 'sharesreset') +if ($sambasettings{'ACTION'} eq 'sharesresetyes') { system('/usr/local/bin/sambactrl smbsharesreset'); @Zeilen = (); @@ -133,17 +166,49 @@ system('/usr/local/bin/sambactrl smbsharesreset'); } } +############################################################################################################################ +################################################ Sicherheitsabfrage für den Reset ########################################## + +if ($sambasettings{'ACTION'} eq 'globalreset') + { + print < +
+ Globals zurück setzen? +
+ Yes +
+
+ No +
+ + +END +; +} + +if ($sambasettings{'ACTION'} eq 'sharesreset') + { + print < +
+ Shares zurück setzen? +
+ Yes +
+
+ No +
+ + +END +; + } + ############################################################################################################################ ########################################### Samba Benutzer oder PC l�chen ################################################# -if ($sambasettings{'ACTION'} eq 'userdelete' && $sambasettings{'NAME'} =~ /\$/) -{ -system("/usr/local/bin/sambactrl smbpcdelete $sambasettings{'NAME'}"); -} -elsif ($sambasettings{'ACTION'} eq 'userdelete') -{ -system("/usr/local/bin/sambactrl smbuserdelete $sambasettings{'NAME'}"); -} +if ($sambasettings{'ACTION'} eq 'userdelete'){system("/usr/local/bin/sambactrl smbuserdelete $sambasettings{'NAME'}");} ############################################################################################################################ ############################################## Samba Share neu anlegen ##################################################### @@ -317,11 +382,10 @@ if ($sambasettings{'OTHERINTERFACES'} ne ''){ $sambasettings{'INTERFACES'} .= " &General::writehash("${General::swroot}/samba/settings", \%sambasettings); if ($sambasettings{'PASSWORDSYNC'} eq 'on'){ $sambasettings{'PASSWORDSYNC'} = "true";} else { $sambasettings{'PASSWORDSYNC'} = "false";} -if ($sambasettings{'WINSSUPPORT'} eq 'on'){ $sambasettings{'WINSSUPPORT'} = "true";} else { $sambasettings{'WINSSUPPORT'} = "false";} +if ($sambasettings{'WINSSUPPORT'} eq 'on'){ $sambasettings{'WINSSUPPORT'} = "true";$sambasettings{'WINSSRV'} = "";} else { $sambasettings{'WINSSUPPORT'} = "false";} if ($sambasettings{'LOCALMASTER'} eq 'on'){ $sambasettings{'LOCALMASTER'} = "true";} else { $sambasettings{'LOCALMASTER'} = "false";} if ($sambasettings{'DOMAINMASTER'} eq 'on'){ $sambasettings{'DOMAINMASTER'} = "true";} else { $sambasettings{'DOMAINMASTER'} = "false";} if ($sambasettings{'PREFERREDMASTER'} eq 'on'){ $sambasettings{'PREFERREDMASTER'} = "true";} else { $sambasettings{'PREFERREDMASTER'} = "false";} -if ($sambasettings{'MAPTOGUEST'} eq 'on'){ $sambasettings{'MAPTOGUEST'} = "true";} else { $sambasettings{'MAPTOGUEST'} = "false";} ############################################################################################################################ ############################################# Schreiben der Samba globals ################################################## @@ -355,13 +419,16 @@ null passwords = yes bind interfaces only = true interfaces = $sambasettings{'INTERFACES'} socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE +remote announce = $sambasettings{'REMOTEANNOUNCE'} username level = 1 wins support = $sambasettings{'WINSSUPPORT'} +wins server = $sambasettings{'WINSSRV'} log file = /var/log/samba/samba-log.%m lock directory = /var/lock/samba pid directory = /var/run/ +log level = $sambasettings{'LOGLEVEL'} preferred master = $sambasettings{'PREFERREDMASTER'} domain master = $sambasettings{'DOMAINMASTER'} @@ -388,6 +455,7 @@ END } } &General::readhash("${General::swroot}/samba/settings", \%sambasettings); + if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); @@ -454,7 +522,7 @@ END my $key = ''; foreach $key (sort keys %servicenames) { - print "$key"; + print "$key"; my $shortname = $servicenames{$key}; my $status = &isrunning($shortname); print "$status"; @@ -468,8 +536,8 @@ END } print <
-
+
+ @@ -481,13 +549,14 @@ print <
Basisoptionen -Workgroup: -NetBIOS-Name: -Server-String: -Interfaces:on / +Workgroup: +NetBIOS-Name: +Server-String: +Log Level: +Interfaces:on / off | OpenVpn - $ovpnsettings{'DDEVICE'} -on / +on / off | $Lang::tr{'green'} - $netsettings{'GREEN_DEV'} END @@ -496,7 +565,7 @@ END if (&Header::blue_used()) { print <on / + on / off | $Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'} END @@ -506,7 +575,7 @@ END if (&Header::orange_used()) { print <on / + on / off | $Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'} END @@ -514,40 +583,44 @@ END } print <weitere +weitere
Sicherheitsoptionen -Security: -Map to guest: -Unix Passwort Sync:on / +Unix Passwort Sync:on / off -
+
Netzwerkoptionen -OS Level: -WINS-Server: +OS Level: +Remote Announce: +END +; +if ($sambasettings{'WINSSUPPORT'} eq 'off') {print"WINS-Server:";} + print <WINS-Support:on / + off END ; if ($sambasettings{'SECURITY'} eq 'user') { print <WINS-Support:on / - off -Local Master:on / +Local Master:on / off -Domain Master:on / +Domain Master:on / off -Preferred Master:on / +Preferred Master:on / off END ; @@ -567,7 +640,7 @@ END print < - + @@ -586,9 +659,9 @@ if ($sambasettings{'ACTION'} eq 'globalcaption') print < - - - + + +



Legende:
Einstellungen speichern
Auf default zurueck setzen
Legende:
Einstellungen speichern
Auf default zurueck setzen
END ; @@ -615,7 +688,7 @@ if ($sambasettings{'SECURITY'} eq 'user')
Benutzerverwaltung - NamePasswort + NamePasswort END ; @@ -625,10 +698,10 @@ END } else { - print "Typ"; + print "Typ"; } - print "StatusOptionen"; + print "StatusOptionen"; system('/usr/local/bin/sambactrl readsmbpasswd'); open(FILE, "; @@ -637,29 +710,29 @@ END foreach $userentry (sort @user) { @userline = split( /\:/, $userentry ); - print "$userline[0]"; + print "$userline[0]"; if ($userline[4] =~ /N/) { - print "nicht gesetzt"; + print "nicht gesetzt"; } else { - print "gesetzt"; + print "gesetzt"; } if ($sambasettings{'DOMAINMASTER'} eq 'off') { - print ""; + print ""; } else { if ($userline[0] =~ /\$/) { - print "PC"; + print "PC"; } else { - print "User"; + print "User"; } } @@ -667,7 +740,7 @@ END { print < -
+ @@ -679,7 +752,7 @@ END { print < - + @@ -695,7 +768,7 @@ END else { print < + @@ -704,14 +777,28 @@ END ; } - print < - - - - + if ($sambasettings{'DOMAINMASTER'} eq 'on' && $userline[0] =~ /\$/) + { + print <
+ + + +
END ; + } + else + { + print <
+ + + +
+END +; + } } print < @@ -719,7 +806,7 @@ END
-
+ END ; @@ -728,7 +815,7 @@ END print <
-
+ END ; } @@ -745,15 +832,16 @@ END { print < -
- Legende: - Benutzer neu anlegen - Client Account neu anlegen - Benutzer aktivieren - Benutzer deaktivieren - Einstellungen speichern - Passwort wechseln - Benutzer loeschen +
+ Legende: + Benutzer neu anlegen + Client Account neu anlegen + Benutzer loeschen + Client Account loeschen + Benutzer aktivieren + Benutzer deaktivieren + Passwort wechseln + Einstellungen speichern END ; @@ -769,8 +857,8 @@ END - - + +

Passwort wechseln
Benutzername
Passwort
Benutzername
Passwort
@@ -793,10 +881,10 @@ END - - - - + + + +

Benutzer neu anlegen
Benutzername
Passwort
Unix Gruppe
Unix Shell
Benutzername
Passwort
Unix Gruppe
Unix Shell
@@ -816,9 +904,9 @@ END - - - + + +

Client Account neu anlegen
Clientname
Unix Gruppe
Unix Shell
Clientname
Unix Gruppe
Unix Shell
@@ -832,7 +920,7 @@ END ############################################################################################################################ ############################################### Verwalten von Freigaben #################################################### - + &Header::openbox('100%', 'center', 'Shares'); print <
Shareverwaltung -Names des SharesOptionen +Names des SharesOptionen END ; @@ -886,13 +974,13 @@ if ($sambasettings{'ACTION'} eq 'sharecaption') { print < -
- Legende: - Share neu anlegen - Share bearbeiten - Einstellungen speichern - Shares zurueck setzen - Share loeschen +
+ Legende: + Share neu anlegen + Share bearbeiten + Einstellungen speichern + Shares zurueck setzen + Share loeschen END ; @@ -949,13 +1037,14 @@ if ($sambasettings{'ACTION'} eq 'sharechange' || $sambasettings{'ACTION'} eq 'op Anzeige der Optionen fuer Shares
-
+
+ +

-
END ; @@ -1030,19 +1119,56 @@ END print < - + - +


Samba Status
$Status
$Status
END ; +&Header::closebox(); + +############################################################################################################################ +############################################### Anzeige des Sambastatus #################################################### + + +if ($sambasettings{'ACTION'} eq 'showlog') +{ +$Log = qx(tail -n $sambasettings{'LOGLINES'} /var/log/samba/$sambasettings{'LOG'}); +$Log=~s/\n/
/g; +} + +&Header::openbox('100%', 'center', 'Logs'); + +print < +
+ + + + + + + + + + +

Loganzeige

anzeige der letzen x Zeilen

$Log

$sambasettings{'LOG'}
+
+END +; &Header::closebox(); &Header::closebigbox(); &Header::closepage(); ############################################################################################################################ -############################################ Subfunktion fr Sambadienste ################################################## +############################################ Subfunktion fr Sambadienste ################################################### sub isrunning { diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi index 3d8495501..d2faaa160 100644 --- a/html/cgi-bin/upnp.cgi +++ b/html/cgi-bin/upnp.cgi @@ -156,7 +156,8 @@ print <Description Document: Upnp Device Name:

- + +

@@ -173,7 +174,7 @@ END sub isrunning { my $cmd = $_[0]; - my $status = "$Lang::tr{'stopped'}"; + my $status = "$Lang::tr{'stopped'}"; my $pid = ''; my $testcmd = ''; my $exename; diff --git a/html/html/images/dialog-error.png b/html/html/images/dialog-error.png new file mode 100755 index 000000000..3bbbb4a0d Binary files /dev/null and b/html/html/images/dialog-error.png differ diff --git a/html/html/images/edit-redo.png b/html/html/images/edit-redo.png new file mode 100755 index 000000000..c3b0df039 Binary files /dev/null and b/html/html/images/edit-redo.png differ diff --git a/html/html/images/network-error.png b/html/html/images/network-error.png new file mode 100755 index 000000000..3f18ed0f7 Binary files /dev/null and b/html/html/images/network-error.png differ diff --git a/html/html/images/user-multiple.png b/html/html/images/user-multiple.png new file mode 100755 index 000000000..1b2696c1b Binary files /dev/null and b/html/html/images/user-multiple.png differ diff --git a/html/html/images/user-option-add.png b/html/html/images/user-option-add.png new file mode 100755 index 000000000..0c9ca4829 Binary files /dev/null and b/html/html/images/user-option-add.png differ diff --git a/html/html/images/user-option-remove.png b/html/html/images/user-option-remove.png new file mode 100755 index 000000000..1304c032d Binary files /dev/null and b/html/html/images/user-option-remove.png differ diff --git a/lfs/linux-igd b/lfs/linux-igd index ff5dbce42..c28b5a5d6 100644 --- a/lfs/linux-igd +++ b/lfs/linux-igd @@ -74,6 +74,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && make $(MAKETUNING) #HAVE_LIBIPTC=1 cd $(DIR_APP) && make install - cp -vf $(DIR_SRC)/config/upnp/* /etc/linuigd/ + cp -vf $(DIR_SRC)/config/upnp/* /etc/linuxigd/ @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/misc-progs/sambactrl.c b/src/misc-progs/sambactrl.c index 463f915ca..d6964b58f 100644 --- a/src/misc-progs/sambactrl.c +++ b/src/misc-progs/sambactrl.c @@ -63,6 +63,7 @@ int main(int argc, char *argv[]) safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/samba/settings"); safe_system("/bin/cat /var/ipfire/samba/default.global > /var/ipfire/samba/global"); + safe_system("/bin/cat /var/ipfire/samba/default.pdc > /var/ipfire/samba/pdc"); return 0; } @@ -85,6 +86,8 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "smbstart")==0) { + snprintf(command, BUFFER_SIZE-1, "smbd -D && nmbd -D && winbindd -D",); + safe_system(command); return 0; } @@ -92,7 +95,6 @@ int main(int argc, char *argv[]) { snprintf(command, BUFFER_SIZE-1, "/usr/sbin/smbstatus"); safe_system(command); - printf(command); return 0; }