Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
31d35680
Commit
31d35680
authored
Jul 10, 2003
by
Steve French
Committed by
Steve French
Jul 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mknod support
parent
2d24104e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
3 deletions
+47
-3
fs/cifs/cifsfs.c
fs/cifs/cifsfs.c
+1
-0
fs/cifs/cifsfs.h
fs/cifs/cifsfs.h
+1
-0
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+4
-1
fs/cifs/dir.c
fs/cifs/dir.c
+37
-0
fs/cifs/file.c
fs/cifs/file.c
+1
-0
fs/cifs/inode.c
fs/cifs/inode.c
+2
-1
No files found.
fs/cifs/cifsfs.c
View file @
31d35680
...
@@ -301,6 +301,7 @@ struct inode_operations cifs_dir_inode_ops = {
...
@@ -301,6 +301,7 @@ struct inode_operations cifs_dir_inode_ops = {
/* revalidate:cifs_revalidate, */
/* revalidate:cifs_revalidate, */
.
setattr
=
cifs_setattr
,
.
setattr
=
cifs_setattr
,
.
symlink
=
cifs_symlink
,
.
symlink
=
cifs_symlink
,
.
mknod
=
cifs_mknod
,
};
};
struct
inode_operations
cifs_file_inode_ops
=
{
struct
inode_operations
cifs_file_inode_ops
=
{
...
...
fs/cifs/cifsfs.h
View file @
31d35680
...
@@ -50,6 +50,7 @@ extern int cifs_create(struct inode *, struct dentry *, int, struct nameidata *)
...
@@ -50,6 +50,7 @@ extern int cifs_create(struct inode *, struct dentry *, int, struct nameidata *)
extern
struct
dentry
*
cifs_lookup
(
struct
inode
*
,
struct
dentry
*
,
struct
nameidata
*
);
extern
struct
dentry
*
cifs_lookup
(
struct
inode
*
,
struct
dentry
*
,
struct
nameidata
*
);
extern
int
cifs_unlink
(
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_unlink
(
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_hardlink
(
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_hardlink
(
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_mknod
(
struct
inode
*
,
struct
dentry
*
,
int
,
dev_t
);
extern
int
cifs_mkdir
(
struct
inode
*
,
struct
dentry
*
,
int
);
extern
int
cifs_mkdir
(
struct
inode
*
,
struct
dentry
*
,
int
);
extern
int
cifs_rmdir
(
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_rmdir
(
struct
inode
*
,
struct
dentry
*
);
extern
int
cifs_rename
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
extern
int
cifs_rename
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
...
...
fs/cifs/cifsproto.h
View file @
31d35680
...
@@ -155,7 +155,7 @@ extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon,
...
@@ -155,7 +155,7 @@ extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon,
__u64
size
,
__u16
fileHandle
,
__u32
opener_pid
,
int
AllocSizeFlag
);
__u64
size
,
__u16
fileHandle
,
__u32
opener_pid
,
int
AllocSizeFlag
);
extern
int
CIFSSMBUnixSetPerms
(
const
int
xid
,
struct
cifsTconInfo
*
pTcon
,
extern
int
CIFSSMBUnixSetPerms
(
const
int
xid
,
struct
cifsTconInfo
*
pTcon
,
char
*
full_path
,
__u64
mode
,
__u64
uid
,
char
*
full_path
,
__u64
mode
,
__u64
uid
,
__u64
gid
,
const
struct
nls_table
*
nls_codepage
);
__u64
gid
,
dev_t
dev
,
const
struct
nls_table
*
nls_codepage
);
extern
int
CIFSSMBMkDir
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
extern
int
CIFSSMBMkDir
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
char
*
newName
,
const
char
*
newName
,
...
...
fs/cifs/cifssmb.c
View file @
31d35680
...
@@ -2299,7 +2299,7 @@ CIFSSMBSetTimes(int xid, struct cifsTconInfo *tcon, char *fileName,
...
@@ -2299,7 +2299,7 @@ CIFSSMBSetTimes(int xid, struct cifsTconInfo *tcon, char *fileName,
int
int
CIFSSMBUnixSetPerms
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
CIFSSMBUnixSetPerms
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
char
*
fileName
,
__u64
mode
,
__u64
uid
,
__u64
gid
,
char
*
fileName
,
__u64
mode
,
__u64
uid
,
__u64
gid
,
const
struct
nls_table
*
nls_codepage
)
dev_t
device
,
const
struct
nls_table
*
nls_codepage
)
{
{
TRANSACTION2_SPI_REQ
*
pSMB
=
NULL
;
TRANSACTION2_SPI_REQ
*
pSMB
=
NULL
;
TRANSACTION2_SPI_RSP
*
pSMBr
=
NULL
;
TRANSACTION2_SPI_RSP
*
pSMBr
=
NULL
;
...
@@ -2358,6 +2358,9 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
...
@@ -2358,6 +2358,9 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
pSMB
->
hdr
.
smb_buf_length
+=
pSMB
->
ByteCount
;
pSMB
->
hdr
.
smb_buf_length
+=
pSMB
->
ByteCount
;
data_offset
->
Uid
=
cpu_to_le64
(
uid
);
data_offset
->
Uid
=
cpu_to_le64
(
uid
);
data_offset
->
Gid
=
cpu_to_le64
(
gid
);
data_offset
->
Gid
=
cpu_to_le64
(
gid
);
/* better to leave device as zero when it is */
data_offset
->
DevMajor
=
cpu_to_le64
(
MAJOR
(
device
));
data_offset
->
DevMinor
=
cpu_to_le64
(
MINOR
(
device
));
data_offset
->
Permissions
=
cpu_to_le64
(
mode
);
data_offset
->
Permissions
=
cpu_to_le64
(
mode
);
pSMB
->
ByteCount
=
cpu_to_le16
(
pSMB
->
ByteCount
);
pSMB
->
ByteCount
=
cpu_to_le16
(
pSMB
->
ByteCount
);
rc
=
SendReceive
(
xid
,
tcon
->
ses
,
(
struct
smb_hdr
*
)
pSMB
,
rc
=
SendReceive
(
xid
,
tcon
->
ses
,
(
struct
smb_hdr
*
)
pSMB
,
...
...
fs/cifs/dir.c
View file @
31d35680
...
@@ -193,6 +193,43 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
...
@@ -193,6 +193,43 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
return
rc
;
return
rc
;
}
}
int
cifs_mknod
(
struct
inode
*
inode
,
struct
dentry
*
direntry
,
int
mode
,
dev_t
device_number
)
{
int
rc
=
-
EPERM
;
int
xid
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
char
*
full_path
=
NULL
;
struct
inode
*
newinode
=
NULL
;
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
full_path
=
build_path_from_dentry
(
direntry
);
if
(
pTcon
->
ses
->
capabilities
&
CAP_UNIX
)
{
rc
=
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
mode
,
current
->
euid
,
current
->
egid
,
device_number
,
cifs_sb
->
local_nls
);
if
(
!
rc
)
{
rc
=
cifs_get_inode_info_unix
(
&
newinode
,
full_path
,
inode
->
i_sb
);
direntry
->
d_op
=
&
cifs_dentry_ops
;
if
(
rc
==
0
)
d_instantiate
(
direntry
,
newinode
);
}
}
if
(
full_path
)
kfree
(
full_path
);
FreeXid
(
xid
);
return
rc
;
}
struct
dentry
*
struct
dentry
*
cifs_lookup
(
struct
inode
*
parent_dir_inode
,
struct
dentry
*
direntry
,
struct
nameidata
*
nd
)
cifs_lookup
(
struct
inode
*
parent_dir_inode
,
struct
dentry
*
direntry
,
struct
nameidata
*
nd
)
{
{
...
...
fs/cifs/file.c
View file @
31d35680
...
@@ -125,6 +125,7 @@ cifs_open(struct inode *inode, struct file *file)
...
@@ -125,6 +125,7 @@ cifs_open(struct inode *inode, struct file *file)
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
inode
->
i_mode
,
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
inode
->
i_mode
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
0
/* dev */
,
cifs_sb
->
local_nls
);
cifs_sb
->
local_nls
);
else
{
/* BB implement via Windows security descriptors */
else
{
/* BB implement via Windows security descriptors */
/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
...
...
fs/cifs/inode.c
View file @
31d35680
...
@@ -397,6 +397,7 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
...
@@ -397,6 +397,7 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
mode
,
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
mode
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
(
__u64
)
-
1
,
0
/* dev_t */
,
cifs_sb
->
local_nls
);
cifs_sb
->
local_nls
);
else
{
/* BB to be implemented via Windows secrty descriptors*/
else
{
/* BB to be implemented via Windows secrty descriptors*/
/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
...
@@ -702,7 +703,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
...
@@ -702,7 +703,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
if
((
cifs_sb
->
tcon
->
ses
->
capabilities
&
CAP_UNIX
)
if
((
cifs_sb
->
tcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
(
attrs
->
ia_valid
&
(
ATTR_MODE
|
ATTR_GID
|
ATTR_UID
)))
&&
(
attrs
->
ia_valid
&
(
ATTR_MODE
|
ATTR_GID
|
ATTR_UID
)))
rc
=
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
mode
,
uid
,
gid
,
rc
=
CIFSSMBUnixSetPerms
(
xid
,
pTcon
,
full_path
,
mode
,
uid
,
gid
,
cifs_sb
->
local_nls
);
0
/* dev_t */
,
cifs_sb
->
local_nls
);
else
if
(
attrs
->
ia_valid
&
ATTR_MODE
)
{
else
if
(
attrs
->
ia_valid
&
ATTR_MODE
)
{
if
((
mode
&
S_IWUGO
)
==
0
)
/* not writeable */
{
if
((
mode
&
S_IWUGO
)
==
0
)
/* not writeable */
{
if
((
cifsInode
->
cifsAttrs
&
ATTR_READONLY
)
==
0
)
if
((
cifsInode
->
cifsAttrs
&
ATTR_READONLY
)
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment