Commit 3c31f49e authored by Patrick Mochel's avatar Patrick Mochel

Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
parents b12cf4ff 9de88958
......@@ -908,7 +908,7 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive,
ide_set_handler(drive, handler, rq->timeout, cdrom_timer_expiry);
/* ATAPI commands get padded out to 12 bytes minimum */
cmd_len = rq->cmd_len;
cmd_len = COMMAND_SIZE(rq->cmd[0]);
if (cmd_len < ATAPI_MIN_CDB_BYTES)
cmd_len = ATAPI_MIN_CDB_BYTES;
......
......@@ -994,16 +994,16 @@ static void time_out_leases(struct inode *inode)
}
/**
* __get_lease - revoke all outstanding leases on file
* __break_lease - revoke all outstanding leases on file
* @inode: the inode of the file to return
* @mode: the open mode (read or write)
*
* get_lease (inlined for speed) has checked there already
* break_lease (inlined for speed) has checked there already
* is a lease on this file. Leases are broken on a call to open()
* or truncate(). This function can sleep unless you
* specified %O_NONBLOCK to your open().
*/
int __get_lease(struct inode *inode, unsigned int mode)
int __break_lease(struct inode *inode, unsigned int mode)
{
int error = 0, future;
struct file_lock *new_fl, *flock;
......
......@@ -1183,7 +1183,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
/*
* Ensure there are no outstanding leases on the file.
*/
error = get_lease(inode, flag);
error = break_lease(inode, flag);
if (error)
return error;
......
......@@ -259,7 +259,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
* If we are changing the size of the file, then
* we need to break all leases.
*/
err = get_lease(inode, FMODE_WRITE);
err = break_lease(inode, FMODE_WRITE);
if (err)
goto out_nfserr;
......@@ -453,7 +453,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
* Check to see if there are any leases on this file.
* This may block while leases are broken.
*/
err = get_lease(inode, (access & MAY_WRITE) ? FMODE_WRITE : 0);
err = break_lease(inode, (access & MAY_WRITE) ? FMODE_WRITE : 0);
if (err)
goto out_nfserr;
......
......@@ -131,7 +131,7 @@ static inline long do_sys_truncate(const char * path, loff_t length)
/*
* Make sure that there are no leases.
*/
error = get_lease(inode, FMODE_WRITE);
error = break_lease(inode, FMODE_WRITE);
if (error)
goto dput_and_out;
......
......@@ -578,7 +578,7 @@ extern int posix_lock_file(struct file *, struct file_lock *);
extern void posix_block_lock(struct file_lock *, struct file_lock *);
extern void posix_unblock_lock(struct file *, struct file_lock *);
extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
extern int __get_lease(struct inode *inode, unsigned int flags);
extern int __break_lease(struct inode *inode, unsigned int flags);
extern void lease_get_mtime(struct inode *, struct timespec *time);
extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
......@@ -1052,10 +1052,10 @@ static inline int locks_verify_truncate(struct inode *inode,
return 0;
}
static inline int get_lease(struct inode *inode, unsigned int mode)
static inline int break_lease(struct inode *inode, unsigned int mode)
{
if (inode->i_flock && (inode->i_flock->fl_flags & FL_LEASE))
return __get_lease(inode, mode);
if (inode->i_flock)
return __break_lease(inode, mode);
return 0;
}
......
......@@ -54,15 +54,15 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
spin_lock(&task_capability_lock);
read_lock(&tasklist_lock);
if (pid && pid != current->pid) {
target = find_task_by_pid(pid);
if (!target) {
ret = -ESRCH;
goto out;
}
} else
target = current;
data.permitted = cap_t(target->cap_permitted);
data.inheritable = cap_t(target->cap_inheritable);
data.effective = cap_t(target->cap_effective);
ret = security_ops->capget(target, &data.effective, &data.inheritable, &data.permitted);
out:
......
......@@ -287,7 +287,7 @@ EXPORT_SYMBOL(page_follow_link);
EXPORT_SYMBOL(page_symlink_inode_operations);
EXPORT_SYMBOL(page_symlink);
EXPORT_SYMBOL(vfs_readdir);
EXPORT_SYMBOL(__get_lease);
EXPORT_SYMBOL(__break_lease);
EXPORT_SYMBOL(lease_get_mtime);
EXPORT_SYMBOL(lock_may_read);
EXPORT_SYMBOL(lock_may_write);
......
......@@ -27,6 +27,17 @@ static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
static int dummy_capget (struct task_struct *target, kernel_cap_t * effective,
kernel_cap_t * inheritable, kernel_cap_t * permitted)
{
*effective = *inheritable = *permitted = 0;
if (!issecure(SECURE_NOROOT)) {
if (target->euid == 0) {
*permitted |= (~0 & ~CAP_FS_MASK);
*effective |= (~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_FS_MASK);
}
if (target->fsuid == 0) {
*permitted |= CAP_FS_MASK;
*effective |= CAP_FS_MASK;
}
}
return 0;
}
......@@ -35,7 +46,7 @@ static int dummy_capset_check (struct task_struct *target,
kernel_cap_t * inheritable,
kernel_cap_t * permitted)
{
return 0;
return -EPERM;
}
static void dummy_capset_set (struct task_struct *target,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment