s3: Change unix_convert (and its callers) to use struct smb_filename
[kai/samba.git] / source3 / printing / nt_printing.c
index 34b7a577f89ca1e37b5c37ed28d40edc331e6c8d..39e9661bd68e2b55f72da42ab27b43ca1d3189dd 100644 (file)
@@ -638,7 +638,9 @@ static char *driver_unix_convert(connection_struct *conn,
                const char *old_name,
                SMB_STRUCT_STAT *pst)
 {
+       NTSTATUS status;
        TALLOC_CTX *ctx = talloc_tos();
+       struct smb_filename *smb_fname = NULL;
        char *name = talloc_strdup(ctx, old_name);
        char *new_name = NULL;
 
@@ -651,7 +653,20 @@ static char *driver_unix_convert(connection_struct *conn,
                return NULL;
        }
        trim_string(name,"/","/");
-       unix_convert(ctx,conn, name, false, &new_name, NULL, pst);
+
+       status = unix_convert(ctx, conn, name, &smb_fname, 0);
+       if (!NT_STATUS_IS_OK(status)) {
+               return NULL;
+       }
+
+       *pst = smb_fname->st;
+       status = get_full_smb_filename(ctx, smb_fname, &new_name);
+       if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(smb_fname);
+               return NULL;
+       }
+
+       TALLOC_FREE(smb_fname);
        return new_name;
 }