modules/vfs_audit.c

ソースコードを見る。

関数

static int audit_connect (vfs_handle_struct *handle, const char *svc, const char *user)
static void audit_disconnect (vfs_handle_struct *handle)
static SMB_STRUCT_DIR * audit_opendir (vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
static int audit_mkdir (vfs_handle_struct *handle, const char *path, mode_t mode)
static int audit_rmdir (vfs_handle_struct *handle, const char *path)
static int audit_open (vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode)
static int audit_close (vfs_handle_struct *handle, files_struct *fsp, int fd)
static int audit_rename (vfs_handle_struct *handle, const char *oldname, const char *newname)
static int audit_unlink (vfs_handle_struct *handle, const char *path)
static int audit_chmod (vfs_handle_struct *handle, const char *path, mode_t mode)
static int audit_chmod_acl (vfs_handle_struct *handle, const char *name, mode_t mode)
static int audit_fchmod (vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
static int audit_fchmod_acl (vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
static int audit_syslog_facility (vfs_handle_struct *handle)
static int audit_syslog_priority (vfs_handle_struct *handle)
NTSTATUS vfs_audit_init (void)

変数

static vfs_op_tuple audit_op_tuples []


関数

static int audit_connect ( vfs_handle_struct handle,
const char *  svc,
const char *  user 
) [static]

vfs_audit.c123 行で定義されています。

参照先 audit_syslog_facility()audit_syslog_priority()handleresult.

00124 {
00125         int result;
00126         
00127         openlog("smbd_audit", LOG_PID, audit_syslog_facility(handle));
00128 
00129         syslog(audit_syslog_priority(handle), "connect to service %s by user %s\n", 
00130                svc, user);
00131 
00132         result = SMB_VFS_NEXT_CONNECT(handle, svc, user);
00133 
00134         return result;
00135 }

static void audit_disconnect ( vfs_handle_struct handle  )  [static]

vfs_audit.c137 行で定義されています。

参照先 audit_syslog_priority()handle.

00138 {
00139         syslog(audit_syslog_priority(handle), "disconnected\n");
00140         SMB_VFS_NEXT_DISCONNECT(handle);
00141 
00142         return;
00143 }

static SMB_STRUCT_DIR * audit_opendir ( vfs_handle_struct handle,
const char *  fname,
const char *  mask,
uint32  attr 
) [static]

vfs_audit.c145 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00146 {
00147         SMB_STRUCT_DIR *result;
00148         
00149         result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
00150 
00151         syslog(audit_syslog_priority(handle), "opendir %s %s%s\n",
00152                fname,
00153                (result == NULL) ? "failed: " : "",
00154                (result == NULL) ? strerror(errno) : "");
00155 
00156         return result;
00157 }

static int audit_mkdir ( vfs_handle_struct handle,
const char *  path,
mode_t  mode 
) [static]

vfs_audit.c159 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00160 {
00161         int result;
00162         
00163         result = SMB_VFS_NEXT_MKDIR(handle, path, mode);
00164         
00165         syslog(audit_syslog_priority(handle), "mkdir %s %s%s\n", 
00166                path,
00167                (result < 0) ? "failed: " : "",
00168                (result < 0) ? strerror(errno) : "");
00169 
00170         return result;
00171 }

static int audit_rmdir ( vfs_handle_struct handle,
const char *  path 
) [static]

vfs_audit.c173 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00174 {
00175         int result;
00176 
00177         result = SMB_VFS_NEXT_RMDIR(handle, path);
00178 
00179         syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n", 
00180                path, 
00181                (result < 0) ? "failed: " : "",
00182                (result < 0) ? strerror(errno) : "");
00183 
00184         return result;
00185 }

static int audit_open ( vfs_handle_struct handle,
const char *  fname,
files_struct fsp,
int  flags,
mode_t  mode 
) [static]

vfs_audit.c187 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00188 {
00189         int result;
00190 
00191         result = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
00192 
00193         syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", 
00194                fname, result,
00195                ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", 
00196                (result < 0) ? "failed: " : "",
00197                (result < 0) ? strerror(errno) : "");
00198 
00199         return result;
00200 }

static int audit_close ( vfs_handle_struct handle,
files_struct fsp,
int  fd 
) [static]

vfs_audit.c202 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00203 {
00204         int result;
00205 
00206         result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
00207 
00208         syslog(audit_syslog_priority(handle), "close fd %d %s%s\n",
00209                fd,
00210                (result < 0) ? "failed: " : "",
00211                (result < 0) ? strerror(errno) : "");
00212 
00213         return result;
00214 }

static int audit_rename ( vfs_handle_struct handle,
const char *  oldname,
const char *  newname 
) [static]

vfs_audit.c216 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00217 {
00218         int result;
00219 
00220         result = SMB_VFS_NEXT_RENAME(handle, oldname, newname);
00221 
00222         syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n",
00223                oldname, newname,
00224                (result < 0) ? "failed: " : "",
00225                (result < 0) ? strerror(errno) : "");
00226 
00227         return result;    
00228 }

