I am using LSM hook to intercept exec system call to print the path of the executable being executed. On Debian with default partitioning options, the path of the executable is absolute path. But on Debian with multiple partions having separate mount points for tmp, home var etc, the first parent directory is truncated. For example a file in /tmp/abc.sh is appearing as abc.sh. Same is the case with other mount points. In this scenario, how can I get the absolute path?
absolute path of executable in multipartition Linux
137 Views Asked by incompetent At
1
There are 1 best solutions below
Related Questions in LINUX-KERNEL
- kernel module does not print packet info
- android linux kernel communicate with user space about NETLINK_USER
- How to offload NAPI poll function to workqueue
- Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?
- Bootloader in Assembly with Linux kernel
- pktgen not sending packets more than 1kb big
- Use static analysis tools to check null pointers and memory leaks in Linux device drivers
- How to build Linux kernel to support SO_ATTACH_BPF socket option?
- How do I know the last sched time of a process
- linux kernel compile error....udevd[63]: error getting socket
- Process in background mode trying to read from stdin
- board firmware update through uefi capsule feature from Linux
- spin_lock before writing status register
- Kernel module configuration locked built in?
- Install Subversion 1.7 on Debian jessie
Related Questions in EXEC
- python forked processes not executing with os.execlp
- Calling Python file from within PHP
- Run local executable from a remote PHP application
- Client/server: running "nano editor" command from client
- Running multiple exec commands and waiting to finish before continuing
- How to use Maven exec plugin in Eclipse?
- execute php script in command line from web page
- How to run iperf command properly in Runtime.getRuntime().exec() android
- Gradle Exec : Why it is not running in configuration phase?
- Slimerjs with exec linux centos 6
- php shell_exec and exec doesn't work with shell script
- empty line appears while merging different file contents in shell script
- Use find exec with sed to replace part of file name and copy it
- Passing int using char pointer in C
- Exec command in Ant only executes first command
Related Questions in PARTITION
- cut vector according to NaN values
- Hive external table not showing partitions
- Calculate number of groups and group size with multiple criteria
- Add PARTITION after creating TABLE in hive
- Create an external table in HIVE with multiple sources
- How to sample/partition panel data by individuals( preferably with caret library)?
- r: how to partition a list or vector into pairs at an offset of 1
- Detect bitlocker partition state using delphi
- Recursion in Java - Partition theory
- Why Google BigQuery doesn't use partition date correctly when using views
- When does HIVE (not) use WHERE clause on partition as predicate filter
- How to store bool result of a CUDA kernel function
- Set the right partitions for Crate Database
- Get column of table for results having sum(a_int)=0 and order by date and group by another column
- How can I parallel execute sql for MySQL partition table each partition
Related Questions in LINUX-SECURITY-MODULE
- Monitoring Linux logs for an ec2 instance
- How to determine LSM hook from a syscall?
- Dynamically loadable Linux security modules
- Security for setns system call
- Get argv from bprm_check_security in linux kernel. Is the documentation wrong?
- Why Linux kernel LSM_HOOK macro is defined with many parameters?
- Kernel security modules: i_security in struct inode
- Is it possible to do it using eBPF? I.e., Can I capture the event before the file is deleted. And take back up
- Detection of python ,perl or java in linux system
- Stop user from running malicious python code in online compilers
- absolute path of executable in multipartition Linux
- How to get SECMARK work on Ubuntu 18.04 or centOS 7.7
- LSM-Howto: Kernelmodule with non exported functions
- Implementing LSM hook bprm_check_security
- How do I register a security module with register_security on linux-kernel 4.18?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
First, You cannot get absolute path in any LSM hook. Only necessary data (eg: structures, pointers, flags etc) are passed. Furthermore, everything sent is const, so you don't corrupt anything accidentally. Secondly, mapping of partition base paths vary with partitioning schemes. Last, It's absolutely not a good way to execute things from /tmp directory. Try to place your binaries in appropriate locations.