Turns out I was simply looking in the wrong place - I had forgotten that the account on the Windows host needed to have correct access permissions set on the shared folder; it only had
Read & execute,
List folder contents. Doh! Adding
Modify fixed the problem. So nothing but a silly mistake - but I also learned a bit more about the cifs syntax and
fstab and figured out how to mount as a humble user, allowing the mount points to be in my
/home/user folder. The final mount string in my fstab looks like this (my values replaced with [tokens]):
//[server]/[share] /home/[user]/[folder] cifs credentials=/home/[user]/.config/samba/.[server],uid=[user],gid=[group] 0 0
So you only need to set
gid to the user and group that you want to own the files on the share after mounting - no need for anything else. I also put the Windows user credentials needed in a separate file under my .config dir and did
chmod 400 to stop others from reading it.
It took a surprisingly long time to figure all this out as there are a million arguments to use with cifs, and many seem to have misunderstood them - so many people recommend using
dir_mode 777 (which sounds like a really bad idea to me), and pepper with unnecessary arguments like
noacl - none of which are needed to make this work. So while my problem was caused by a simple mistake I'll leave the question (and this answer) here; hopefully someone will find it helpful!
Edit: Due to a bug in Samba's cifs implementation it is necessary to add the
nobrl option as well if you intend to run SQLite databases on the share. Basically, the current Samba cifs Linux client cannot handle the way SQLite locks the database file. Not a great solution, and almost certainly a bad idea in a multi user environment but since in my case it's a single user share, and hosted on the same machine as the client (which should all but eliminate network latency), I'm gonna roll with it.
Do not send byte range lock requests to the server. This is necessary
for certain applications that break with cifs style mandatory byte
range locks (and most cifs servers do not yet support requesting
advisory byte range locks).
The fstab entry now looks like this:
//[server]/[share] /home/[user]/[folder] cifs nobrl,credentials=/home/[user]/.config/samba/.[server],uid=[user],gid=[group] 0 0