static int audit_unlink ( vfs_handle_struct handle,
const char *  path 
) [static]

vfs_audit.c230 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00231 {
00232         int result;
00233 
00234         result = SMB_VFS_NEXT_UNLINK(handle, path);
00235 
00236         syslog(audit_syslog_priority(handle), "unlink %s %s%s\n",
00237                path,
00238                (result < 0) ? "failed: " : "",
00239                (result < 0) ? strerror(errno) : "");
00240 
00241         return result;
00242 }

static int audit_chmod ( vfs_handle_struct handle,
const char *  path,
mode_t  mode 
) [static]

vfs_audit.c244 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00245 {
00246         int result;
00247 
00248         result = SMB_VFS_NEXT_CHMOD(handle, path, mode);
00249 
00250         syslog(audit_syslog_priority(handle), "chmod %s mode 0x%x %s%s\n",
00251                path, mode,
00252                (result < 0) ? "failed: " : "",
00253                (result < 0) ? strerror(errno) : "");
00254 
00255         return result;
00256 }

static int audit_chmod_acl ( vfs_handle_struct handle,
const char *  name,
mode_t  mode 
) [static]

vfs_audit.c258 行で定義されています。

参照先 audit_syslog_priority()errnohandleresultstrerror().

00259 {
00260         int result;
00261 
00262         result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode);
00263 
00264         syslog(audit_syslog_priority(handle), "chmod_acl %s mode 0x%x %s%s\n",
00265                path, mode,
00266                (result < 0) ? "failed: " : "",
00267                (result < 0) ? strerror(errno) : "");
00268 
00269         return result;
00270 }

static int audit_fchmod ( vfs_handle_struct handle,
files_struct fsp,
int  fd,
mode_t  mode 
) [static]

vfs_audit.c272 行で定義されています。

参照先 audit_syslog_priority()errnofiles_struct::fsp_namehandleresultstrerror().

00273 {
00274         int result;
00275 
00276         result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
00277 
00278         syslog(audit_syslog_priority(handle), "fchmod %s mode 0x%x %s%s\n",
00279                fsp->fsp_name, mode,
00280                (result < 0) ? "failed: " : "",
00281                (result < 0) ? strerror(errno) : "");
00282 
00283         return result;
00284 }

static int audit_fchmod_acl ( vfs_handle_struct handle,
files_struct fsp,
int  fd,
mode_t  mode 
) [static]

vfs_audit.c286 行で定義されています。

参照先 audit_syslog_priority()errnofiles_struct::fsp_namehandleresultstrerror().

00287 {
00288         int result;
00289 
00290         result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
00291 
00292         syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
00293                fsp->fsp_name, mode,
00294                (result < 0) ? "failed: " : "",
00295                (result < 0) ? strerror(errno) : "");
00296 
00297         return result;
00298 }

static int audit_syslog_facility ( vfs_handle_struct handle  )  [static]

vfs_audit.c78 行で定義されています。

