patch-2.4.23 linux-2.4.23/fs/ramfs/inode.c
Next file: linux-2.4.23/fs/reiserfs/ioctl.c
Previous file: linux-2.4.23/fs/quota_v1.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
2003-11-28 10:26:21.000000000 -0800
- Orig file:
linux-2.4.22/fs/ramfs/inode.c
- Orig date:
2002-08-02 17:39:45.000000000 -0700
diff -urN linux-2.4.22/fs/ramfs/inode.c linux-2.4.23/fs/ramfs/inode.c
@@ -44,7 +44,7 @@
{
buf->f_type = RAMFS_MAGIC;
buf->f_bsize = PAGE_CACHE_SIZE;
- buf->f_namelen = 255;
+ buf->f_namelen = NAME_MAX;
return 0;
}
@@ -54,6 +54,8 @@
*/
static struct dentry * ramfs_lookup(struct inode *dir, struct dentry *dentry)
{
+ if (dentry->d_name.len > NAME_MAX)
+ return ERR_PTR(-ENAMETOOLONG);
d_add(dentry, NULL);
return NULL;
}
@@ -138,6 +140,11 @@
int error = -ENOSPC;
if (inode) {
+ if (dir->i_mode & S_ISGID) {
+ inode->i_gid = dir->i_gid;
+ if (S_ISDIR(mode))
+ inode->i_mode |= S_ISGID;
+ }
d_instantiate(dentry, inode);
dget(dentry); /* Extra count - pin the dentry in core */
error = 0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)