Skip to contentSkip to conversation

sexattr and getxattr

DISCUSSION Jaspreet Singh 1 participant 1 message Nov 1, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

I have some trouble with using inode->i_op->get/setxattrs ...

I used getxattr and setxattr from linux/fs.h (kernel 2.6.8 and ext3) to get and set xattrs in the following manner -

getxattr from /home and set it to /var/home

ls -Zd /home /var/home

drwxr-xr-x+ root     root  system_u:object_r:home_root_t    /home/
drwxr-xr-x+ root     root  system_u:object_r:home_root_t    /var/home/

perfect till now .. but now when i try and create files inside /var/home they get the "root:object_r:var_t" unlike /home where i get "root:object_r:user_home_dir_t" :-(

and on the contrary if i create /var/home and tag with "home_root_t" using setfiles it works perfectly fine ... any clues

I cant use user-space get/setxattr coz I am writing a overlay file-system ... so ....

any suggestions ....

Jaspreet Singh

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.