Closed rawhide-kobayashi closed 1 month ago
what in the blatantly obvious spambot
Can you check two things ?
Here are two wireshark logs, for the git commit command as shown in the demo above - one showing the failing transaction with ksmbd, and another showing a successful transaction with samba.
What ksmbd are you using ? github-ksmbd or ksmbd in linux kernel ? I would like to give the patch to you to check if problem is fixed or not.
Can you check if your problem is fixed ?
From 910ddff523b59ae9e96af6adb1012da302861f10 Mon Sep 17 00:00:00 2001
From: Namjae Jeon <linkinjeon@kernel.org>
Date: Thu, 29 Aug 2024 08:45:01 +0900
Subject: [PATCH 1/3] ksmbd: allow write with FILE_APPEND_DATA
Windows client write with FILE_APPEND_DATA when using git.
ksmbd should allow write it with this flags.
Z:\test>git commit -m "test"
fatal: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Bad file descriptor
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
vfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vfs.c b/vfs.c
index e415211..4428013 100644
--- a/vfs.c
+++ b/vfs.c
@@ -770,7 +770,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
int err = 0;
if (work->conn->connection_type) {
- if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
+ if (!(fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
pr_err("no right to write(%pD)\n", fp->filp);
err = -EACCES;
goto out;
--
2.25.1
Sorry for the delay, I'll be able to test it on Saturday.
I built from https://github.com/namjaejeon/ksmbd/commit/910ddff523b59ae9e96af6adb1012da302861f10 and it works!
Z:\test2>git commit -m "test"
[master (root-commit) be059e4] test
1 file changed, 1 insertion(+)
create mode 100644 example.txt
Tysm!
@rawhide-kobayashi Thanks for your confirmation!
Hello, I'm encountering a consistent issue that exists in ksmbd but not in smb with an otherwise identical configuration and filesystem permissions.
ksmbd-tools version: 3.5.2 ksmbd version: 3.5.0 kernel version: Arch Linux 6.6.47-1-lts
Whenever I try to create a git commit in a directory shared by ksmbd, I get this error on git cli:
And here is a relevant snippet from ksmbd log.
Here is my ksmbd.conf.
Here is a sample log to replicate my issue from Git CMD on Windows.
Btw, I can append >> a file just fine via windows cmd. It doesn't error out. I've only encountered a problem with git so far.