参照先 handlelp_parm_enum().

参照元 audit_connect()smb_full_audit_connect().

00079 {
00080         static const struct enum_list enum_log_facilities[] = {
00081                 { LOG_USER, "USER" },
00082                 { LOG_LOCAL0, "LOCAL0" },
00083                 { LOG_LOCAL1, "LOCAL1" },
00084                 { LOG_LOCAL2, "LOCAL2" },
00085                 { LOG_LOCAL3, "LOCAL3" },
00086                 { LOG_LOCAL4, "LOCAL4" },
00087                 { LOG_LOCAL5, "LOCAL5" },
00088                 { LOG_LOCAL6, "LOCAL6" },
00089                 { LOG_LOCAL7, "LOCAL7" }
00090         };
00091 
00092         int facility;
00093 
00094         facility = lp_parm_enum(SNUM(handle->conn), "audit", "facility", enum_log_facilities, LOG_USER);
00095 
00096         return facility;
00097 }

static int audit_syslog_priority ( vfs_handle_struct handle  )  [static]

vfs_audit.c100 行で定義されています。

参照先 handlelp_parm_enum().

参照元 audit_chmod()audit_chmod_acl()audit_close()audit_connect()audit_disconnect()audit_fchmod()audit_fchmod_acl()audit_mkdir()audit_open()audit_opendir()audit_rename()audit_rmdir()audit_unlink()do_log().

00101 {
00102         static const struct enum_list enum_log_priorities[] = {
00103                 { LOG_EMERG, "EMERG" },
00104                 { LOG_ALERT, "ALERT" },
00105                 { LOG_CRIT, "CRIT" },
00106                 { LOG_ERR, "ERR" },
00107                 { LOG_WARNING, "WARNING" },
00108                 { LOG_NOTICE, "NOTICE" },
00109                 { LOG_INFO, "INFO" },
00110                 { LOG_DEBUG, "DEBUG" }
00111         };
00112 
00113         int priority;
00114 
00115         priority = lp_parm_enum(SNUM(handle->conn), "audit", "priority", enum_log_priorities, LOG_NOTICE);
00116 
00117         return priority;
00118 }

NTSTATUS vfs_audit_init ( void   ) 

vfs_audit.c301 行で定義されています。

参照先 audit_op_tuplessmb_register_vfs().

00302 {
00303         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "audit", audit_op_tuples);
00304 }


変数

vfs_op_tuple audit_op_tuples[] [static]

初期値:

 {
    
        

        {SMB_VFS_OP(audit_connect),     SMB_VFS_OP_CONNECT,     SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_disconnect),  SMB_VFS_OP_DISCONNECT,  SMB_VFS_LAYER_LOGGER},

        

        {SMB_VFS_OP(audit_opendir),     SMB_VFS_OP_OPENDIR,     SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_mkdir),               SMB_VFS_OP_MKDIR,       SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_rmdir),               SMB_VFS_OP_RMDIR,       SMB_VFS_LAYER_LOGGER},

        

        {SMB_VFS_OP(audit_open),                SMB_VFS_OP_OPEN,        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_close),               SMB_VFS_OP_CLOSE,       SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_rename),              SMB_VFS_OP_RENAME,      SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_unlink),              SMB_VFS_OP_UNLINK,      SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_chmod),               SMB_VFS_OP_CHMOD,       SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_fchmod),              SMB_VFS_OP_FCHMOD,      SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_chmod_acl),   SMB_VFS_OP_CHMOD_ACL,   SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_fchmod_acl),  SMB_VFS_OP_FCHMOD_ACL,  SMB_VFS_LAYER_LOGGER},
        
        
        
        {SMB_VFS_OP(NULL),                      SMB_VFS_OP_NOOP,        SMB_VFS_LAYER_NOOP}
}

vfs_audit.c48 行で定義されています。

参照元 vfs_audit_init()vfs_extd_audit_init()vfs_full_audit_init().


Sambaに対してSat Aug 29 21:23:51 2009に生成されました。  doxygen 1.4.7