The Samba-Bugzilla – Attachment 3796 Details for
Bug 5956
vfs_extd_audit logging fix.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
vfs_extd_audit.c patch
vfs_extd_audit.patch (text/plain), 7.41 KB, created by
Oskar Wycislak
on 2008-12-09 08:40:05 UTC
(
hide
)
Description:
vfs_extd_audit.c patch
Filename:
MIME Type:
Creator:
Oskar Wycislak
Created:
2008-12-09 08:40:05 UTC
Size:
7.41 KB
patch
obsolete
>--- vfs_extd_audit.c.orig 2008-11-18 16:17:17.000000000 +0100 >+++ vfs_extd_audit.c 2008-12-09 14:36:07.000000000 +0100 >@@ -24,10 +24,10 @@ > > #include "includes.h" > >-static int vfs_extd_audit_debug_level = DBGC_VFS; >- > #undef DBGC_CLASS >-#define DBGC_CLASS vfs_extd_audit_debug_level >+#define DBGC_CLASS DBGC_VFS >+ >+static int vfs_extd_audit_debug_level = DBGC_VFS; > > /* Function prototypes */ > >@@ -132,8 +132,9 @@ > > openlog("smbd_audit", LOG_PID, audit_syslog_facility(handle)); > >- syslog(audit_syslog_priority(handle), "connect to service %s by user %s\n", >- svc, user); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "connect to service %s by user %s\n", >+ svc, user); > DEBUG(10, ("Connected to service %s as user %s\n", > svc, user)); > >@@ -144,7 +145,8 @@ > > static void audit_disconnect(vfs_handle_struct *handle) > { >- syslog(audit_syslog_priority(handle), "disconnected\n"); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "disconnected\n"); > DEBUG(10, ("Disconnected from VFS module extd_audit\n")); > SMB_VFS_NEXT_DISCONNECT(handle); > >@@ -157,10 +159,11 @@ > > result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); > >- syslog(audit_syslog_priority(handle), "opendir %s %s%s\n", >- fname, >- (result == NULL) ? "failed: " : "", >- (result == NULL) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "opendir %s %s%s\n", >+ fname, >+ (result == NULL) ? "failed: " : "", >+ (result == NULL) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: opendir %s %s %s\n", > fname, > (result == NULL) ? "failed: " : "", >@@ -175,10 +178,11 @@ > > result = SMB_VFS_NEXT_MKDIR(handle, path, mode); > >- syslog(audit_syslog_priority(handle), "mkdir %s %s%s\n", >- path, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "mkdir %s %s%s\n", >+ path, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(0, ("vfs_extd_audit: mkdir %s %s %s\n", > path, > (result < 0) ? "failed: " : "", >@@ -193,10 +197,11 @@ > > result = SMB_VFS_NEXT_RMDIR(handle, path); > >- syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n", >- path, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n", >+ path, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(0, ("vfs_extd_audit: rmdir %s %s %s\n", > path, > (result < 0) ? "failed: " : "", >@@ -211,11 +216,12 @@ > > result = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); > >- syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", >- fname, result, >- ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", >+ fname, result, >+ ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(2, ("vfs_extd_audit: open %s %s %s\n", > fname, > (result < 0) ? "failed: " : "", >@@ -230,10 +236,11 @@ > > result = SMB_VFS_NEXT_CLOSE(handle, fsp); > >- syslog(audit_syslog_priority(handle), "close fd %d %s%s\n", >- fsp->fh->fd, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "close fd %d %s%s\n", >+ fsp->fh->fd, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(2, ("vfs_extd_audit: close fd %d %s %s\n", > fsp->fh->fd, > (result < 0) ? "failed: " : "", >@@ -248,10 +255,11 @@ > > result = SMB_VFS_NEXT_RENAME(handle, oldname, newname); > >- syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n", >- oldname, newname, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n", >+ oldname, newname, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: rename old: %s newname: %s %s %s\n", > oldname, newname, > (result < 0) ? "failed: " : "", >@@ -266,10 +274,11 @@ > > result = SMB_VFS_NEXT_UNLINK(handle, path); > >- syslog(audit_syslog_priority(handle), "unlink %s %s%s\n", >- path, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "unlink %s %s%s\n", >+ path, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(0, ("vfs_extd_audit: unlink %s %s %s\n", > path, > (result < 0) ? "failed: " : "", >@@ -284,10 +293,11 @@ > > result = SMB_VFS_NEXT_CHMOD(handle, path, mode); > >- syslog(audit_syslog_priority(handle), "chmod %s mode 0x%x %s%s\n", >- path, mode, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "chmod %s mode 0x%x %s%s\n", >+ path, mode, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: chmod %s mode 0x%x %s %s\n", > path, mode, > (result < 0) ? "failed: " : "", >@@ -302,10 +312,11 @@ > > result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode); > >- syslog(audit_syslog_priority(handle), "chmod_acl %s mode 0x%x %s%s\n", >- path, mode, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "chmod_acl %s mode 0x%x %s%s\n", >+ path, mode, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: chmod_acl %s mode 0x%x %s %s\n", > path, mode, > (result < 0) ? "failed: " : "", >@@ -320,10 +331,11 @@ > > result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode); > >- syslog(audit_syslog_priority(handle), "fchmod %s mode 0x%x %s%s\n", >- fsp->fsp_name, mode, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "fchmod %s mode 0x%x %s%s\n", >+ fsp->fsp_name, mode, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: fchmod %s mode 0x%x %s %s", > fsp->fsp_name, mode, > (result < 0) ? "failed: " : "", >@@ -338,10 +350,11 @@ > > result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode); > >- syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n", >- fsp->fsp_name, mode, >- (result < 0) ? "failed: " : "", >- (result < 0) ? strerror(errno) : ""); >+ if(lp_syslog() > 0) >+ syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n", >+ fsp->fsp_name, mode, >+ (result < 0) ? "failed: " : "", >+ (result < 0) ? strerror(errno) : ""); > DEBUG(1, ("vfs_extd_audit: fchmod_acl %s mode 0x%x %s %s", > fsp->fsp_name, mode, > (result < 0) ? "failed: " : "",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5956
: 3796