lkml.org 
[lkml]   [1996]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectQUOTA [with patch this time]


Ok, I decided to jump into the source and actually make a patch.
This (should) only let the owner hardlink a file IFF the file resides
on a filesystem with disk quotas.

Hey, don't try this on your ISP until someone who knows VFS better then me
ok's it, but it compiles cleanly at least. ;-)

Alan: Does this look like it does what I think it is supposed to? ;-)

I'm making the assumption that do_link is running as the user (current->fsuid
= the uid of the calling process)

Also from what I understand, only filesystems with inode->i_sb->dq_op
existant have quota enabled.

--Dan

--- orig-2.0.27/fs/namei.c Fri Sep 20 10:00:35 1996
+++ linux/fs/namei.c Fri Dec 13 20:52:57 1996
@@ -803,8 +803,14 @@
return -EPERM;
}
dir->i_count++;
- if (dir->i_sb && dir->i_sb->dq_op)
+ if (dir->i_sb && dir->i_sb->dq_op) {
+ if ((oldinode->i_uid != current->fsuid) && !fsuser()) {
+ iput(dir);
+ iput(oldinode);
+ return -EPERM;
+ }
dir->i_sb->dq_op->initialize(dir, -1);
+ }
down(&dir->i_sem);
error = dir->i_op->link(oldinode, dir, basename, namelen);
up(&dir->i_sem);


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.049 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site