1495
1495
static NTSTATUS driver_unlink_internals(connection_struct *conn,
1496
const char *short_arch,
1500
TALLOC_CTX *tmp_ctx = talloc_new(conn);
1498
1501
struct smb_filename *smb_fname = NULL;
1501
status = create_synthetic_smb_fname(talloc_tos(), name, NULL, NULL,
1502
char *print_dlr_path;
1503
NTSTATUS status = NT_STATUS_NO_MEMORY;
1505
print_dlr_path = talloc_asprintf(tmp_ctx, "%s/%d/%s",
1506
short_arch, vers, fname);
1507
if (print_dlr_path == NULL) {
1511
status = create_synthetic_smb_fname(tmp_ctx, print_dlr_path,
1512
NULL, NULL, &smb_fname);
1503
1513
if (!NT_STATUS_IS_OK(status)) {
1507
1517
status = unlink_internals(conn, NULL, 0, smb_fname, false);
1509
TALLOC_FREE(smb_fname);
1519
talloc_free(tmp_ctx);
1575
/* now delete the files; must strip the '\print$' string from
1583
short_arch = get_short_archi(r->architecture);
1584
if (short_arch == NULL) {
1585
DEBUG(0, ("bad architecture %s\n", r->architecture));
1590
/* now delete the files */
1578
1592
if (r->driver_path && r->driver_path[0]) {
1579
if ((s = strchr(&r->driver_path[1], '\\')) != NULL) {
1581
DEBUG(10,("deleting driverfile [%s]\n", s));
1582
driver_unlink_internals(conn, file);
1593
DEBUG(10,("deleting driverfile [%s]\n", r->driver_path));
1594
driver_unlink_internals(conn, short_arch, r->version, r->driver_path);
1586
1597
if (r->config_file && r->config_file[0]) {
1587
if ((s = strchr(&r->config_file[1], '\\')) != NULL) {
1589
DEBUG(10,("deleting configfile [%s]\n", s));
1590
driver_unlink_internals(conn, file);
1598
DEBUG(10,("deleting configfile [%s]\n", r->config_file));
1599
driver_unlink_internals(conn, short_arch, r->version, r->config_file);
1594
1602
if (r->data_file && r->data_file[0]) {
1595
if ((s = strchr(&r->data_file[1], '\\')) != NULL) {
1597
DEBUG(10,("deleting datafile [%s]\n", s));
1598
driver_unlink_internals(conn, file);
1603
DEBUG(10,("deleting datafile [%s]\n", r->data_file));
1604
driver_unlink_internals(conn, short_arch, r->version, r->data_file);
1602
1607
if (r->help_file && r->help_file[0]) {
1603
if ((s = strchr(&r->help_file[1], '\\')) != NULL) {
1605
DEBUG(10,("deleting helpfile [%s]\n", s));
1606
driver_unlink_internals(conn, file);
1608
DEBUG(10,("deleting helpfile [%s]\n", r->help_file));
1609
driver_unlink_internals(conn, short_arch, r->version, r->help_file);
1610
/* check if we are done removing files */
1612
1612
if (r->dependent_files) {
1613
1614
while (r->dependent_files[i] && r->dependent_files[i][0]) {
1616
/* bypass the "\print$" portion of the path */
1618
if ((p = strchr(r->dependent_files[i]+1, '\\')) != NULL) {
1620
DEBUG(10,("deleting dependent file [%s]\n", file));
1621
driver_unlink_internals(conn, file);
1615
DEBUG(10,("deleting dependent file [%s]\n", r->dependent_files[i]));
1616
driver_unlink_internals(conn, short_arch, r->version, r->dependent_files[i]);