Commit 0f51d45f authored by Petr Vandrovec's avatar Petr Vandrovec

Utilize NFS extended attributes for storing file mode and rdev. Make sure that you

use nodev,nosuid together with nfsextras if you do not trust server...
parent f9d095ea
......@@ -6,6 +6,7 @@
* Modified 1997 Peter Waltenberg, Bill Hawes, David Woodhouse for 2.1 dcache
* Modified 1998, 1999 Wolfram Pienkoss for NLS
* Modified 1999 Wolfram Pienkoss for directory caching
* Modified 2000 Ben Harris, University of Cambridge for NFS NS meta-info
*
*/
......@@ -40,8 +41,12 @@ static int ncp_mkdir(struct inode *, struct dentry *, int);
static int ncp_rmdir(struct inode *, struct dentry *);
static int ncp_rename(struct inode *, struct dentry *,
struct inode *, struct dentry *);
#ifdef CONFIG_NCPFS_EXTRAS
static int ncp_mknod(struct inode * dir, struct dentry *dentry,
int mode, int rdev);
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
extern int ncp_symlink(struct inode *, struct dentry *, const char *);
#else
#define ncp_symlink NULL
#endif
struct file_operations ncp_dir_operations =
......@@ -56,11 +61,10 @@ struct inode_operations ncp_dir_inode_operations =
create: ncp_create,
lookup: ncp_lookup,
unlink: ncp_unlink,
#ifdef CONFIG_NCPFS_EXTRAS
symlink: ncp_symlink,
#endif
mkdir: ncp_mkdir,
rmdir: ncp_rmdir,
mknod: ncp_mknod,
rename: ncp_rename,
setattr: ncp_notify_change,
};
......@@ -743,6 +747,7 @@ ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
onerpl = offsetof(struct nw_info_struct, entryName) + entry.i.nameLen;
if (rpls < onerpl)
break; /* short packet */
(void)ncp_obtain_nfs_info(server, &entry.i);
rpl += onerpl;
rpls -= onerpl;
entry.volume = entry.i.volNumber;
......@@ -878,7 +883,7 @@ static int ncp_instantiate(struct inode *dir, struct dentry *dentry,
}
int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
int attributes)
int rdev, int attributes)
{
struct ncp_server *server = NCP_SERVER(dir);
struct ncp_entry_info finfo;
......@@ -924,6 +929,15 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
opmode = O_WRONLY;
}
finfo.access = opmode;
if (ncp_is_nfs_extras(server, finfo.volume)) {
finfo.i.nfs.mode = mode;
finfo.i.nfs.rdev = rdev;
if (ncp_modify_nfs_info(server, finfo.volume,
finfo.i.dirEntNum,
mode, rdev) != 0)
goto out;
}
error = ncp_instantiate(dir, dentry, &finfo);
out:
unlock_kernel();
......@@ -932,7 +946,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
static int ncp_create(struct inode *dir, struct dentry *dentry, int mode)
{
return ncp_create_new(dir, dentry, mode, 0);
return ncp_create_new(dir, dentry, mode, 0, 0);
}
static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
......@@ -960,6 +974,15 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
OC_MODE_CREATE, aDIR, 0xffff,
&finfo) == 0)
{
if (ncp_is_nfs_extras(server, finfo.volume)) {
mode |= S_IFDIR;
finfo.i.nfs.mode = mode;
if (ncp_modify_nfs_info(server,
finfo.volume,
finfo.i.dirEntNum,
mode, 0) != 0)
goto out;
}
error = ncp_instantiate(dir, dentry, &finfo);
}
out:
......@@ -1145,6 +1168,16 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
return error;
}
static int ncp_mknod(struct inode * dir, struct dentry *dentry,
int mode, int rdev)
{
if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) {
DPRINTK(KERN_DEBUG "ncp_mknod: mode = 0%o\n", mode);
return ncp_create_new(dir, dentry, mode, rdev, 0);
}
return -EPERM; /* Strange, but true */
}
/* The following routines are taken directly from msdos-fs */
/* Linear day numbers of the respective 1sts in non-leap years. */
......
......@@ -5,6 +5,7 @@
* Modified for big endian by J.F. Chadima and David S. Miller
* Modified 1997 Peter Waltenberg, Bill Hawes, David Woodhouse for 2.1 dcache
* Modified 1998 Wolfram Pienkoss for NLS
* Modified 2000 Ben Harris, University of Cambridge for NFS NS meta-info
*
*/
......@@ -91,7 +92,7 @@ static struct super_operations ncp_sops =
};
extern struct dentry_operations ncp_root_dentry_operations;
#ifdef CONFIG_NCPFS_EXTRAS
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
extern struct address_space_operations ncp_symlink_aops;
extern int ncp_symlink(struct inode*, struct dentry*, const char*);
#endif
......@@ -120,6 +121,14 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo)
static void ncp_update_dates(struct inode *inode, struct nw_info_struct *nwi)
{
/* NFS namespace mode overrides others if it's set. */
DPRINTK(KERN_DEBUG "ncp_update_dates_and_mode: (%s) nfs.mode=0%o\n",
nwi->entryName, nwi->nfs.mode);
if (nwi->nfs.mode) {
/* XXX Security? */
inode->i_mode = nwi->nfs.mode;
}
inode->i_blocks = (inode->i_size + NCP_BLOCK_SIZE - 1) >> NCP_BLOCK_SHIFT;
inode->i_mtime = ncp_date_dos2unix(le16_to_cpu(nwi->modifyTime),
......@@ -152,6 +161,7 @@ static void ncp_update_attrs(struct inode *inode, struct ncp_entry_info *nwinfo)
if (/* (inode->i_size >= NCP_MIN_SYMLINK_SIZE)
&& */ (inode->i_size <= NCP_MAX_SYMLINK_SIZE)) {
inode->i_mode = (inode->i_mode & ~S_IFMT) | S_IFLNK;
NCP_FINFO(inode)->flags |= NCPI_KLUDGE_SYMLINK;
break;
}
}
......@@ -177,6 +187,7 @@ static void ncp_update_attrs(struct inode *inode, struct ncp_entry_info *nwinfo)
void ncp_update_inode2(struct inode* inode, struct ncp_entry_info *nwinfo)
{
NCP_FINFO(inode)->flags = 0;
if (!atomic_read(&NCP_FINFO(inode)->opened)) {
NCP_FINFO(inode)->nwattr = nwinfo->i.attributes;
ncp_update_attrs(inode, nwinfo);
......@@ -193,6 +204,8 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo)
{
struct ncp_server *server = NCP_SERVER(inode);
NCP_FINFO(inode)->flags = 0;
ncp_update_attrs(inode, nwinfo);
DDPRINTK("ncp_read_inode: inode->i_mode = %u\n", inode->i_mode);
......@@ -238,11 +251,17 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &ncp_dir_inode_operations;
inode->i_fop = &ncp_dir_operations;
#ifdef CONFIG_NCPFS_EXTRAS
#ifdef CONFIG_NCPFS_NFS_NS
} else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) || S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
init_special_inode(inode, inode->i_mode, info->i.nfs.rdev);
#endif
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &ncp_symlink_inode_operations;
inode->i_data.a_ops = &ncp_symlink_aops;
#endif
} else {
make_bad_inode(inode);
}
insert_inode_hash(inode);
} else
......@@ -660,6 +679,27 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
info.attributes &= ~(aRONLY|aRENAMEINHIBIT|aDELETEINHIBIT);
else
info.attributes |= (aRONLY|aRENAMEINHIBIT|aDELETEINHIBIT);
#ifdef CONFIG_NCPFS_NFS_NS
if (ncp_is_nfs_extras(server, NCP_FINFO(inode)->volNumber)) {
result = ncp_modify_nfs_info(server,
NCP_FINFO(inode)->volNumber,
NCP_FINFO(inode)->dirEntNum,
attr->ia_mode, 0);
if (result != 0)
goto out;
info.attributes &= ~(aSHARED | aSYSTEM);
{
/* mark partial success */
struct iattr tmpattr;
tmpattr.ia_valid = ATTR_MODE;
tmpattr.ia_mode = attr->ia_mode;
inode_setattr(inode, &tmpattr);
}
}
#endif
}
#endif
......
......@@ -5,6 +5,7 @@
* Modified for big endian by J.F. Chadima and David S. Miller
* Modified 1997 Peter Waltenberg, Bill Hawes, David Woodhouse for 2.1 dcache
* Modified 1999 Wolfram Pienkoss for NLS
* Modified 2000 Ben Harris, University of Cambridge for NFS NS meta-info
*
*/
......@@ -44,6 +45,10 @@ static void ncp_add_dword(struct ncp_server *server, __u32 x)
return;
}
static inline void ncp_add_dword_lh(struct ncp_server *server, __u32 x) {
ncp_add_dword(server, cpu_to_le32(x));
}
static void ncp_add_mem(struct ncp_server *server, const void *source, int size)
{
assert_server_locked(server);
......@@ -111,6 +116,11 @@ static __u16
return get_unaligned((__u16 *) ncp_reply_data(server, offset));
}
static inline __u32 DVAL_LH(void* data)
{
return le32_to_cpu(get_unaligned((__u32*)data));
}
static __u32
ncp_reply_dword(struct ncp_server *server, int offset)
{
......@@ -334,6 +344,56 @@ void ncp_extract_file_info(void *structure, struct nw_info_struct *target)
return;
}
#ifdef CONFIG_NCPFS_NFS_NS
static inline void ncp_extract_nfs_info(unsigned char *structure,
struct nw_nfs_info *target)
{
target->mode = DVAL_LH(structure);
target->rdev = DVAL_LH(structure + 8);
}
#endif
int ncp_obtain_nfs_info(struct ncp_server *server,
struct nw_info_struct *target)
{
int result = 0;
#ifdef CONFIG_NCPFS_NFS_NS
__u32 volnum = target->volNumber;
if (ncp_is_nfs_extras(server, volnum)) {
ncp_init_request(server);
ncp_add_byte(server, 19); /* subfunction */
ncp_add_byte(server, server->name_space[volnum]);
ncp_add_byte(server, NW_NS_NFS);
ncp_add_byte(server, 0);
ncp_add_byte(server, volnum);
ncp_add_dword(server, target->dirEntNum);
/* We must retrieve both nlinks and rdev, otherwise some server versions
report zeroes instead of valid data */
ncp_add_dword_lh(server, NSIBM_NFS_MODE | NSIBM_NFS_NLINKS | NSIBM_NFS_RDEV);
if ((result = ncp_request(server, 87)) == 0) {
ncp_extract_nfs_info(ncp_reply_data(server, 0), &target->nfs);
DPRINTK(KERN_DEBUG
"ncp_obtain_nfs_info: (%s) mode=0%o, rdev=0x%x\n",
target->entryName, target->nfs.mode,
target->nfs.rdev);
} else {
target->nfs.mode = 0;
target->nfs.rdev = 0;
}
ncp_unlock_server(server);
} else
#endif
{
target->nfs.mode = 0;
target->nfs.rdev = 0;
}
return result;
}
/*
* Returns information for a (one-component) name relative to
* the specified directory.
......@@ -360,6 +420,10 @@ int ncp_obtain_info(struct ncp_server *server, struct inode *dir, char *path,
if ((result = ncp_request(server, 87)) != 0)
goto out;
ncp_extract_file_info(ncp_reply_data(server, 0), target);
ncp_unlock_server(server);
result = ncp_obtain_nfs_info(server, target);
return result;
out:
ncp_unlock_server(server);
......@@ -536,6 +600,7 @@ ncp_lookup_volume(struct ncp_server *server, char *volname,
/* set dates to Jan 1, 1986 00:00 */
target->creationTime = target->modifyTime = cpu_to_le16(0x0000);
target->creationDate = target->modifyDate = target->lastAccessDate = cpu_to_le16(0x0C21);
target->nfs.mode = 0;
return 0;
}
......@@ -573,6 +638,34 @@ int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
info_mask, info);
}
#ifdef CONFIG_NCPFS_NFS_NS
int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __u32 dirent,
__u32 mode, __u32 rdev)
{
int result = 0;
if (server->name_space[volnum] == NW_NS_NFS) {
ncp_init_request(server);
ncp_add_byte(server, 25); /* subfunction */
ncp_add_byte(server, server->name_space[volnum]);
ncp_add_byte(server, NW_NS_NFS);
ncp_add_byte(server, volnum);
ncp_add_dword(server, dirent);
/* we must always operate on both nlinks and rdev, otherwise
rdev is not set */
ncp_add_dword_lh(server, NSIBM_NFS_MODE | NSIBM_NFS_NLINKS | NSIBM_NFS_RDEV);
ncp_add_dword_lh(server, mode);
ncp_add_dword_lh(server, 1); /* nlinks */
ncp_add_dword_lh(server, rdev);
result = ncp_request(server, 87);
ncp_unlock_server(server);
}
return result;
}
#endif
static int
ncp_DeleteNSEntry(struct ncp_server *server,
__u8 have_dir_base, __u8 volnum, __u32 dirent,
......@@ -681,6 +774,11 @@ int ncp_open_create_file_or_subdir(struct ncp_server *server,
ncp_extract_file_info(ncp_reply_data(server, 6), &(target->i));
target->volume = target->i.volNumber;
ConvertToNWfromDWORD(ncp_reply_dword(server, 0), target->file_handle);
ncp_unlock_server(server);
(void)ncp_obtain_nfs_info(server, &(target->i));
return 0;
out:
ncp_unlock_server(server);
......@@ -741,6 +839,11 @@ int ncp_search_for_file_or_subdir(struct ncp_server *server,
memcpy(seq, ncp_reply_data(server, 0), sizeof(*seq));
ncp_extract_file_info(ncp_reply_data(server, 10), target);
ncp_unlock_server(server);
result = ncp_obtain_nfs_info(server, target);
return result;
out:
ncp_unlock_server(server);
return result;
......
......@@ -69,11 +69,14 @@ static inline void ncp_inode_close(struct inode *inode) {
void ncp_extract_file_info(void* src, struct nw_info_struct* target);
int ncp_obtain_info(struct ncp_server *server, struct inode *, char *,
struct nw_info_struct *target);
int ncp_obtain_nfs_info(struct ncp_server *server, struct nw_info_struct *target);
int ncp_lookup_volume(struct ncp_server *, char *, struct nw_info_struct *);
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *,
__u32, const struct nw_modify_dos_info *info);
int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *,
const char* path, __u32, const struct nw_modify_dos_info *info);
int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __u32 dirent,
__u32 mode, __u32 rdev);
int ncp_del_file_or_subdir2(struct ncp_server *, struct dentry*);
int ncp_del_file_or_subdir(struct ncp_server *, struct inode *, char *);
......@@ -113,6 +116,18 @@ ncp_mount_subdir(struct ncp_server *, struct nw_info_struct *,
int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __u32 dirent, __u8 *dirhandle);
int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle);
int ncp_create_new(struct inode *dir, struct dentry *dentry,
int mode, int rdev, int attributes);
static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int volnum) {
#ifdef CONFIG_NCPFS_NFS_NS
return (server->m.flags & NCP_MOUNT_NFS_EXTRAS) &&
(server->name_space[volnum] == NW_NS_NFS);
#else
return 0;
#endif
}
#ifdef CONFIG_NCPFS_NLS
unsigned char ncp__tolower(struct nls_table *, unsigned char);
......
......@@ -7,18 +7,22 @@
* the file to make sure we don't accidentally use a non-link file
* as a link.
*
* When using the NFS namespace, we set the mode to indicate a symlink and
* don't bother with the magic numbers.
*
* from linux/fs/ext2/symlink.c
*
* Copyright (C) 1998-99, Frank A. Vorstenbosch
*
* ncpfs symlink handling code
* NLS support (c) 1999 Petr Vandrovec
* Modified 2000 Ben Harris, University of Cambridge for NFS NS meta-info
*
*/
#include <linux/config.h>
#ifdef CONFIG_NCPFS_EXTRAS
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
#include <asm/uaccess.h>
......@@ -28,7 +32,6 @@
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/stat.h>
#include <linux/smp_lock.h>
#include "ncplib_kernel.h"
......@@ -38,30 +41,25 @@
#define NCP_SYMLINK_MAGIC0 le32_to_cpu(0x6c6d7973) /* "symlnk->" */
#define NCP_SYMLINK_MAGIC1 le32_to_cpu(0x3e2d6b6e)
int ncp_create_new(struct inode *dir, struct dentry *dentry,
int mode,int attributes);
/* ----- read a symbolic link ------------------------------------------ */
static int ncp_symlink_readpage(struct file *file, struct page *page)
{
struct inode *inode = page->mapping->host;
int error, length, len, cnt;
char *link;
int error, length, len;
char *link, *rawlink;
char *buf = kmap(page);
error = -ENOMEM;
for (cnt = 0; (link=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_NFS))==NULL; cnt++) {
if (cnt > 10)
goto fail;
schedule();
}
rawlink=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_NFS);
if (!rawlink)
goto fail;
if (ncp_make_open(inode,O_RDONLY))
goto failEIO;
error=ncp_read_kernel(NCP_SERVER(inode),NCP_FINFO(inode)->file_handle,
0,NCP_MAX_SYMLINK_SIZE,link,&length);
0,NCP_MAX_SYMLINK_SIZE,rawlink,&length);
ncp_inode_close(inode);
/* Close file handle if no other users... */
......@@ -69,14 +67,20 @@ static int ncp_symlink_readpage(struct file *file, struct page *page)
if (error)
goto failEIO;
if (length<NCP_MIN_SYMLINK_SIZE ||
((__u32 *)link)[0]!=NCP_SYMLINK_MAGIC0 ||
((__u32 *)link)[1]!=NCP_SYMLINK_MAGIC1)
goto failEIO;
if (NCP_FINFO(inode)->flags & NCPI_KLUDGE_SYMLINK) {
if (length<NCP_MIN_SYMLINK_SIZE ||
((__u32 *)rawlink)[0]!=NCP_SYMLINK_MAGIC0 ||
((__u32 *)rawlink)[1]!=NCP_SYMLINK_MAGIC1)
goto failEIO;
link = rawlink + 8;
length -= 8;
} else {
link = rawlink;
}
len = NCP_MAX_SYMLINK_SIZE;
error = ncp_vol2io(NCP_SERVER(inode), buf, &len, link+8, length-8, 0);
kfree(link);
error = ncp_vol2io(NCP_SERVER(inode), buf, &len, link, length, 0);
kfree(rawlink);
if (error)
goto fail;
SetPageUptodate(page);
......@@ -86,7 +90,7 @@ static int ncp_symlink_readpage(struct file *file, struct page *page)
failEIO:
error = -EIO;
kfree(link);
kfree(rawlink);
fail:
SetPageError(page);
kunmap(page);
......@@ -105,61 +109,78 @@ struct address_space_operations ncp_symlink_aops = {
int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
struct inode *inode;
char *link;
int length, err, i;
#ifdef DEBUG
PRINTK("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
char *rawlink;
int length, err, i, outlen;
int kludge;
int mode, attr;
unsigned int hdr;
DPRINTK("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
#ifdef CONFIG_NCPFS_NFS_NS
if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber))
kludge = 0;
else
#endif
#ifdef CONFIG_NCPFS_EXTRAS
if (NCP_SERVER(dir)->m.flags & NCP_MOUNT_SYMLINKS)
kludge = 1;
else
#endif
/* EPERM is returned by VFS if symlink procedure does not exist */
return -EPERM;
rawlink=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_NFS);
if (!rawlink)
return -ENOMEM;
if (!(NCP_SERVER(dir)->m.flags & NCP_MOUNT_SYMLINKS))
return -EPERM; /* EPERM is returned by VFS if symlink procedure does not exist */
if ((length=strlen(symname))>NCP_MAX_SYMLINK_SIZE-8)
return -EINVAL;
if (kludge) {
mode = 0;
attr = aSHARED | aHIDDEN;
((__u32 *)rawlink)[0]=NCP_SYMLINK_MAGIC0;
((__u32 *)rawlink)[1]=NCP_SYMLINK_MAGIC1;
hdr = 8;
} else {
mode = S_IFLNK | S_IRWXUGO;
attr = 0;
hdr = 0;
}
length = strlen(symname);
/* map to/from server charset, do not touch upper/lower case as
symlink can point out of ncp filesystem */
outlen = NCP_MAX_SYMLINK_SIZE - hdr;
err = ncp_io2vol(NCP_SERVER(dir), rawlink + hdr, &outlen, symname, length, 0);
if (err)
goto failfree;
if ((link=(char *)kmalloc(length+9,GFP_NFS))==NULL)
return -ENOMEM;
outlen += hdr;
err = -EIO;
lock_kernel();
if (ncp_create_new(dir,dentry,0,aSHARED|aHIDDEN))
if (ncp_create_new(dir,dentry,mode,0,attr)) {
goto failfree;
}
inode=dentry->d_inode;
if (ncp_make_open(inode, O_WRONLY))
goto failfree;
((__u32 *)link)[0]=NCP_SYMLINK_MAGIC0;
((__u32 *)link)[1]=NCP_SYMLINK_MAGIC1;
/* map to/from server charset, do not touch upper/lower case as
symlink can point out of ncp filesystem */
length += 1;
err = ncp_io2vol(NCP_SERVER(inode),link+8,&length,symname,length-1,0);
if (err)
goto fail;
if(ncp_write_kernel(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,
0, length+8, link, &i) || i!=length+8) {
err = -EIO;
if (ncp_write_kernel(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,
0, outlen, rawlink, &i) || i!=outlen) {
goto fail;
}
ncp_inode_close(inode);
ncp_make_closed(inode);
unlock_kernel();
kfree(link);
kfree(rawlink);
return 0;
fail:
fail:;
ncp_inode_close(inode);
ncp_make_closed(inode);
failfree:
unlock_kernel();
kfree(link);
return err;
failfree:;
kfree(rawlink);
return err;
}
#endif
......
......@@ -85,6 +85,18 @@ struct ncp_volume_info {
#define RIM_ALL (ntohl(0xFF0F0000L))
#define RIM_COMPRESSED_INFO (ntohl(0x00000080L))
/* Defines for NSInfoBitMask */
#define NSIBM_NFS_NAME 0x0001
#define NSIBM_NFS_MODE 0x0002
#define NSIBM_NFS_GID 0x0004
#define NSIBM_NFS_NLINKS 0x0008
#define NSIBM_NFS_RDEV 0x0010
#define NSIBM_NFS_LINK 0x0020
#define NSIBM_NFS_CREATED 0x0040
#define NSIBM_NFS_UID 0x0080
#define NSIBM_NFS_ACSFLAG 0x0100
#define NSIBM_NFS_MYFLAG 0x0200
/* open/create modes */
#define OC_MODE_OPEN 0x01
#define OC_MODE_TRUNCATE 0x02
......@@ -109,6 +121,11 @@ struct ncp_volume_info {
#define AR_OPEN_COMPRESSED 0x0100
#endif
struct nw_nfs_info {
__u32 mode;
__u32 rdev;
};
struct nw_info_struct {
__u32 spaceAlloc __attribute__((packed));
__u32 attributes __attribute__((packed));
......@@ -136,6 +153,10 @@ struct nw_info_struct {
__u32 NSCreator __attribute__((packed));
__u8 nameLen __attribute__((packed));
__u8 entryName[256] __attribute__((packed));
/* libncp may depend on there being nothing after entryName */
#ifdef __KERNEL__
struct nw_nfs_info nfs;
#endif
};
/* modify mask - use with MODIFY_DOS_INFO structure */
......
......@@ -22,6 +22,8 @@ struct ncp_inode_info {
struct semaphore open_sem;
atomic_t opened;
int access;
int flags;
#define NCPI_KLUDGE_SYMLINK 0x0001
__u8 file_handle[6];
struct inode vfs_inode;
};
......
......@@ -21,6 +21,7 @@
#define NCP_MOUNT_NO_NFS 0x0010 /* do not use NFS namespace */
#define NCP_MOUNT_EXTRAS 0x0020
#define NCP_MOUNT_SYMLINKS 0x0040 /* enable symlinks */
#define NCP_MOUNT_NFS_EXTRAS 0x0080 /* Enable use of NFS NS meta-info */
struct ncp_mount_data {
int version;
......
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