Linux mail.vriendennsm.nl 6.1.0-51-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.177-1 (2026-07-16) x86_64
Apache/2.4.68 (Debian)
Server IP : 217.154.75.17 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
webmin /
mysql /
Delete
Unzip
Name
Size
Permission
Date
Action
help
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
images
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
lang
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
CHANGELOG
8.2
KB
-rw-r--r--
2026-07-17 21:17
acl_security.pl
2.55
KB
-rwxr-xr-x
2026-07-17 21:17
backup.pl
4.17
KB
-rwxr-xr-x
2026-07-17 21:22
backup_config.pl
1.01
KB
-rwxr-xr-x
2026-07-17 21:17
backup_db.cgi
8.07
KB
-rwxr-xr-x
2026-07-17 21:22
backup_form.cgi
6.84
KB
-rwxr-xr-x
2026-07-17 21:22
cgi_args.pl
577
B
-rwxr-xr-x
2026-07-17 21:17
config
522
B
-rw-r--r--
2026-07-17 21:17
config-AlmaLinux-7.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-Amazon-Linux-2-ALL
403
B
-rw-r--r--
2026-07-17 21:17
config-CentOS-Linux-7.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-CentOS-Stream-Linux-8.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-CloudLinux-8.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-Oracle-Linux-8.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-Redhat-Enterprise-Linux-7.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-Rocky-Linux-7.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-Scientific-Linux-7.0-ALL
403
B
-rw-r--r--
2026-07-17 21:17
config-Ubuntu-Linux-16.04-17.99
453
B
-rw-r--r--
2026-07-17 21:17
config-Ubuntu-Linux-18.04-25.99
420
B
-rw-r--r--
2026-07-17 21:17
config-Ubuntu-Linux-26.04-ALL
438
B
-rw-r--r--
2026-07-17 21:17
config-aix
479
B
-rw-r--r--
2026-07-17 21:17
config-alpine-linux
469
B
-rw-r--r--
2026-07-17 21:17
config-cobalt-linux
417
B
-rw-r--r--
2026-07-17 21:17
config-coherent-linux
419
B
-rw-r--r--
2026-07-17 21:17
config-debian-linux
416
B
-rw-r--r--
2026-07-17 21:17
config-debian-linux-10.0-12.0
420
B
-rw-r--r--
2026-07-17 21:17
config-debian-linux-13.0-ALL
437
B
-rw-r--r--
2026-07-17 21:17
config-debian-linux-2.2-9.0
436
B
-rw-r--r--
2026-07-17 21:17
config-freebsd
479
B
-rw-r--r--
2026-07-17 21:17
config-freebsd-8-ALL
516
B
-rw-r--r--
2026-07-17 21:17
config-gentoo-linux
413
B
-rw-r--r--
2026-07-17 21:17
config-mandrake-linux
399
B
-rw-r--r--
2026-07-17 21:17
config-mandrake-linux-10.1-ALL
401
B
-rw-r--r--
2026-07-17 21:17
config-msc-linux
421
B
-rw-r--r--
2026-07-17 21:17
config-netbsd
431
B
-rw-r--r--
2026-07-17 21:17
config-open-linux
417
B
-rw-r--r--
2026-07-17 21:17
config-openSUSE-Linux-15.0-ALL
403
B
-rw-r--r--
2026-07-17 21:17
config-openmamba-linux
417
B
-rw-r--r--
2026-07-17 21:17
config-pardus-linux
346
B
-rw-r--r--
2026-07-17 21:17
config-redhat-linux
417
B
-rw-r--r--
2026-07-17 21:17
config-redhat-linux-24.0
421
B
-rw-r--r--
2026-07-17 21:17
config-redhat-linux-25.0-ALL
418
B
-rw-r--r--
2026-07-17 21:17
config-redhat-linux-7.0-23.0
419
B
-rw-r--r--
2026-07-17 21:17
config-slackware-linux-8.0-ALL
449
B
-rw-r--r--
2026-07-17 21:17
config-sol-linux
455
B
-rw-r--r--
2026-07-17 21:17
config-solaris-10
440
B
-rw-r--r--
2026-07-17 21:17
config-solaris-11-ALL
490
B
-rw-r--r--
2026-07-17 21:17
config-solaris-9
498
B
-rw-r--r--
2026-07-17 21:17
config-suse-linux
409
B
-rw-r--r--
2026-07-17 21:17
config-suse-linux-7.1-ALL
407
B
-rw-r--r--
2026-07-17 21:17
config-syno-linux
528
B
-rwxr-xr-x
2026-07-17 21:17
config-trustix-linux
407
B
-rw-r--r--
2026-07-17 21:17
config-turbo-linux
417
B
-rw-r--r--
2026-07-17 21:17
config-united-linux
407
B
-rw-r--r--
2026-07-17 21:17
config-windows
568
B
-rw-r--r--
2026-07-17 21:17
config.info
1.64
KB
-rw-r--r--
2026-07-17 21:17
config.info.bg
2.74
KB
-rw-r--r--
2026-07-17 21:17
config.info.ca
1.7
KB
-rw-r--r--
2026-07-17 21:17
config.info.cs
1.46
KB
-rw-r--r--
2026-07-17 21:17
config.info.de
1.62
KB
-rw-r--r--
2026-07-17 21:17
config.info.es
813
B
-rw-r--r--
2026-07-17 21:17
config.info.fi
0
B
-rw-r--r--
2026-07-17 21:17
config.info.fr
1.85
KB
-rw-r--r--
2026-07-17 21:17
config.info.hu
1.32
KB
-rw-r--r--
2026-07-17 21:17
config.info.it
1.54
KB
-rw-r--r--
2026-07-17 21:17
config.info.ja
1.7
KB
-rw-r--r--
2026-07-17 21:17
config.info.nl
1.67
KB
-rw-r--r--
2026-07-17 21:17
config.info.no
1.54
KB
-rw-r--r--
2026-07-17 21:17
config.info.pl
808
B
-rw-r--r--
2026-07-17 21:17
config.info.pt_BR
1.68
KB
-rw-r--r--
2026-07-17 21:17
config.info.ru
1.27
KB
-rw-r--r--
2026-07-17 21:17
config.info.sv
677
B
-rw-r--r--
2026-07-17 21:17
config.info.tr
1.13
KB
-rw-r--r--
2026-07-17 21:17
config.info.uk
1.31
KB
-rw-r--r--
2026-07-17 21:17
config.info.zh
320
B
-rw-r--r--
2026-07-17 21:17
config.info.zh_TW
891
B
-rw-r--r--
2026-07-17 21:17
config_info.pl
575
B
-rwxr-xr-x
2026-07-17 21:17
cpan_modules.pl
131
B
-rwxr-xr-x
2026-07-17 21:17
create_table.cgi
1.02
KB
-rwxr-xr-x
2026-07-17 21:22
csv.cgi
2.26
KB
-rwxr-xr-x
2026-07-17 21:22
csv_form.cgi
1.67
KB
-rwxr-xr-x
2026-07-17 21:22
defaultacl
85
B
-rw-r--r--
2026-07-17 21:17
delete_cprivs.cgi
1.15
KB
-rwxr-xr-x
2026-07-17 21:22
delete_dbs.cgi
1.04
KB
-rwxr-xr-x
2026-07-17 21:22
delete_fields.cgi
665
B
-rwxr-xr-x
2026-07-17 21:22
delete_hosts.cgi
1018
B
-rwxr-xr-x
2026-07-17 21:22
delete_tprivs.cgi
1.1
KB
-rwxr-xr-x
2026-07-17 21:22
delete_users.cgi
941
B
-rwxr-xr-x
2026-07-17 21:22
download.cgi
1.07
KB
-rwxr-xr-x
2026-07-17 21:22
drop_dbase.cgi
1.86
KB
-rwxr-xr-x
2026-07-17 21:22
drop_dbases.cgi
1.39
KB
-rwxr-xr-x
2026-07-17 21:22
drop_table.cgi
1.27
KB
-rwxr-xr-x
2026-07-17 21:22
drop_tables.cgi
1.75
KB
-rwxr-xr-x
2026-07-17 21:22
edit_cnf.cgi
3.77
KB
-rwxr-xr-x
2026-07-17 21:22
edit_cpriv.cgi
2.34
KB
-rwxr-xr-x
2026-07-17 21:22
edit_db.cgi
2.09
KB
-rwxr-xr-x
2026-07-17 21:22
edit_dbase.cgi
6.91
KB
-rwxr-xr-x
2026-07-17 21:22
edit_field.cgi
4.99
KB
-rwxr-xr-x
2026-07-17 21:22
edit_host.cgi
1.48
KB
-rwxr-xr-x
2026-07-17 21:22
edit_index.cgi
1.83
KB
-rwxr-xr-x
2026-07-17 21:22
edit_manual.cgi
952
B
-rwxr-xr-x
2026-07-17 21:22
edit_ssl.cgi
1.66
KB
-rwxr-xr-x
2026-07-17 21:22
edit_table.cgi
2.85
KB
-rwxr-xr-x
2026-07-17 21:22
edit_tpriv.cgi
2.21
KB
-rwxr-xr-x
2026-07-17 21:22
edit_user.cgi
5.28
KB
-rwxr-xr-x
2026-07-17 21:22
edit_view.cgi
2.17
KB
-rwxr-xr-x
2026-07-17 21:22
exec.cgi
7.59
KB
-rwxr-xr-x
2026-07-17 21:22
exec_file.cgi
3.01
KB
-rwxr-xr-x
2026-07-17 21:22
exec_form.cgi
3.88
KB
-rwxr-xr-x
2026-07-17 21:22
import.cgi
2.25
KB
-rwxr-xr-x
2026-07-17 21:22
index.cgi
11.31
KB
-rwxr-xr-x
2026-07-17 21:22
install_check.pl
549
B
-rwxr-xr-x
2026-07-17 21:17
kill_procs.cgi
385
B
-rwxr-xr-x
2026-07-17 21:22
list_cprivs.cgi
2.21
KB
-rwxr-xr-x
2026-07-17 21:22
list_dbs.cgi
2.15
KB
-rwxr-xr-x
2026-07-17 21:22
list_hosts.cgi
1.76
KB
-rwxr-xr-x
2026-07-17 21:22
list_procs.cgi
1.42
KB
-rwxr-xr-x
2026-07-17 21:22
list_tprivs.cgi
2.03
KB
-rwxr-xr-x
2026-07-17 21:22
list_users.cgi
2.78
KB
-rwxr-xr-x
2026-07-17 21:22
list_vars.cgi
2.12
KB
-rwxr-xr-x
2026-07-17 21:22
log_parser.pl
3.32
KB
-rwxr-xr-x
2026-07-17 21:17
login.cgi
819
B
-rwxr-xr-x
2026-07-17 21:22
module.info
190
B
-rw-r--r--
2026-07-17 21:17
module.info.ar
0
B
-rw-r--r--
2026-07-17 21:17
module.info.ar.auto
211
B
-rw-r--r--
2026-07-17 21:17
module.info.bg
0
B
-rw-r--r--
2026-07-17 21:17
module.info.bg.auto
215
B
-rw-r--r--
2026-07-17 21:17
module.info.ca
127
B
-rw-r--r--
2026-07-17 21:17
module.info.ca.auto
14
B
-rw-r--r--
2026-07-17 21:17
module.info.cs
34
B
-rw-r--r--
2026-07-17 21:17
module.info.cs.auto
103
B
-rw-r--r--
2026-07-17 21:17
module.info.da
0
B
-rw-r--r--
2026-07-17 21:17
module.info.da.auto
127
B
-rw-r--r--
2026-07-17 21:17
module.info.de
127
B
-rw-r--r--
2026-07-17 21:17
module.info.de.auto
14
B
-rw-r--r--
2026-07-17 21:17
module.info.el
0
B
-rw-r--r--
2026-07-17 21:17
module.info.el.auto
226
B
-rw-r--r--
2026-07-17 21:17
module.info.es
40
B
-rw-r--r--
2026-07-17 21:17
module.info.es.auto
110
B
-rw-r--r--
2026-07-17 21:17
module.info.eu
0
B
-rw-r--r--
2026-07-17 21:17
module.info.eu.auto
134
B
-rw-r--r--
2026-07-17 21:17
module.info.fa
0
B
-rw-r--r--
2026-07-17 21:17
module.info.fa.auto
198
B
-rw-r--r--
2026-07-17 21:17
module.info.fi
0
B
-rw-r--r--
2026-07-17 21:17
module.info.fi.auto
140
B
-rw-r--r--
2026-07-17 21:17
module.info.fr
43
B
-rw-r--r--
2026-07-17 21:17
module.info.fr.auto
138
B
-rw-r--r--
2026-07-17 21:17
module.info.hr
0
B
-rw-r--r--
2026-07-17 21:17
module.info.hr.auto
153
B
-rw-r--r--
2026-07-17 21:17
module.info.hu
35
B
-rw-r--r--
2026-07-17 21:17
module.info.hu.auto
113
B
-rw-r--r--
2026-07-17 21:17
module.info.it
33
B
-rw-r--r--
2026-07-17 21:17
module.info.it.auto
102
B
-rw-r--r--
2026-07-17 21:17
module.info.ja
43
B
-rw-r--r--
2026-07-17 21:17
module.info.ja.auto
128
B
-rw-r--r--
2026-07-17 21:17
module.info.ko
40
B
-rw-r--r--
2026-07-17 21:17
module.info.ko.auto
128
B
-rw-r--r--
2026-07-17 21:17
module.info.ms
142
B
-rw-r--r--
2026-07-17 21:17
module.info.ms.auto
14
B
-rw-r--r--
2026-07-17 21:17
module.info.nl
30
B
-rw-r--r--
2026-07-17 21:17
module.info.nl.auto
98
B
-rw-r--r--
2026-07-17 21:17
module.info.no
29
B
-rw-r--r--
2026-07-17 21:17
module.info.no.auto
98
B
-rw-r--r--
2026-07-17 21:17
module.info.pl
140
B
-rw-r--r--
2026-07-17 21:17
module.info.pl.auto
103
B
-rw-r--r--
2026-07-17 21:17
module.info.pt
40
B
-rw-r--r--
2026-07-17 21:17
module.info.pt.auto
116
B
-rw-r--r--
2026-07-17 21:17
module.info.pt_BR
0
B
-rw-r--r--
2026-07-17 21:17
module.info.pt_BR.auto
166
B
-rw-r--r--
2026-07-17 21:17
module.info.ru
47
B
-rw-r--r--
2026-07-17 21:17
module.info.ru.auto
165
B
-rw-r--r--
2026-07-17 21:17
module.info.sk
0
B
-rw-r--r--
2026-07-17 21:17
module.info.sk.auto
141
B
-rw-r--r--
2026-07-17 21:17
module.info.sv
28
B
-rw-r--r--
2026-07-17 21:17
module.info.sv.auto
104
B
-rw-r--r--
2026-07-17 21:17
module.info.tr
35
B
-rw-r--r--
2026-07-17 21:17
module.info.tr.auto
110
B
-rw-r--r--
2026-07-17 21:17
module.info.uk
0
B
-rw-r--r--
2026-07-17 21:17
module.info.uk.auto
210
B
-rw-r--r--
2026-07-17 21:17
module.info.zh
33
B
-rw-r--r--
2026-07-17 21:17
module.info.zh.auto
92
B
-rw-r--r--
2026-07-17 21:17
module.info.zh_TW
36
B
-rw-r--r--
2026-07-17 21:17
module.info.zh_TW.auto
98
B
-rw-r--r--
2026-07-17 21:17
mysql-lib.pl
62.1
KB
-rwxr-xr-x
2026-07-17 21:17
newdb.cgi
1.07
KB
-rwxr-xr-x
2026-07-17 21:22
newdb_form.cgi
1.45
KB
-rwxr-xr-x
2026-07-17 21:22
postinstall.pl
211
B
-rw-r--r--
2026-07-17 21:17
prefs.info
69
B
-rw-r--r--
2026-07-17 21:17
restart.cgi
258
B
-rwxr-xr-x
2026-07-17 21:22
root_form.cgi
1.03
KB
-rwxr-xr-x
2026-07-17 21:22
save_cnf.cgi
3.59
KB
-rwxr-xr-x
2026-07-17 21:22
save_cpriv.cgi
2.67
KB
-rwxr-xr-x
2026-07-17 21:22
save_db.cgi
2.68
KB
-rwxr-xr-x
2026-07-17 21:22
save_field.cgi
4.72
KB
-rwxr-xr-x
2026-07-17 21:22
save_host.cgi
2.35
KB
-rwxr-xr-x
2026-07-17 21:22
save_index.cgi
1.39
KB
-rwxr-xr-x
2026-07-17 21:22
save_manual.cgi
526
B
-rwxr-xr-x
2026-07-17 21:22
save_root.cgi
1.04
KB
-rwxr-xr-x
2026-07-17 21:22
save_ssl.cgi
2.1
KB
-rwxr-xr-x
2026-07-17 21:22
save_sync.cgi
454
B
-rwxr-xr-x
2026-07-17 21:22
save_tpriv.cgi
2.6
KB
-rwxr-xr-x
2026-07-17 21:22
save_user.cgi
5.1
KB
-rwxr-xr-x
2026-07-17 21:22
save_vars.cgi
775
B
-rwxr-xr-x
2026-07-17 21:22
save_view.cgi
1.84
KB
-rwxr-xr-x
2026-07-17 21:22
search_form.cgi
1.38
KB
-rwxr-xr-x
2026-07-17 21:22
start.cgi
218
B
-rwxr-xr-x
2026-07-17 21:22
stop.cgi
203
B
-rwxr-xr-x
2026-07-17 21:22
syslog_logs.pl
1.61
KB
-rwxr-xr-x
2026-07-17 21:17
table_form.cgi
1.95
KB
-rwxr-xr-x
2026-07-17 21:22
useradmin_update.pl
2.6
KB
-rwxr-xr-x
2026-07-17 21:17
view-lib.pl
3.56
KB
-rwxr-xr-x
2026-07-17 21:17
view_table.cgi
15.16
KB
-rwxr-xr-x
2026-07-17 21:22
Save
Rename
#!/usr/bin/perl # exec.cgi # Execute some SQL command and display output require './mysql-lib.pl'; &ReadParseMime(); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); $access{'edonly'} && &error($text{'dbase_ecannot'}); &error_setup($text{'exec_err'}); $sql_charset = $in{'charset'}; # normalize_sql_for_history(command) # Collapse textarea SQL into a single history line. sub normalize_sql_for_history { my ($cmd) = @_; $cmd =~ s/\r//g; return join(" ", split(/\n+/, $cmd)); } # count_sql_terminators(sql) # Count semicolons in SQL text, skipping those inside single/double/backtick # quotes, line comments (# and --), and block comments (/* ... */). Used to # detect multi-statement input. Miscounts should not happen in practice but are # safe either way: on undercount, multi-statement SQL goes through the # single-statement path and fails visibly; on overcount, a single statement goes # through the file executor which handles it fine. sub count_sql_terminators { my ($sql) = @_; my $count = 0; my ($sq, $dq, $bq, $line_comment, $block_comment, $escaped); for (my $i = 0; $i < length($sql); $i++) { my $c = substr($sql, $i, 1); my $n = $i+1 < length($sql) ? substr($sql, $i+1, 1) : ''; if ($line_comment) { $line_comment = 0 if ($c eq "\n"); next; } if ($block_comment) { if ($c eq '*' && $n eq '/') { $block_comment = 0; $i++; } next; } if ($sq) { if ($c eq "\\" && !$escaped) { $escaped = 1; next; } $sq = 0 if ($c eq "'" && !$escaped); $escaped = 0; next; } if ($dq) { if ($c eq "\\" && !$escaped) { $escaped = 1; next; } $dq = 0 if ($c eq '"' && !$escaped); $escaped = 0; next; } if ($bq) { $bq = 0 if ($c eq '`'); next; } if ($c eq '#' ) { $line_comment = 1; next; } if ($c eq '-' && $n eq '-') { my $p = $i ? substr($sql, $i-1, 1) : ''; my $a = $i+2 < length($sql) ? substr($sql, $i+2, 1) : ''; if (($i == 0 || $p =~ /\s/) && ($a eq '' || $a =~ /\s/)) { $line_comment = 1; $i++; next; } } if ($c eq '/' && $n eq '*') { $block_comment = 1; $i++; next; } if ($c eq "'") { $sq = 1; $escaped = 0; next; } if ($c eq '"') { $dq = 1; $escaped = 0; next; } if ($c eq '`') { $bq = 1; next; } if ($c eq ';') { $count++; } } return $count; } # looks_like_sql_script(command) # Detect pasted SQL that should use the file-style script executor. sub looks_like_sql_script { my ($cmd) = @_; return 1 if ($cmd =~ /^\s*(?:delimiter|source|\\\.)\b/im); return 1 if ($cmd =~ /^\s*(?:--(?:\s|$)|#)/m); return &count_sql_terminators($cmd) > 1; } # execute_textarea_script(database, command) # Run pasted SQL through the same path used for uploaded script files. sub execute_textarea_script { my ($db, $cmd) = @_; my $file = &transname(); &open_tempfile(TEMP, ">$file"); &print_tempfile(TEMP, $cmd); &print_tempfile(TEMP, "\n") if ($cmd !~ /\n\z/); &close_tempfile(TEMP); my @rv = &execute_sql_file($db, $file, undef, undef, $access{'buser'}); &unlink_file($file); return @rv; } # summarize_sql_script(sql) # Count common DDL and DML actions for friendly success messages. sub summarize_sql_script { my ($sql) = @_; my %rv = ( 'create_count' => 0, 'insert_count' => 0 ); foreach my $line (split(/\n/, $sql)) { if ($line =~ /^\s*insert\s+into\s+`(\S+)`/i || $line =~ /^\s*insert\s+into\s+(\S+)/i) { $rv{'insert_count'}++; } if ($line =~ /^\s*create\s+table\s+`(\S+)`/i || $line =~ /^\s*create\s+table\s+(\S+)/i) { $rv{'create_count'}++; } } return \%rv; } # extract_execute_error_text(error) # Strip Webmin's wrapper text down to the database error itself. sub extract_execute_error_text { my ($err) = @_; $err =~ s/\s+at\s+\S+\s+line\s+\d+.*$//s; if ($err =~ /failed\s*:\s*<tt>(.*?)<\/tt>\s*$/s) { $err = $1; } elsif ($err =~ /failed\s*:\s*"([^"]+)"\s*$/s) { $err = $1; } elsif ($err =~ /failed\s*:\s*(.*?)\s*$/s) { $err = $1; } $err =~ s/<[^>]+>//g; # Normalize to plain text: undo any HTML escaping from shared helpers # so the caller can re-escape once at final display time. $err = &html_unescape($err); return $err; } # print_exec_status_lines(first, rest...) # Print one or more status lines with predictable wrapper spans. sub print_exec_status_lines { my ($first, @rest) = @_; print &ui_tag('span', $first, { 'data-first-print' => undef }); if (@rest) { print &ui_tag('br'); for (my $i = 0; $i < @rest; $i++) { print &ui_tag('span', $rest[$i], { 'data-second-print' => undef }); print &ui_tag('br') if ($i+1 < @rest); } } } # print_exec_error_block(first, second, detail) # Print a wrapped error block with a preformatted message body. sub print_exec_error_block { my ($first, $second, $detail) = @_; $detail = defined($detail) && $detail =~ /\S/ ? $detail : $text{'exec_noout'}; &print_exec_status_lines($first, $second); print &ui_tag('br'); print &ui_tag('pre', &html_escape($detail), { 'style' => 'white-space: pre-wrap; margin-left: 10px;' }); } if ($in{'clear'}) { # Delete the history file &unlink_file($commands_file.".".$in{'db'}); &redirect("exec_form.cgi?db=$in{'db'}"); } else { # Run some SQL $rawcmd = defined($in{'cmd'}) ? $in{'cmd'} : undef; defined($rawcmd) && $rawcmd =~ /\S/ || &error($text{'exec_ecmd'}); $rawcmd =~ s/\r//g; $cmd = &normalize_sql_for_history($rawcmd); # Multi-statement input uses the same executor as uploaded SQL files. $script = &looks_like_sql_script($rawcmd); if ($script) { ($ex, $out) = &execute_textarea_script($in{'db'}, $rawcmd); $summary = &summarize_sql_script($rawcmd); &ui_print_header(undef, $text{'exec_title'}, ""); if ($ex) { &print_exec_error_block($text{'exec_scriptout'}, $text{'exec_scriptfailed'}, $out); } else { @lines = ( ); if ($summary->{'create_count'}) { push(@lines, &text('exec_scriptcreated', $summary->{'create_count'})); } if ($summary->{'insert_count'}) { push(@lines, &text('exec_scriptinserted', $summary->{'insert_count'})); } if (!@lines) { push(@lines, $text{'exec_scriptok'}); } &print_exec_status_lines($text{'exec_scriptout'}, @lines); print "<p>\n"; } } else { eval { local $main::error_must_die = 1; # Capture DBI/mysql errors so we can render them consistently. $d = &execute_sql_logged($in{'db'}, $cmd); }; if ($@) { $failed = 1; $err = &extract_execute_error_text($@); &ui_print_header(undef, $text{'exec_title'}, ""); &print_exec_error_block($text{'exec_cmdout'}, $text{'exec_cmdfailed'}, $err); } else { @data = @{$d->{'data'}}; &ui_print_header(undef, $text{'exec_title'}, ""); if (@data) { print &text('exec_out', "<tt>".&html_escape($cmd)."</tt>"),"<p>\n"; print &ui_columns_start($d->{'titles'}); foreach $r (@data) { print &ui_columns_row([ map { &html_escape($_) } @$r ]); } print &ui_columns_end(); } else { &print_exec_status_lines($text{'exec_cmdout'}, $text{'exec_cmdok'}); print "<p>\n"; } } } &open_readfile(OLD, "$commands_file.$in{'db'}"); while(<OLD>) { s/\r|\n//g; $already++ if ($_ eq $cmd); } close(OLD); # Only store successful single commands in history. Script runs are # intentionally left out to avoid flattening multi-line SQL for re-use. if (!$script && !$failed && !$already && $cmd =~ /\S/) { &open_lock_tempfile(OLD, ">>$commands_file.$in{'db'}"); &print_tempfile(OLD, "$cmd\n"); &close_tempfile(OLD); chmod(0700, "$commands_file.$in{'db'}"); } &webmin_log("exec", undef, $in{'db'}, \%in); &ui_print_footer("exec_form.cgi?db=$in{'db'}", $text{'exec_return'}, "edit_dbase.cgi?db=$in{'db'}", $text{'dbase_return'}, &get_databases_return_link($in{'db'}), $text{'index_return'}); }