lkml.org 
[lkml]   [2004]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectGetting full path from dentry in LSM hooks
    Hi!

    I have a short question, concerning how to get the full path of a file
    from a LSM hook.

    - If the "file" of the dentry is located in the root filesystem: no
    problem - simply traverse the dentrys, to generate the path.

    - If the "file" is mounted from another partition, you do not get the
    full path by traversing the dentrys.

    Example:
    If we have a system with a normal root (/) and a seperate boot partition
    (mounted on /boot :). In the LSM hook inode_permission, you get the
    arguments (struct inode *inode, int mask, struct nameidata *nd).
    Finding the path, we traverse the dentrys from (nd->dentry). But if the
    inode is a file in /boot we only get the filename (e.g. kernel-2.6.8.1
    instead of /boot/kernel-2.6.8.1)


    Can some one reveal the trick to get the full path nomater if the
    filesystem is root or mounted elsewhere in the filesystem?


    Best regards,
    Kristian Sørensen.
    The Umbrella Project -- http://umbrella.sf.net
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:05    [W:0.048 / U:31.980 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site