Btrfs: align offsets for btrfs_ordered_update_i_size
[safe/jmp/linux-2.6] / fs / binfmt_misc.c
index 7562053..c4e8353 100644 (file)
@@ -117,11 +117,9 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                goto _ret;
 
        retval = -ENOEXEC;
-       if (bprm->misc_bang)
+       if (bprm->recursion_depth > BINPRM_MAX_RECURSION)
                goto _ret;
 
-       bprm->misc_bang = 1;
-
        /* to keep locking time low, we copy the interpreter string */
        read_lock(&entries_lock);
        fmt = check_file(bprm);
@@ -199,6 +197,8 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        if (retval < 0)
                goto _error;
 
+       bprm->recursion_depth++;
+
        retval = search_binary_handler (bprm, regs);
        if (retval < 0)
                goto _error;
@@ -496,9 +496,6 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
 
        if (inode) {
                inode->i_mode = mode;
-               inode->i_uid = 0;
-               inode->i_gid = 0;
-               inode->i_blocks = 0;
                inode->i_atime = inode->i_mtime = inode->i_ctime =
                        current_fs_time(inode->i_sb);
        }
@@ -652,7 +649,7 @@ static const struct file_operations bm_register_operations = {
 static ssize_t
 bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
 {
-       char *s = enabled ? "enabled" : "disabled";
+       char *s = enabled ? "enabled\n" : "disabled\n";
 
        return simple_read_from_buffer(buf, nbytes, ppos, s, strlen(s));
 }