[Spice-devel,vdagent-win,4/6] vdagent: file-xfer: make user desktop the target directory

Submitted by Uri Lublin on Nov. 7, 2013, 10:02 p.m.

Details

Message ID 1383861776-25959-5-git-send-email-uril@redhat.com
State Superseded
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin Nov. 7, 2013, 10:02 p.m.
Before, the target directory was a public one (for all users),
as file creation was not done with user privileges.

Now that the file is created with user privileges, it's
better to make the user desktop the target directory.

Patch hide | download patch | download mbox

diff --git a/vdagent/file_xfer.cpp b/vdagent/file_xfer.cpp
index 0c44c45..e402eb2 100644
--- a/vdagent/file_xfer.cpp
+++ b/vdagent/file_xfer.cpp
@@ -60,7 +60,7 @@  void FileXfer::handle_start(VDAgentFileXferStartMessage* start,
         return;
     }

-    if (FAILED(SHGetFolderPathA(NULL, CSIDL_COMMON_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE, NULL,
+    if (FAILED(SHGetFolderPathA(NULL, CSIDL_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE, NULL,
             SHGFP_TYPE_CURRENT, file_path))) {
         vd_printf("failed getting desktop path");
         return;

Comments

On Fri, Nov 08, 2013 at 12:02:54AM +0200, Uri Lublin wrote:
> Before, the target directory was a public one (for all users),
> as file creation was not done with user privileges.
> 
> Now that the file is created with user privileges, it's
> better to make the user desktop the target directory.
> 
> diff --git a/vdagent/file_xfer.cpp b/vdagent/file_xfer.cpp
> index 0c44c45..e402eb2 100644
> --- a/vdagent/file_xfer.cpp
> +++ b/vdagent/file_xfer.cpp
> @@ -60,7 +60,7 @@ void FileXfer::handle_start(VDAgentFileXferStartMessage* start,
>          return;
>      }
> 
> -    if (FAILED(SHGetFolderPathA(NULL, CSIDL_COMMON_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE, NULL,
> +    if (FAILED(SHGetFolderPathA(NULL, CSIDL_DESKTOPDIRECTORY | CSIDL_FLAG_CREATE, NULL,
>              SHGFP_TYPE_CURRENT, file_path))) {
>          vd_printf("failed getting desktop path");
>          return;

I'd make that patch 3/6 to group it with the as_user changes, but ACK
regardless of what you do.

Christophe