aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
Commit message (Expand)AuthorAge
* CRED: Fix SUID exec regressionDavid Howells2009-02-06
* [CVE-2009-0029] System call wrappers part 27Heiko Carstens2009-01-14
* fs/exec.c: make do_coredump() voidWANG Cong2009-01-06
* do_coredump(): check return from argv_split()Tetsuo Handa2009-01-06
* fs/exec.c:__bprm_mm_init(): clean up error handlingLuiz Fernando N. Capitulino2009-01-06
* sys_execve and sys_uselib do not call into fsnotifyEric Paris2009-01-05
* get rid of special-casing the /sbin/loader on alphaAl Viro2009-01-03
* kill vfs_permissionChristoph Hellwig2008-12-31
* Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds2008-12-30
|\
| * posix-timers: simplify de_thread()->exit_itimers() pathOleg Nesterov2008-12-12
* | Merge branch 'next' into for-linusJames Morris2008-12-24
|\ \ | |/ |/|
| * CRED: Make execve() take advantage of copy-on-write credentialsDavid Howells2008-11-13
| * CRED: Inaugurate COW credentialsDavid Howells2008-11-13
| * CRED: Wrap current->cred and a few other accessorsDavid Howells2008-11-13
| * CRED: Separate task security context from task_structDavid Howells2008-11-13
| * CRED: Wrap task credential accesses in the filesystem subsystemDavid Howells2008-11-13
* | tracehook: exec double-reporting fixRoland McGrath2008-12-09
|/
* coredump: format_corename: don't append .%pid if multi-threadedOleg Nesterov2008-10-20
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linusLinus Torvalds2008-10-16
|\
| * remove CONFIG_KMOD from fsJohannes Berg2008-10-16
* | pid_ns: de_thread: kill the now unneeded ->child_reaper changeOleg Nesterov2008-10-16
* | alpha: introduce field 'taso' into struct linux_binprmKirill A. Shutemov2008-10-16
* | exec.c, compat.c: fix count(), compat_count() bounds checkingJason Baron2008-10-16
|/
* mm owner: fix race between swapoff and exitBalbir Singh2008-09-29
* exec: include pagemap.h again to fix buildHugh Dickins2008-07-28
* [PATCH] get rid of __user_path_lookup_openAl Viro2008-07-26
* [PATCH] take noexec checks to very few callers that careAl Viro2008-07-26
* Re: [PATCH 3/6] vfs: open_exec cleanupChristoph Hellwig2008-07-26
* [PATCH] pass MAY_OPEN to vfs_permission() explicitlyAl Viro2008-07-26
* tracehook: execRoland McGrath2008-07-26
* coredump: format_corename: fix the "core_uses_pid" logicOleg Nesterov2008-07-25
* coredump: kill mm->core_doneOleg Nesterov2008-07-25
* coredump: construct the list of coredumping threads at startup timeOleg Nesterov2008-07-25
* coredump: make mm->core_state visible to ->core_dump()Oleg Nesterov2008-07-25
* coredump: turn core_state->nr_threads into atomic_tOleg Nesterov2008-07-25
* coredump: simplify core_state->nr_threads calculationOleg Nesterov2008-07-25
* coredump: move mm->core_waiters into struct core_stateOleg Nesterov2008-07-25
* coredump: turn mm->core_startup_done into the pointer to struct core_stateOleg Nesterov2008-07-25
* coredump: zap_threads() must skip kernel threadsOleg Nesterov2008-07-25
* introduce PF_KTHREAD flagOleg Nesterov2008-07-25
* coredump: zap_threads: comments && use while_each_thread()Oleg Nesterov2008-07-25
* exec: remove some includesHugh Dickins2008-07-25
* mm: remove double indirection on tlb parameter to free_pgd_range() & CoJan Beulich2008-07-24
* exec: fix stack excutability without PT_GNU_STACKHugh Dickins2008-07-10
* Include <asm/a.out.h> in fs/exec.c only for Alpha.David Woodhouse2008-06-16
* posix timers: discard SI_TIMER signals on execOleg Nesterov2008-05-26
* [PATCH] get rid of leak in compat_execve()Al Viro2008-05-16
* memcg: fix possible panic when CONFIG_MM_OWNER=yKOSAKI Motohiro2008-05-13
* [PATCH] split linux/file.hAl Viro2008-05-01
* document de_thread() with exit_notify() connectionOleg Nesterov2008-04-30
'#n208'>208 209 210 211 212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274












                                               
                        
 









































































                                                                              
                                                                                       
























































                                                                                    

                            
 



































                                                                   










                                                                     






                                                                      
                                                              
                                                       
                                                                 




                                                                    
                                                           
                                                                  











                                                                                   





                                                                
                           
                                                               
                                                        






































                                                                                    
/*
 *  ncp_fs.h
 *
 *  Copyright (C) 1995, 1996 by Volker Lendecke
 *
 */

