Ticket #3537: 0001-iso9660-dotfiles.patch

File 0001-iso9660-dotfiles.patch, 1.1 KB (added by vda, 9 years ago)

patch

  • src/vfs/extfs/helpers/iso9660.in

    From cc38e115badb68c53de19147c2e0512f3373d32e Mon Sep 17 00:00:00 2001
    From: Denys Vlasenko <vda.linux@googlemail.com> 
    Subject: [PATCH] isofs fix: do not skip all .dotfiles
    
    There is a simple bug in iso9660 helper:
    
        if (name ~ /^\.\.?/) next
    
    means "skip all lines which start with one or two dots".
    Author probably meant:
    
        if (name ~ /^\.\.?$/) next
    
    I propose to not be cryptic and just check both possibilities separately.
    
    The below trivial patch was tested to work: now I see
    the file named ".dot" in a test iso file.
    
    Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> 
    ---
     src/vfs/extfs/helpers/iso9660.in | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/vfs/extfs/helpers/iso9660.in b/src/vfs/extfs/helpers/iso9660.in
    index fd652b8..a7c891c 100644
    a b BEGIN { 
    156156  if (SEMICOLON = "YES") sub(";1$", "", name); 
    157157  ## sub(";[0-9]+$", "", name) ## would break copyout 
    158158  # skip . and .. 
    159   if (name ~ /^\.\.?/) next; 
     159  if (name == ".") next; 
     160  if (name == "..") next; 
    160161  printf "%s%s%s\n", attr, dir, name 
    161162}' 
    162163}