source:
MondoRescue/tags/3.0.1/mindi-busybox/examples/linux-2.6.30_proc_self_exe.patch@
3492
Last change on this file since 3492 was 2725, checked in by , 14 years ago | |
---|---|
File size: 966 bytes |
-
fs/exec.c
This patch makes /proc/self/exe executable even if proc is not mounted. It is especially useful on NOMMU arches. diff -urp ../linux-2.6.30.org/fs/exec.c linux-2.6.30/fs/exec.c
old new struct file *open_exec(const char *name) 652 652 file = do_filp_open(AT_FDCWD, name, 653 653 O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, 654 654 MAY_EXEC | MAY_OPEN); 655 if (IS_ERR(file)) 656 goto out; 655 if (IS_ERR(file)) { 656 if ((PTR_ERR(file) == -ENOENT || PTR_ERR(file) == -EACCES) 657 && strcmp(name, "/proc/self/exe") == 0 658 ) { 659 struct file *sv = file; 660 struct mm_struct *mm; 657 661 662 mm = get_task_mm(current); 663 if (!mm) 664 goto out; 665 file = get_mm_exe_file(mm); 666 mmput(mm); 667 if (file) 668 goto ok; 669 file = sv; 670 } 671 goto out; 672 } 673 ok: 658 674 err = -EACCES; 659 675 if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) 660 676 goto exit;
Note:
See TracBrowser
for help on using the repository browser.