summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2018-05-01 11:19:49 -0700
committerRalph Boehme <slow@samba.org>2018-05-04 22:34:24 +0200
commit9bf5d0da9516635eef5af246a3c7b5f3b0648f74 (patch)
tree839f1be45d288c35980d0a8342c0e539f19005b7 /source3/printing
parenta87328edee55c4e71b468da8642689bb24b6bb1d (diff)
downloadsamba-9bf5d0da9516635eef5af246a3c7b5f3b0648f74.tar.gz
s3: printing: Use offset tracking in printing_pread_data() to remove the seek in handle_ne_file().
Uses the fact that: lseek(fd, 0, SEEK_CUR) is merely getting the current file position, which we have already tracked in in_pos. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index dbcf71a4cdb..328964579d8 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -546,7 +546,7 @@ static int handle_pe_file(files_struct *fsp,
****************************************************************************/
static int handle_ne_file(files_struct *fsp,
- off_t in_pos_unused,
+ off_t in_pos,
char *fname,
char *buf,
uint32_t *major,
@@ -555,7 +555,6 @@ static int handle_ne_file(files_struct *fsp,
unsigned int i;
ssize_t byte_count;
int ret = -1;
- off_t in_pos = -1;
if (CVAL(buf,NE_HEADER_TARGET_OS_OFFSET) != NE_HEADER_TARGOS_WIN ) {
DBG_NOTICE("NE file [%s] wrong target OS = 0x%x\n",
@@ -658,10 +657,7 @@ static int handle_ne_file(files_struct *fsp,
* Compute skip alignment to next
* long address.
*/
- off_t cpos = SMB_VFS_LSEEK(fsp,
- 0,
- SEEK_CUR);
-
+ off_t cpos = in_pos;
int skip = -(cpos - (byte_count - i) +
sizeof(VS_SIGNATURE)) & 3;
if (IVAL(buf,