Re: symlink hook arguments

From: magniett (Frederic.Magnietteat_private)
Date: Thu Dec 19 2002 - 11:24:49 PST

  • Next message: magniett: "symlink hook arguments"

    magniett a écrit :
    
    > Hi,
    >
    > in the inode_symlink, the original file is given by a name (char *). Do
    > you know how to get the inode of that file
    > if the calling process is chrooted? in other words, does
    > user_path_walk_link take care about the chroot of the calling
    > process?
    >
    > thanks by advance
    > Fred
    
    ok please forget this question.
    I add some information for people who want to do some check on filenames :
    
    in the symlink hook, the name is still in a kernel buffer when passed to
    the hooks.
    Thus __user_walk dont work at all because it try to call getname.
    Instead you can use a code like :
    
    struct nameidata nd;
    if (path_init(filename,LOOKUP_FOLLOW|LOOKUP_POSITIVE,&nd))
      error=path_walk(filename,&nd);
    
    ..check error and do what you want with your nameidata then
    
    path_release(&nd);
    
    that's all
    Have a good day
    Fred
    
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Thu Dec 19 2002 - 19:28:11 PST