[PATCH] Add support for APD_COPY_FROM_DIRECTORY in AddPrinterDriverEx()

Andreas Schneider asn at samba.org
Thu Nov 17 08:04:13 UTC 2016


On Wednesday, 16 November 2016 15:28:08 CET Jeremy Allison wrote:
> Why not just do another strrchr_m ?

Doh :)
 
> Shouldn't this be (with added comments):
> 
> +		/* Remove last component. */
> +               q = strrchr_m(path, '\\');
> +               if (q == NULL) {
> +                       return WERR_INVALID_PARAMETER;
> +               }
> +               *q = '\0';
> +
> +		/* Find next to last component. */
> +		q = strrchr_m(path, '\\');
> +
> +               if (*q != '\\') {
> +                       /* Windows returns 0x00000bcb */
> +                       return WERR_INVALID_PARAMETER;
> +               }
> +
> +               *driver_directory = q + 1;
> 
> I guess I don't understand exactly what APD_COPY_FROM_DIRECTORY
> means. Can you explain in the code exactly what you're trying
> to achieve here ?

See attached patch :)


	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spoolss_copy_from_directory.patch
Type: text/x-patch
Size: 18099 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161117/1e6dba31/spoolss_copy_from_directory.bin>


More information about the samba-technical mailing list