s3-printing: follow force user/group for driver IO
authorDavid Disseldorp <ddiss@suse.de>
Wed, 2 Mar 2011 13:34:28 +0000 (14:34 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 7 Mar 2011 09:42:14 +0000 (10:42 +0100)
commit2a791861462977a82b33ad57a4d5203dc9270aff
tree4e0bb51c02774bf31e6d91cbaecefc5f2b2f6ff4
parentb0ad40783e4d04c8cde07baaa84bed4ccf83e9c4
s3-printing: follow force user/group for driver IO

Configuring force user/group settings for the print$ share currently has
unexpected results, this is explained by how the driver upload/add
process takes place. Consider the following example:

[print$]
        path = /print-drv
        write list = $DRIVER_UPLOAD_USER
        force group = ntadmin

- the client connects to the [print$] share and uploads all driver
  files to the /print-drv/W32X86 directory.

- This is permitted, as /print-drv/W32X86 is owned by group ntadmin, and
  the "force group = ntadmin" takes effect for the [print$] session.

- Once all files are uploaded, the client connects to the [ipc$]
  share and issues an AddPrinterDriverEx spoolss request.

- In handling this request move_driver_to_download_area() is called,
  which attempts to create the directory /print-drv/W32X86/3

- The create directory fails, as it is done as the user connected to
  the [ipc$] share which does not have permission to write to the driver
  directory. The [print$] "force group = ntadmin" has no effect.

This is a regression from previous behaviour prior to the commit:
783ab04 Convert move_driver_to_download_area to use create_conn_struct.

https://bugzilla.samba.org/show_bug.cgi?id=7921
source3/include/proto.h
source3/printing/nt_printing.c
source3/smbd/service.c