Skip to content
  • Greg Kurz's avatar
    4be56c19
    fsdev: fix virtfs-proxy-helper cwd · 4be56c19
    Greg Kurz authored
    
    
    Since chroot() doesn't change the current directory, it is indeed a good
    practice to chdir() to the target directory and then then chroot(), or
    to chroot() to the target directory and then chdir("/").
    
    The current code does neither of them actually. Let's go for the latter.
    
    This doesn't fix any security issue since all of this takes place before
    the helper begins to process requests.
    
    Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    4be56c19
    fsdev: fix virtfs-proxy-helper cwd
    Greg Kurz authored
    
    
    Since chroot() doesn't change the current directory, it is indeed a good
    practice to chdir() to the target directory and then then chroot(), or
    to chroot() to the target directory and then chdir("/").
    
    The current code does neither of them actually. Let's go for the latter.
    
    This doesn't fix any security issue since all of this takes place before
    the helper begins to process requests.
    
    Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Loading