/usr/share/usermin
NameSizeModeActions
at/-0755rm
authentic-theme/-0755rm
blue-theme/-0755rm
changepass/-0755rm
chfn/-0755rm
commands/-0755rm
cron/-0755rm
cshrc/-0755rm
fetchmail/-0755rm
filemin/-0755rm
filter/-0755rm
forward/-0755rm
gnupg/-0755rm
gray-theme/-0755rm
htaccess/-0755rm
htaccess-htpasswd/-0755rm
images/-0755rm
lang/-0755rm
language/-0755rm
mailbox/-0755rm
mailcap/-0755rm
man/-0755rm
mysql/-0755rm
plan/-0755rm
postgresql/-0755rm
proc/-0755rm
procmail/-0755rm
quota/-0755rm
schedule/-0755rm
shell/-0755rm
spam/-0755rm
ssh/-0755rm
theme/-0755rm
tunnel/-0755rm
twofactor/-0755rm
ulang/-0755rm
unauthenticated/-0755rm
updown/-0755rm
usermount/-0755rm
vendor_perl/-0755rm
xterm/-0755rm
acl_security.pl29590755editdlrm
chooser.cgi73870755editdlrm
config-aix2270644editdlrm
config-cobalt-linux2640644editdlrm
config-coherent-linux2640644editdlrm
config-corel-linux2640644editdlrm
config-debian-linux2640644editdlrm
config-freebsd2560644editdlrm
config-generic-linux2640644editdlrm
config-gentoo-linux2640644editdlrm
config-hpux2430644editdlrm
config-irix2840644editdlrm
config-lib.pl121200755editdlrm
config-macos2600644editdlrm
config-mandrake-linux2780644editdlrm
config-msc-linux2640644editdlrm
config-netbsd2830644editdlrm
config-open-linux2640644editdlrm
config-openbsd2410644editdlrm
config-openmamba-linux2640644editdlrm
config-openserver2360644editdlrm
config-osf12660644editdlrm
config-redhat-linux2640644editdlrm
config-slackware-linux2800644editdlrm
config-sol-linux2640644editdlrm
config-solaris4170644editdlrm
config-suse-linux2640644editdlrm
config-trustix-linux2640644editdlrm
config-turbo-linux2640644editdlrm
config-united-linux2640644editdlrm
config-unixware2860644editdlrm
copyconfig.pl44360755editdlrm
date_chooser.cgi22410755editdlrm
deb-name80644editdlrm
defaultacl980644editdlrm
defaulttheme160644editdlrm
entities_map.txt15010644editdlrm
favicon.ico150860644editdlrm
feedback.cgi65190755editdlrm
feedback_form.cgi35330755editdlrm
group_chooser.cgi76900755editdlrm
help.cgi23130755editdlrm
html-editor-lib.pl181470644editdlrm
index.cgi57810755editdlrm
install-module.pl13040755editdlrm
install-type40644editdlrm
javascript-lib.pl150420755editdlrm
lang_list.txt25700644editdlrm
LICENCE15160644editdlrm
LICENCE.ja16540644editdlrm
maketemp.pl4240755editdlrm
mime.types127130644editdlrm
miniserv.pem29690644editdlrm
miniserv.pl1894390755editdlrm
newmods.pl12800755editdlrm
oschooser.pl46550755editdlrm
os_list.txt358250644editdlrm
pam_login.cgi44290755editdlrm
password_change.cgi71920755editdlrm
password_form.cgi13270755editdlrm
perlpath.pl5710755editdlrm
README19720644editdlrm
robots.txt260644editdlrm
session_login.cgi52300755editdlrm
setup.sh268100755editdlrm
switch_user.cgi4040755editdlrm
thirdparty.pl17740755editdlrm
uconfig.cgi14280755editdlrm
uconfig_save.cgi14900755editdlrm
ui-lib.pl1159450755editdlrm
update-from-repo.sh151240755editdlrm
updateboot.pl24290755editdlrm
uptracker.cgi29560755editdlrm
usermin-init19270755editdlrm
usermin-pam1010644editdlrm
usermin-pam-osx2430644editdlrm
usermin-systemd4430644editdlrm
user_chooser.cgi75710755editdlrm
version60644editdlrm
web-lib-funcs.pl4051600755editdlrm
web-lib.pl9070755editdlrm
webmin-search-lib.pl96970755editdlrm
WebminCore.pm88730644editdlrm
webmin_search.cgi26970755editdlrm
Edit: /usr/share/usermin/chooser.cgi (7387B)
#!/usr/bin/perl # chooser.cgi # Outputs HTML for a frame-based file chooser BEGIN { push(@INC, "."); }; use WebminCore; @icon_map = ( "c", "text.gif", "txt", "text.gif", "pl", "text.gif", "cgi", "text.gif", "html", "text.gif", "htm", "text.gif", "php", "text.gif", "php5", "text.gif", "gif", "image.gif", "jpg", "image.gif", "jpeg", "image.gif", "png", "image.gif", "tar", "binary.gif" ); &init_config(); if (&get_product_name() eq 'usermin') { &switch_to_remote_user(); } %access = &get_module_acl(); # Work out root directory local @uinfo = getpwnam($remote_user); if (!$access{'root'}) { $rootdir = $uinfo[7] ? $uinfo[7] : "/"; } else { $rootdir = $access{'root'}; $rootdir =~ s/^\~/$uinfo[7]/; } # Switch to correct Unix user if (&supports_users()) { if (&get_product_name() eq 'usermin') { # Always run as Usermin login &switch_to_remote_user(); } else { # ACL determines $fileunix = $access{'fileunix'} || $remote_user; @uinfo = getpwnam($fileunix); if (!@uinfo && !$access{'fileunix'}) { @uinfo = getpwnam("nobody"); } if (@uinfo) { &switch_to_unix_user(\@uinfo); } } } &ReadParse(undef, undef, 1); # If a chroot is forced which is under the allowed root, there is no need for # a restrictred root if ($in{'chroot'} && $in{'chroot'} ne '/' && $rootdir && $rootdir ne '/' && $in{'chroot'} =~ /^\Q$rootdir\E/) { $rootdir = undef; } if ($gconfig{'os_type'} eq 'windows') { # On Windows, chroot should be empty if not use, and default path # should be c:/ if ($in{'chroot'} eq "/") { $in{'chroot'} = ""; } if ($rootdir eq "/") { $rootdir = "c:"; } } if ($in{'add'}) { # Only use last filename by default $in{'file'} =~ s/\s+$//; if ($in{'file'} =~ /\n(.*)$/) { $in{'file'} = $1; } } if ($in{'file'} =~ /^(([a-z]:)?.*\/)([^\/]*)$/i && $in{'file'} !~ /\.\./) { # File entered is valid $dir = $1; $file = $3; } else { # Fall back to default $dir = $rootdir; $dir .= '/' if ($dir !~ /\/$/); $file = ""; } $add = int($in{'add'}); if (!(-d $in{'chroot'}.$dir)) { # Entered directory does not exist $dir = $rootdir.'/'; $file = ""; } if (!&allowed_dir($dir)) { # Directory is outside allowed root $dir = $rootdir.'/'; $file = ""; } # Work out the top allowed dir $topdir = $rootdir eq "/" || $rootdir eq "c:" ? $rootdir : $access{'otherdirs'} ? "/" : $rootdir; $uchroot = &urlize($in{'chroot'}); $utype = &urlize($in{'type'}); $ufile = &urlize($in{'file'}); if ($in{'frame'} == 0) { # base frame &PrintHeader(); if ($in{'type'} == 0) { print "$text{'chooser_title1'}\n"; } elsif ($in{'type'} == 1) { print "$text{'chooser_title2'}\n"; } print "\n"; print "\n"; print "\n"; print "\n"; } elsif ($in{'frame'} == 1) { # List of files in this directory &popup_header(); print < function fileclick(f, d) { curr = top.frames[1].document.forms[0].elements[1].value; if (curr == f) { // Double-click! Enter directory or select file if (d) { // Enter this directory location = "chooser.cgi?frame=1&add=$add&chroot=$uchroot&type=$utype&file="+f+"/"; } else { // Select this file and close the window if ($add == 0) { top.opener.ifield.value = f; } else { if (top.opener.ifield.value != "") { top.opener.ifield.value += "\\n"; } top.opener.ifield.value += f; } top.close(); } } else { top.frames[1].document.forms[0].elements[1].value = f; } } function parentdir(p) { top.frames[1].document.forms[0].elements[1].value = p; location = "chooser.cgi?frame=1&chroot=$uchroot&type=$utype&file="+p; } EOF print ""; print "",&text('chooser_dir', &html_escape($dir)),"\n"; $ok = opendir(DIR, $in{'chroot'}.$dir); &popup_error(&text('chooser_eopen', "$!")) if (!$ok && !$in{'chroot'}); print &ui_columns_start(undef, 100); my $cnt = 0; foreach $f (sort { $a cmp $b } readdir(DIR)) { $path = "$in{'chroot'}$dir$f"; if ($f eq ".") { next; } if ($f eq ".." && ($dir eq "/" || $dir eq $topdir.'/')) { next; } if ($f =~ /^\./ && $f ne ".." && $access{'nodot'}) { next; } if (!(-d $path) && $in{'type'} == 1) { next; } @st = stat($path); $isdir = 0; undef($icon); if (-d $path) { $icon = "dir.gif"; $isdir = 1; } elsif ($path =~ /\.([^\.\/]+)$/) { $icon = $icon_map{$1}; } if (!$icon) { $icon = "unknown.gif"; } if ($f eq "..") { $dir =~ /^(.*\/)[^\/]+\/$/; $link = ""; } else { $link = ""; } local @cols; push(@cols, "$link"); push(@cols, "$link".&html_escape($f).""); push(@cols, &nice_size($st[7])); @tm = localtime($st[9]); push(@cols, sprintf "%.2d/%s/%.4d", $tm[3], $text{'smonth_'.($tm[4]+1)}, $tm[5]+1900); push(@cols, sprintf "%.2d:%.2d", $tm[2], $tm[1]); print &ui_columns_row(\@cols); $cnt++; } closedir(DIR); print &ui_columns_end(); if ( $cnt >= 10 ) { print ""; print ""; } &popup_footer(); } elsif ($in{'frame'} == 2) { # Current file and OK/cancel buttons &popup_header(); print < function filechosen() { if ($add == 0) { top.opener.ifield.value = document.forms[0].path.value; } else { if (top.opener.ifield.value != "") { top.opener.ifield.value += "\\n"; } top.opener.ifield.value += document.forms[0].path.value; } top.close(); } EOF print &ui_form_start(undef, undef, undef, "onSubmit='filechosen(); return false'"); print &ui_table_start(undef, "width=100%", 2); print &ui_table_row(&ui_submit($text{'chooser_ok'}), &ui_textbox("path", $dir.$file, 45, 0, undef, "style='width:100%'"), 1,["width=5% valign=middle nowrap","valign=middle width=95%"]); print &ui_table_end(); print &ui_form_end(); &popup_footer(); } # allowed_dir(dir) # Returns 1 if some directory should be listable sub allowed_dir { local ($dir) = @_; return 1 if ($rootdir eq "" || $rootdir eq "/" || $rootdir eq "c:"); foreach my $allowed ($rootdir, split(/\t+/, $access{'otherdirs'})) { return 1 if (&is_under_directory($allowed, $dir)); } return 0; }