diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-10-03 11:53:37 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-10-03 11:53:37 +0000 |
commit | 4fedb9ddd5440c546145e8c9950ef938c52bdfe0 (patch) | |
tree | bb03dbc9d9a28fcadc400c09fa83a8d68e49e3ff /source3/libsmb/clientgen.c | |
parent | bab2843a752bbb54ec886039903a581256d8cc7b (diff) | |
download | samba-4fedb9ddd5440c546145e8c9950ef938c52bdfe0.tar.gz samba-4fedb9ddd5440c546145e8c9950ef938c52bdfe0.tar.bz2 samba-4fedb9ddd5440c546145e8c9950ef938c52bdfe0.zip |
- always open for reading (otherwise getattrE won't work).
- added somemore NT error codes
(This used to be commit a0632529133fdaff9d70ac3e0cf6bb021c79438e)
Diffstat (limited to 'source3/libsmb/clientgen.c')
-rw-r--r-- | source3/libsmb/clientgen.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index d2a7749490..0a61a74cce 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -953,6 +953,12 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode) unsigned openfn=0; unsigned accessmode=0; + /* you must open for RW not just write - otherwise getattrE doesn't + work! */ + if ((flags & O_ACCMODE) == O_WRONLY) { + flags = (flags & ~O_ACCMODE) | O_RDWR; + } + if (flags & O_CREAT) openfn |= (1<<4); if (!(flags & O_EXCL)) { @@ -964,9 +970,9 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode) accessmode = (share_mode<<4); - if ((flags & O_RDWR) == O_RDWR) { + if ((flags & O_ACCMODE) == O_RDWR) { accessmode |= 2; - } else if ((flags & O_WRONLY) == O_WRONLY) { + } else if ((flags & O_ACCMODE) == O_WRONLY) { accessmode |= 1; } @@ -1503,8 +1509,8 @@ BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, send a qfileinfo call ****************************************************************************/ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - time_t *c_time, time_t *a_time, time_t *m_time, - uint32 *size, int *mode) + uint32 *mode, size_t *size, + time_t *c_time, time_t *a_time, time_t *m_time) { int data_len = 0; int param_len = 0; @@ -2172,6 +2178,7 @@ int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num) case NT_STATUS_NO_MEMORY: return ENOMEM; case NT_STATUS_ACCESS_DENIED: return EACCES; case NT_STATUS_OBJECT_NAME_NOT_FOUND: return ENOENT; + case NT_STATUS_SHARING_VIOLATION: return EBUSY; } /* for all other cases - a default code */ |