~ubuntu-branches/ubuntu/quantal/syslog-ng/quantal

« back to all changes in this revision

Viewing changes to .pc/kfreebsd-security-fix.patch/src/affile.h

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2011-01-01 21:46:47 UTC
  • Revision ID: james.westby@ubuntu.com-20110101214647-lp8ghyi7pds4e0e4
Tags: 3.1.3-2
Security fix on kFreeBSD archs, don't set 7777 rigths on logfiles
(closes: #608491).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2002-2009 BalaBit IT Ltd, Budapest, Hungary
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 2 as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * Note that this permission is granted for only version 2 of the GPL.
 
9
 *
 
10
 * As an additional exemption you are allowed to compile & link against the
 
11
 * OpenSSL libraries as published by the OpenSSL project. See the file
 
12
 * COPYING for details.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
 */
 
23
  
 
24
#ifndef SDFILE_H_INCLUDED
 
25
#define SDFILE_H_INCLUDED
 
26
 
 
27
#include "driver.h"
 
28
#include "logreader.h"
 
29
#include "logwriter.h"
 
30
 
 
31
#define AFFILE_PIPE        0x00000001
 
32
#define AFFILE_NO_EXPAND   0x00000002
 
33
#define AFFILE_TMPL_ESCAPE 0x00000004
 
34
#define AFFILE_CREATE_DIRS 0x00000008
 
35
#define AFFILE_FSYNC       0x00000010
 
36
#define AFFILE_PRIVILEGED  0x00000020
 
37
 
 
38
typedef struct _AFFileSourceDriver
 
39
{
 
40
  LogDriver super;
 
41
  GString *filename;
 
42
  /* FIXME: the code assumes that reader is a LogReader at a lot of places, so this should be changed to LogReader */
 
43
  LogPipe *reader;
 
44
  LogReaderOptions reader_options;
 
45
  guint32 flags;
 
46
  /* state information to follow a set of files using a wildcard expression */
 
47
} AFFileSourceDriver;
 
48
 
 
49
LogDriver *affile_sd_new(gchar *filename, guint32 flags);
 
50
void affile_sd_set_recursion(LogDriver *s, const gint recursion);
 
51
void affile_sd_set_pri_level(LogDriver *s, const gint16 severity);
 
52
void affile_sd_set_pri_facility(LogDriver *s, const gint16 facility);
 
53
 
 
54
typedef struct _AFFileDestWriter AFFileDestWriter;
 
55
 
 
56
typedef struct _AFFileDestDriver
 
57
{
 
58
  LogDriver super;
 
59
  LogTemplate *filename_template;
 
60
  AFFileDestWriter *single_writer;
 
61
  guint32 flags;
 
62
  gint file_uid;
 
63
  gint file_gid;
 
64
  gint file_perm;
 
65
  gint dir_uid;
 
66
  gint dir_gid;
 
67
  gint dir_perm;
 
68
  gchar *local_time_zone;
 
69
  TimeZoneInfo *local_time_zone_info;
 
70
  LogWriterOptions writer_options;
 
71
  GHashTable *writer_hash;
 
72
    
 
73
  gint overwrite_if_older;
 
74
  gboolean use_time_recvd;
 
75
  gint time_reap;
 
76
  guint reap_timer;
 
77
} AFFileDestDriver;
 
78
 
 
79
LogDriver *affile_dd_new(gchar *filename, guint32 flags);
 
80
 
 
81
void affile_dd_set_compress(LogDriver *s, gboolean compress);
 
82
void affile_dd_set_encrypt(LogDriver *s, gboolean enable);
 
83
void affile_dd_set_file_uid(LogDriver *s, const gchar *file_uid);
 
84
void affile_dd_set_file_gid(LogDriver *s, const gchar *file_gid);
 
85
void affile_dd_set_file_perm(LogDriver *s, mode_t file_perm);
 
86
void affile_dd_set_dir_uid(LogDriver *s, const gchar *dir_uid);
 
87
void affile_dd_set_dir_gid(LogDriver *s, const gchar *dir_gid);
 
88
void affile_dd_set_dir_perm(LogDriver *s, mode_t dir_perm);
 
89
void affile_dd_set_create_dirs(LogDriver *s, gboolean create_dirs);
 
90
void affile_dd_set_fsync(LogDriver *s, gboolean enable);
 
91
void affile_dd_set_overwrite_if_older(LogDriver *s, gint overwrite_if_older);
 
92
void affile_dd_set_local_time_zone(LogDriver *s, const gchar *local_time_zone);
 
93
 
 
94
#endif