Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12014
b: refs/heads/master
c: eda3c02
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Jul 21, 2005
1 parent 54db37c commit 2ece038
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 076fb01e8238b7e5d68ba0d729c0ff7716d1d8ec
refs/heads/master: eda3c029899cbf435d76fea43b7e1404439ccec9
10 changes: 9 additions & 1 deletion trunk/fs/cifs/cifspdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,18 @@
/* CreateOptions */
#define CREATE_NOT_FILE 0x00000001 /* if set must not be file */
#define CREATE_WRITE_THROUGH 0x00000002
#define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */
#define CREATE_SEQUENTIAL 0x00000004
#define CREATE_SYNC_ALERT 0x00000010
#define CREATE_ASYNC_ALERT 0x00000020
#define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */
#define CREATE_NO_EA_KNOWLEDGE 0x00000200
#define CREATE_EIGHT_DOT_THREE 0x00000400
#define CREATE_RANDOM_ACCESS 0x00000800
#define CREATE_DELETE_ON_CLOSE 0x00001000
#define CREATE_OPEN_BY_ID 0x00002000
#define OPEN_REPARSE_POINT 0x00200000
#define CREATE_OPTIONS_MASK 0x007FFFFF
#define CREATE_OPTION_SPECIAL 0x20000000 /* system. NB not sent over wire */

/* ImpersonationLevel flags */
#define SECURITY_ANONYMOUS 0
Expand Down
10 changes: 8 additions & 2 deletions trunk/fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,13 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
}
pSMB->DesiredAccess = cpu_to_le32(access_flags);
pSMB->AllocationSize = 0;
pSMB->FileAttributes = cpu_to_le32(ATTR_NORMAL);
/* set file as system file if special file such
as fifo and server expecting SFU style and
no Unix extensions */
if(create_options & CREATE_OPTION_SPECIAL)
pSMB->FileAttributes = cpu_to_le32(ATTR_SYSTEM);
else
pSMB->FileAttributes = cpu_to_le32(ATTR_NORMAL);
/* XP does not handle ATTR_POSIX_SEMANTICS */
/* but it helps speed up case sensitive checks for other
servers such as Samba */
Expand All @@ -752,7 +758,7 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
being created */
pSMB->ShareAccess = cpu_to_le32(FILE_SHARE_ALL);
pSMB->CreateDisposition = cpu_to_le32(openDisposition);
pSMB->CreateOptions = cpu_to_le32(create_options);
pSMB->CreateOptions = cpu_to_le32(create_options & CREATE_OPTIONS_MASK);
/* BB Expirement with various impersonation levels and verify */
pSMB->ImpersonationLevel = cpu_to_le32(SECURITY_IMPERSONATION);
pSMB->SecurityFlags =
Expand Down
34 changes: 30 additions & 4 deletions trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,39 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
d_instantiate(direntry, newinode);
}
} else {
if((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
(special_file(mode))) {
if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
int oplock = 0;
u16 fileHandle;
FILE_ALL_INFO * buf;

cFYI(1,("sfu compat create special file"));
/* Attributes = cpu_to_le32(ATTR_SYSTEM);
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, ...); */

buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
if(buf == NULL) {
kfree(full_path);
FreeXid(xid);
return -ENOMEM;
}

rc = CIFSSMBOpen(xid, pTcon, full_path,
FILE_CREATE, /* fail if exists */
GENERIC_WRITE /* BB would
WRITE_OWNER | WRITE_DAC be better? */,
/* Create a file and set the
file attribute to SYSTEM */
CREATE_NOT_DIR | CREATE_OPTION_SPECIAL,
&fileHandle, &oplock, buf,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);

if(!rc) {
/* BB Do not bother to decode buf since no
local inode yet to put timestamps in */
CIFSSMBClose(xid, pTcon, fileHandle);
d_drop(direntry);
}
kfree(buf);
/* add code here to set EAs */
}
}
Expand Down
10 changes: 10 additions & 0 deletions trunk/fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ int cifs_get_inode_info(struct inode **pinode,
on dirs */
inode->i_mode = cifs_sb->mnt_dir_mode;
inode->i_mode |= S_IFDIR;
} else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
(cifsInfo->cifsAttrs & ATTR_SYSTEM) &&
/* No need to le64 convert size of zero */
(pfindData->EndOfFile == 0)) {
inode->i_mode = cifs_sb->mnt_file_mode;
inode->i_mode |= S_IFIFO;
/* BB Finish for SFU style symlinks and devies */
/* } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
(cifsInfo->cifsAttrs & ATTR_SYSTEM) && ) */

} else {
inode->i_mode |= S_IFREG;
/* treat the dos attribute of read-only as read-only
Expand Down
7 changes: 7 additions & 0 deletions trunk/fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ static void fill_in_inode(struct inode *tmp_inode,
tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
}
tmp_inode->i_mode |= S_IFDIR;
} else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
(attr & ATTR_SYSTEM) && (end_of_file == 0)) {
*pobject_type = DT_FIFO;
tmp_inode->i_mode |= S_IFIFO;
/* BB Finish for SFU style symlinks and devies */
/* } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
(attr & ATTR_SYSTEM) && ) { */
/* we no longer mark these because we could not follow them */
/* } else if (attr & ATTR_REPARSE) {
*pobject_type = DT_LNK;
Expand Down

0 comments on commit 2ece038

Please sign in to comment.