fix uninitialized memory usage in sys_vfs_open, resulting in unwanted fchown calls

Wed, 22 Mar 2023 18:18:22 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 22 Mar 2023 18:18:22 +0100
changeset 486
133118c79f4e
parent 485
222557f4f595
child 487
f2b0e48aa483

fix uninitialized memory usage in sys_vfs_open, resulting in unwanted fchown calls

src/server/daemon/vfs.c file | annotate | diff | comparison | revisions
--- a/src/server/daemon/vfs.c	Sun Mar 19 16:53:49 2023 +0100
+++ b/src/server/daemon/vfs.c	Wed Mar 22 18:18:22 2023 +0100
@@ -393,7 +393,7 @@
     }
     
     // if a file system acl is active, we set the owner for newly created files
-    if(((oflags & O_CREAT) == O_CREAT) && sysacl.user_uid != -1) {
+    if(((oflags & O_CREAT) == O_CREAT) && sysacl.acl) {
         if(fchown(fd, sysacl.user_uid, sysacl.user_gid)) {
             perror("vfs_open: fchown");
             system_close(fd);

mercurial