patch-1.3.60 linux/fs/inode.c
Next file: linux/fs/isofs/inode.c
Previous file: linux/fs/filesystems.c
Back to the patch index
Back to the overall index
- Lines: 41
- Date:
Wed Feb 7 13:44:42 1996
- Orig file:
v1.3.59/linux/fs/inode.c
- Orig date:
Sun Jan 14 16:30:12 1996
diff -u --recursive --new-file v1.3.59/linux/fs/inode.c linux/fs/inode.c
@@ -244,6 +244,13 @@
/* POSIX UID/GID verification for setting inode attributes */
int inode_change_ok(struct inode *inode, struct iattr *attr)
{
+ /*
+ * If force is set do it anyway.
+ */
+
+ if (attr->ia_valid & ATTR_FORCE)
+ return 0;
+
/* Make sure a caller can chown */
if ((attr->ia_valid & ATTR_UID) &&
(current->fsuid != inode->i_uid ||
@@ -273,8 +280,6 @@
if ((attr->ia_valid & ATTR_MTIME_SET) &&
((current->fsuid != inode->i_uid) && !fsuser()))
return -EPERM;
-
-
return 0;
}
@@ -315,13 +320,12 @@
{
int retval;
- if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME)) {
- unsigned long now = CURRENT_TIME;
+ attr->ia_ctime = CURRENT_TIME;
+ if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME)) {
if (!(attr->ia_valid & ATTR_ATIME_SET))
- attr->ia_atime = now;
+ attr->ia_atime = attr->ia_ctime;
if (!(attr->ia_valid & ATTR_MTIME_SET))
- attr->ia_mtime = now;
- attr->ia_ctime = now;
+ attr->ia_mtime = attr->ia_ctime;
}
if (inode->i_sb && inode->i_sb->s_op &&
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this