Skip to content

Commit 3a21710

Browse files
committed
Implemented: FS#2326 - Extend vlogger to check for symlinks
1 parent a505fde commit 3a21710

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

server/scripts/vlogger

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ if ( $OPTS{'h'} || !$ARGV[0] ) {
171171
# log directory
172172
my $LOGDIR;
173173
if ( $ARGV[0] ) {
174-
if ( !-d $ARGV[0] ) {
174+
if ( !-d $ARGV[0] || -l $ARGV[0]) {
175175
print STDERR
176-
"[vlogger] target directory $ARGV[0] does not exist - exiting.\n\n";
176+
"[vlogger] target directory $ARGV[0] does not exist or is a symlink - exiting.\n\n";
177177
exit;
178178
}
179179
$LOGDIR = $ARGV[0];
@@ -429,6 +429,11 @@ else {
429429
unless ( -d "${vhost}" ) {
430430
mkdir("${vhost}");
431431
}
432+
433+
# Dont log to symlinks
434+
if( -l "${vhost}/".time2str( $TEMPLATE, time() ) ) {
435+
die("Log target is a symlink: $LOGDIR/${vhost}/".time2str( $TEMPLATE, time() ));
436+
}
432437

433438
# open the file using the template
434439
open $vhost, ">>${vhost}/" . time2str( $TEMPLATE, time() )

0 commit comments

Comments
 (0)