Uninitialized memory read fixes.
authorJeremy Allison <jra@samba.org>
Wed, 15 Nov 2000 02:39:11 +0000 (02:39 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 15 Nov 2000 02:39:11 +0000 (02:39 +0000)
open_file_shared takes a DOS pathname, not a UNIX one.
Jeremy.
(This used to be commit b2b59b93ff1c5bdc43b099e2db1ee86fe8514152)

source3/printing/nt_printing.c

index 2c329c78a585c0cd0557819450cf328272add3ef..895e3c6b0521d249abf1cb6310b4b3da306bd3de 100644 (file)
@@ -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),