Skip to content

Commit

Permalink
Add fix for chromium saving files to FUSE filesys
Browse files Browse the repository at this point in the history
Chromium 130 won't save to our filesystem if we don't return a
max filename length.

Dummy parameters were tried for inode counts, but these do not seem to
be necessary. Not also that btrfs foes not return values for these
fields.
  • Loading branch information
matt335672 committed Nov 11, 2024
1 parent 5dc4fdb commit 6a49ff9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 7 additions & 7 deletions sesman/chansrv/chansrv_xfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
#ifndef _CHANSRV_XFS
#define _CHANSRV_XFS

/* Skip this include if there's no FUSE */
/* Maximum length of filename supported (in bytes).
* This is a sensible limit to a filename length. It is not used by
* this module to allocate long-lived storage, so it can be increased
* if necessary */
#define XFS_MAXFILENAMELEN 1023

/* Skip the rest of this include if there's no FUSE */
#ifdef XRDP_FUSE

#include <stddef.h>
Expand All @@ -29,12 +35,6 @@

#include "arch.h"

/* Maximum length of filename supported (in bytes).
* This is a sensible limit to a filename length. It is not used by
* this module to allocate long-lived storage, so it can be increased
* if necessary */
#define XFS_MAXFILENAMELEN 1023

/*
* Incomplete types for the public interface
*/
Expand Down
12 changes: 8 additions & 4 deletions sesman/chansrv/devredir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,11 +1273,7 @@ devredir_proc_query_dir_response(IRP *irp,

// Size the filename buffer so it's big enough for
// storing the file in our filesystem if we need to.
#ifdef XFS_MAXFILENAMELEN
char filename[XFS_MAXFILENAMELEN + 1];
#else
char filename[256];
#endif
tui64 LastAccessTime;
tui64 LastWriteTime;
tui64 EndOfFile;
Expand Down Expand Up @@ -2441,6 +2437,14 @@ devredir_proc_cid_statfs_resp(IRP *irp,
fss.f_blocks = TotalAllocationUnits;
fss.f_bfree = ActualAvailableAllocationUnits;
fss.f_bavail = CallerAvailableAllocationUnits;
// Following values do not seem to be needed by
// any applications. btrfs also returns 0 for these
//fss.f_files = ???;
//fss.f_ffree = ???;
//fss.f_favail = fss.f_ffree;
// Chromium 130 needs this set, or the user can't save
// to our filesystem
fss.f_namemax = XFS_MAXFILENAMELEN;
}
}
}
Expand Down

0 comments on commit 6a49ff9

Please sign in to comment.