I am trying to hook unlinkat.my hooking function.
but i get only file name instead of absolute path.so i want absolute path to compare string.when i try rm -r than i get only file name if i get absolute path then it works.so please tell me how i get absolute path.
my code is
long mw_sys_unlink(int dfd, const char *filename ,int flag)
{
long ret;
if( strstr(filename,"/tmp/a/"))
{
printk(KERN_INFO "file %s has not been deleted by kernel module\n", filename);
return -1;
}
else
{
ret = orig_sys_unlink(dfd ,filename,flag);
printk(KERN_INFO "file %s has been deleted", filename);
return ret;
}
}