diff options
author | Jeremy Allison <jra@samba.org> | 2000-11-15 02:39:11 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-11-15 02:39:11 +0000 |
commit | 14355a6434952071e862af3a1e7bcfbbf640a6a3 (patch) | |
tree | 6da912651ea61b85e3bbe783b33c981d98ecce16 /source3/printing | |
parent | e8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa (diff) | |
download | samba-14355a6434952071e862af3a1e7bcfbbf640a6a3.tar.gz samba-14355a6434952071e862af3a1e7bcfbbf640a6a3.tar.bz2 samba-14355a6434952071e862af3a1e7bcfbbf640a6a3.zip |
Uninitialized memory read fixes.
open_file_shared takes a DOS pathname, not a UNIX one.
Jeremy.
(This used to be commit b2b59b93ff1c5bdc43b099e2db1ee86fe8514152)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 2c329c78a5..895e3c6b05 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -359,6 +359,8 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in, struct passwd *pass; connection_struct *conn; + ZERO_STRUCT(st); + /* If architecture is Windows 95/98, the version is always 0. */ if (strcmp(architecture, "WIN40") == 0) { DEBUG(10,("get_correct_cversion: Driver is Win9x, cversion = 0\n")); @@ -404,7 +406,6 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in, /* Open the driver file (Portable Executable format) and determine the * deriver the cversion. */ slprintf(driverpath, sizeof(driverpath), "%s/%s", architecture, driverpath_in); - dos_to_unix(driverpath, True); fsp = open_file_shared(conn, driverpath, &st, SET_OPEN_MODE(DOS_OPEN_RDONLY), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), @@ -958,9 +959,13 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, SMB_STRUCT_STAT st; SMB_STRUCT_STAT stat_buf; + ZERO_STRUCT(st); + ZERO_STRUCT(stat_buf); + new_create_time = (time_t)0; + old_create_time = (time_t)0; + /* Get file version info (if available) for previous file (if it exists) */ pstrcpy(filepath, old_file); - dos_to_unix(filepath, True); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), @@ -991,7 +996,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, /* Get file version info (if available) for new file */ pstrcpy(filepath, new_file); - dos_to_unix(filepath, True); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), |