#ifndef _LINUX_NCP_FS_H
#define _LINUX_NCP_FS_H

#include <linux/fs.h>
#include <linux/in.h>
#include <linux/types.h>
#include <linux/magic.h>

#include <linux/ipx.h>
#include <linux/ncp_no.h>

/*
 * ioctl commands
 */

struct ncp_ioctl_request {
	unsigned int function;
	unsigned int size;
	char __user *data;
};

struct ncp_fs_info {
	int version;
	struct sockaddr_ipx addr;
	__kernel_uid_t mounted_uid;
	int connection;		/* Connection number the server assigned us */
	int buffer_size;	/* The negotiated buffer size, to be
				   used for read/write requests! */

	int volume_number;
	__le32 directory_id;
};

struct ncp_fs_info_v2 {
	int version;
	unsigned long mounted_uid;
	unsigned int connection;
	unsigned int buffer_size;

	unsigned int volume_number;
	__le32 directory_id;

	__u32 dummy1;
	__u32 dummy2;
	__u32 dummy3;
};

struct ncp_sign_init
{
	char sign_root[8];
	char sign_last[16];
};

struct ncp_lock_ioctl
{
#define NCP_LOCK_LOG	0
#define NCP_LOCK_SH	1
#define NCP_LOCK_EX	2
#define NCP_LOCK_CLEAR	256
	int		cmd;
	int		origin;
	unsigned int	offset;
	unsigned int	length;
#define NCP_LOCK_DEFAULT_TIMEOUT	18
#define NCP_LOCK_MAX_TIMEOUT		180
	int		timeout;
};

struct ncp_setroot_ioctl
{
	int		volNumber;
	int		namespace;
	__le32		dirEntNum;
};

struct ncp_objectname_ioctl
{
#define NCP_AUTH_NONE	0x00
#define NCP_AUTH_BIND	0x31
#define NCP_AUTH_NDS	0x32
	int		auth_type;
	size_t		object_name_len;
	void __user *	object_name;	/* a userspace data, in most cases user name */
};

struct ncp_privatedata_ioctl
{
	size_t		len;
	void __user *	data;		/* ~1000 for NDS */
};

/* NLS charsets by ioctl */
#define NCP_IOCSNAME_LEN 20
struct ncp_nls_ioctl
{
	unsigned char codepage[NCP_IOCSNAME_LEN+1];
	unsigned char iocharset[NCP_IOCSNAME_LEN+1];
};

#define	NCP_IOC_NCPREQUEST		_IOR('n', 1, struct ncp_ioctl_request)
#define	NCP_IOC_GETMOUNTUID		_IOW('n', 2, __kernel_old_uid_t)
#define NCP_IOC_GETMOUNTUID2		_IOW('n', 2, unsigned long)

#define NCP_IOC_CONN_LOGGED_IN          _IO('n', 3)

#define NCP_GET_FS_INFO_VERSION    (1)
#define NCP_IOC_GET_FS_INFO             _IOWR('n', 4, struct ncp_fs_info)
#define NCP_GET_FS_INFO_VERSION_V2 (2)
#define NCP_IOC_GET_FS_INFO_V2		_IOWR('n', 4, struct ncp_fs_info_v2)

#define NCP_IOC_SIGN_INIT		_IOR('n', 5, struct ncp_sign_init)
#define NCP_IOC_SIGN_WANTED		_IOR('n', 6, int)
#define NCP_IOC_SET_SIGN_WANTED		_IOW('n', 6, int)

#define NCP_IOC_LOCKUNLOCK		_IOR('n', 7, struct ncp_lock_ioctl)

#define NCP_IOC_GETROOT			_IOW('n', 8, struct ncp_setroot_ioctl)
#define NCP_IOC_SETROOT			_IOR('n', 8, struct ncp_setroot_ioctl)

#define NCP_IOC_GETOBJECTNAME		_IOWR('n', 9, struct ncp_objectname_ioctl)
#define NCP_IOC_SETOBJECTNAME		_IOR('n', 9, struct ncp_objectname_ioctl)
#define NCP_IOC_GETPRIVATEDATA		_IOWR('n', 10, struct ncp_privatedata_ioctl)
#define NCP_IOC_SETPRIVATEDATA		_IOR('n', 10, struct ncp_privatedata_ioctl)

#define NCP_IOC_GETCHARSETS		_IOWR('n', 11, struct ncp_nls_ioctl)
#define NCP_IOC_SETCHARSETS		_IOR('n', 11, struct ncp_nls_ioctl)

