return True;
}
+/*******************************************************************
+ Function to allow filename parsing "the old way".
+********************************************************************/
+
+static BOOL driver_unix_convert(char *name,connection_struct *conn,
+ char *saved_last_component, BOOL *bad_path, SMB_STRUCT_STAT *pst)
+{
+ unix_format(name);
+ unix_clean_name(name);
+ trim_string(name,"/","/");
+ return unix_convert(name, conn, saved_last_component, bad_path, pst);
+}
+
/*******************************************************************
tdb traversal function for counting printers.
********************************************************************/
/* Get file version info (if available) for previous file (if it exists) */
pstrcpy(filepath, old_file);
- unix_convert(filepath,conn,NULL,&bad_path,&stat_buf);
+ driver_unix_convert(filepath,conn,NULL,&bad_path,&stat_buf);
fsp = open_file_shared(conn, filepath, &stat_buf,
SET_OPEN_MODE(DOS_OPEN_RDONLY),
/* Get file version info (if available) for new file */
pstrcpy(filepath, new_file);
- unix_convert(filepath,conn,NULL,&bad_path,&stat_buf);
+ driver_unix_convert(filepath,conn,NULL,&bad_path,&stat_buf);
fsp = open_file_shared(conn, filepath, &stat_buf,
SET_OPEN_MODE(DOS_OPEN_RDONLY),
* deriver the cversion. */
slprintf(driverpath, sizeof(driverpath)-1, "%s/%s", architecture, driverpath_in);
- unix_convert(driverpath,conn,NULL,&bad_path,&st);
+ driver_unix_convert(driverpath,conn,NULL,&bad_path,&st);
fsp = open_file_shared(conn, driverpath, &st,
SET_OPEN_MODE(DOS_OPEN_RDONLY),
pstring inbuf;
pstring outbuf;
fstring res_type;
+ BOOL bad_path;
+ SMB_STRUCT_STAT st;
int ver = 0;
int i;
*/
DEBUG(5,("Creating first directory\n"));
slprintf(new_dir, sizeof(new_dir)-1, "%s/%d", architecture, driver->cversion);
+ driver_unix_convert(new_dir, conn, NULL, &bad_path, &st);
mkdir_internal(conn, new_dir);
/* For each driver file, archi\filexxx.yyy, if there is a duplicate file
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->driverpath);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
NTSTATUS status;
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
status = rename_internals(conn, new_name, old_name, 0, True);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
unlink_internals(conn, 0, new_name);
ver = -1;
}
- }
- else
+ } else {
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
unlink_internals(conn, 0, new_name);
+ }
}
if (driver->datafile && strlen(driver->datafile)) {
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->datafile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
NTSTATUS status;
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
status = rename_internals(conn, new_name, old_name, 0, True);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
unlink_internals(conn, 0, new_name);
ver = -1;
}
- }
- else
+ } else {
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
unlink_internals(conn, 0, new_name);
+ }
}
}
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->configfile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
NTSTATUS status;
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
status = rename_internals(conn, new_name, old_name, 0, True);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
unlink_internals(conn, 0, new_name);
ver = -1;
}
- }
- else
+ } else {
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
unlink_internals(conn, 0, new_name);
+ }
}
}
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->helpfile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
NTSTATUS status;
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
status = rename_internals(conn, new_name, old_name, 0, True);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
unlink_internals(conn, 0, new_name);
ver = -1;
}
- }
- else
+ } else {
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
unlink_internals(conn, 0, new_name);
+ }
}
}
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->dependentfiles[i]);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
NTSTATUS status;
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
status = rename_internals(conn, new_name, old_name, 0, True);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
unlink_internals(conn, 0, new_name);
ver = -1;
}
- }
- else
+ } else {
+ driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
unlink_internals(conn, 0, new_name);
+ }
}
NextDriver: ;
}
DATA_BLOB null_pw;
NTSTATUS nt_status;
fstring res_type;
+ BOOL bad_path;
+ SMB_STRUCT_STAT st;
if ( !info_3 )
return False;
if ( *info_3->driverpath ) {
if ( (s = strchr( &info_3->driverpath[1], '\\' )) != NULL ) {
+ driver_unix_convert(s, conn, NULL, &bad_path, &st);
DEBUG(10,("deleting driverfile [%s]\n", s));
unlink_internals(conn, 0, s);
}
if ( *info_3->configfile ) {
if ( (s = strchr( &info_3->configfile[1], '\\' )) != NULL ) {
+ driver_unix_convert(s, conn, NULL, &bad_path, &st);
DEBUG(10,("deleting configfile [%s]\n", s));
unlink_internals(conn, 0, s);
}
if ( *info_3->datafile ) {
if ( (s = strchr( &info_3->datafile[1], '\\' )) != NULL ) {
+ driver_unix_convert(s, conn, NULL, &bad_path, &st);
DEBUG(10,("deleting datafile [%s]\n", s));
unlink_internals(conn, 0, s);
}
if ( *info_3->helpfile ) {
if ( (s = strchr( &info_3->helpfile[1], '\\' )) != NULL ) {
+ driver_unix_convert(s, conn, NULL, &bad_path, &st);
DEBUG(10,("deleting helpfile [%s]\n", s));
unlink_internals(conn, 0, s);
}
/* bypass the "\print$" portion of the path */
if ( (file = strchr( info_3->dependentfiles[i]+1, '\\' )) != NULL ) {
+ driver_unix_convert(file, conn, NULL, &bad_path, &st);
DEBUG(10,("deleting dependent file [%s]\n", file));
unlink_internals(conn, 0, file );
}
return ok;
}
-