[PATCH] Re: [Samba] 2.2.7a panic with VFS Audit when writing file (reading is ok)

Hal Roberts hroberts at cyber.law.harvard.edu
Fri Feb 14 21:49:45 GMT 2003


I got this working with the following patch.  I'm not sure 
if this is the cleanest possible fix, but it works for me.

-hal

--- samba-2.2.7a-dist/examples/VFS/audit.c      Tue Dec 10 
09:57:59 2002
+++ samba-2.2.7a/examples/VFS/audit.c   Fri Feb 14 10:50:18 2003
@@ -288,36 +288,48 @@

  int audit_chmod_acl(struct connection_struct *conn, const 
char *path, mode_t mode)
  {
-       int result = default_vfs_ops.chmod_acl(conn, path, 
mode);
-
-       syslog(SYSLOG_PRIORITY, "chmod_acl %s mode 0x%x %s%s\n",
-              path, mode,
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : "");
-
-       return result;
+       int result;
+
+       if (!default_vfs_ops.fchmod_acl) {
+               return 0;
+       } else {
+               result = default_vfs_ops.chmod_acl(conn, 
path, mode);
+
+               syslog(SYSLOG_PRIORITY, "chmod_acl %s mode 
0x%x %s%s\n",
+                      path, mode,
+                      (result < 0) ? "failed: " : "",
+                      (result < 0) ? strerror(errno) : "");
+
+               return result;
+       }
  }

  int audit_fchmod(struct files_struct *fsp, int fd, mode_t 
mode)
  {
         int result = default_vfs_ops.fchmod(fsp, fd, mode);
-
+
         syslog(SYSLOG_PRIORITY, "fchmod %s mode 0x%x %s%s\n",
                fsp->fsp_name, mode,
                (result < 0) ? "failed: " : "",
                (result < 0) ? strerror(errno) : "");
-
+
         return result;
  }

  int audit_fchmod_acl(struct files_struct *fsp, int fd, 
mode_t mode)
  {
-       int result = default_vfs_ops.fchmod_acl(fsp, fd, mode);
-
-       syslog(SYSLOG_PRIORITY, "fchmod_acl %s mode 0x%x 
%s%s\n",
-              fsp->fsp_name, mode,
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : "");
-
-       return result;
+       int result;
+
+       if (!default_vfs_ops.fchmod_acl) {
+               return 0;
+       } else {
+               result = default_vfs_ops.fchmod_acl(fsp, fd, 
mode);
+
+               syslog(SYSLOG_PRIORITY, "fchmod_acl %s mode 
0x%x %s%s\n",
+                      fsp->fsp_name, mode,
+                      (result < 0) ? "failed: " : "",
+                      (result < 0) ? strerror(errno) : "");
+
+               return result;
+       }
  }

Gerald (Jerry) Carter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tue, 11 Feb 2003, Chris Shenton wrote:
> 
> 
>>  ===============================================================
>>[2003/02/11 10:19:47, 0] lib/fault.c:fault_report(39)
>>  INTERNAL ERROR: Signal 11 in pid 6357 (2.2.7a)
>>  Please read the file BUGS.txt in the distribution
>>[2003/02/11 10:19:47, 0] lib/fault.c:fault_report(41)
>>  ===============================================================
> 
> 
> already reported.  We'll get this fixed for 2.2.8
> 
> 
> 
> 
> thanks, jerry
>  ----------------------------------------------------------------------
>  Hewlett-Packard            ------------------------- http://www.hp.com
>  SAMBA Team                 ---------------------- http://www.samba.org
>  GnuPG Key                  ---- http://www.plainjoe.org/gpg_public.asc
>  "You can never go home again, Oatman, but I guess you can shop there."  
>                             --John Cusack - "Grosse Point Blank" (1997)
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.0 (GNU/Linux)
> Comment: For info see http://quantumlab.net/pine_privacy_guard/
> 
> iD8DBQE+S9pjIR7qMdg1EfYRAjhlAKCEp+8umQYRaNU6QdSTZY//Gcu6IgCgr5jQ
> W1WWnw027E1OJ7TV0gT8/Ww=
> =U+PS
> -----END PGP SIGNATURE-----
> 




More information about the samba mailing list