#define NCP_IOC_GETDENTRYTTL		_IOW('n', 12, __u32)
#define NCP_IOC_SETDENTRYTTL		_IOR('n', 12, __u32)

/*
 * The packet size to allocate. One page should be enough.
 */
#define NCP_PACKET_SIZE 4070

#define NCP_MAXPATHLEN 255
#define NCP_MAXNAMELEN 14

#ifdef __KERNEL__

#include <linux/ncp_fs_i.h>
#include <linux/ncp_fs_sb.h>

/* define because it is easy to change PRINTK to {*}PRINTK */
#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)

#undef NCPFS_PARANOIA
#ifdef NCPFS_PARANOIA
#define PPRINTK(format, args...) PRINTK(format , ## args)
#else
#define PPRINTK(format, args...)
#endif

#ifndef DEBUG_NCP
#define DEBUG_NCP 0
#endif
#if DEBUG_NCP > 0
#define DPRINTK(format, args...) PRINTK(format , ## args)
#else
#define DPRINTK(format, args...)
#endif
#if DEBUG_NCP > 1
#define DDPRINTK(format, args...) PRINTK(format , ## args)
#else
#define DDPRINTK(format, args...)
#endif

#define NCP_MAX_RPC_TIMEOUT (6*HZ)


struct ncp_entry_info {
	struct nw_info_struct	i;
	ino_t			ino;
	int			opened;
	int			access;
	unsigned int		volume;
	__u8			file_handle[6];
};

static inline struct ncp_server *NCP_SBP(struct super_block *sb)
{
	return sb->s_fs_info;
}

#define NCP_SERVER(inode)	NCP_SBP((inode)->i_sb)
static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode)
{
	return container_of(inode, struct ncp_inode_info, vfs_inode);
}

/* linux/fs/ncpfs/inode.c */
int ncp_notify_change(struct dentry *, struct iattr *);
struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
void ncp_update_inode(struct inode *, struct ncp_entry_info *);
void ncp_update_inode2(struct inode *, struct ncp_entry_info *);

/* linux/fs/ncpfs/dir.c */
extern const struct inode_operations ncp_dir_inode_operations;
extern const struct file_operations ncp_dir_operations;
extern const struct dentry_operations ncp_root_dentry_operations;
int ncp_conn_logged_in(struct super_block *);
int ncp_date_dos2unix(__le16 time, __le16 date);
void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);

/* linux/fs/ncpfs/ioctl.c */
long ncp_ioctl(struct file *, unsigned int, unsigned long);
long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);

/* linux/fs/ncpfs/sock.c */
int ncp_request2(struct ncp_server *server, int function,
	void* reply, int max_reply_size);
static inline int ncp_request(struct ncp_server *server, int function) {
	return ncp_request2(server, function, server->packet, server->packet_size);
}
int ncp_connect(struct ncp_server *server);
int ncp_disconnect(struct ncp_server *server);
void ncp_lock_server(struct ncp_server *server);
void ncp_unlock_server(struct ncp_server *server);

/* linux/fs/ncpfs/symlink.c */
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
extern const struct address_space_operations ncp_symlink_aops;
int ncp_symlink(struct inode*, struct dentry*, const char*);
#endif

/* linux/fs/ncpfs/file.c */
extern const struct inode_operations ncp_file_inode_operations;
extern const struct file_operations ncp_file_operations;
int ncp_make_open(struct inode *, int);

/* linux/fs/ncpfs/mmap.c */
int ncp_mmap(struct file *, struct vm_area_struct *);

/* linux/fs/ncpfs/ncplib_kernel.c */
int ncp_make_closed(struct inode *);

#define ncp_namespace(i)	(NCP_SERVER(i)->name_space[NCP_FINFO(i)->volNumber])

static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator)
{
#ifdef CONFIG_NCPFS_SMALLDOS
	int ns = ncp_namespace(i);

	if ((ns == NW_NS_DOS)
#ifdef CONFIG_NCPFS_OS2_NS
		|| ((ns == NW_NS_OS2) && (nscreator == NW_NS_DOS))
#endif /* CONFIG_NCPFS_OS2_NS */
				)
		return 0;
#endif /* CONFIG_NCPFS_SMALLDOS */
	return 1;
}

#define ncp_preserve_case(i)	(ncp_namespace(i) != NW_NS_DOS)

static inline int ncp_case_sensitive(struct inode *i)
{
#ifdef CONFIG_NCPFS_NFS_NS
	return ncp_namespace(i) == NW_NS_NFS;
#else
	return 0;
#endif	/* CONFIG_NCPFS_NFS_NS */
} 

#endif				/* __KERNEL__ */

#endif				/* _LINUX_NCP_FS_H */