/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugbasedclient.c

  • Committer: Teddy Hogeborn
  • Date: 2008-08-02 14:33:47 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080802143347-u1m4zs1q0feu72ei
* TODO: Converted to org-mode style

* plugins.d/mandosclient.c (certdir): Changed to "/conf/conf.d/mandos/".
  (certdir, certfile, certkey, pgp_packet_decrypt, debuggnutls,
  initgnutls, empty_log, combinepath): Made static.
  (combinepath): Rewritten to only get the argument string lengths
                 once.  Do not print error message; leave that to
                 caller.  All callers changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                                   struct argp_state, struct argp,
51
51
                                   argp_parse() */
52
52
 
53
 
#define BUFFER_SIZE 256
54
 
 
55
53
struct process;
56
54
 
57
55
typedef struct process{
74
72
  struct plugin *next;
75
73
} plugin;
76
74
 
77
 
static plugin *getplugin(char *name, plugin **plugin_list){
 
75
plugin *getplugin(char *name, plugin **plugin_list){
78
76
  for (plugin *p = *plugin_list; p != NULL; p = p->next){
79
77
    if ((p->name == name)
80
78
        or (p->name and name and (strcmp(p->name, name) == 0))){
103
101
  return new_plugin;
104
102
}
105
103
 
106
 
static void addargument(plugin *p, char *arg){
 
104
void addargument(plugin *p, char *arg){
107
105
  p->argv[p->argc] = arg;
108
106
  p->argv = realloc(p->argv, sizeof(char *) * (size_t)(p->argc + 2));
109
107
  if (p->argv == NULL){
119
117
 * Descriptor Flags".
120
118
 * *Note File Descriptor Flags:(libc)Descriptor Flags.
121
119
 */
122
 
static int set_cloexec_flag(int fd)
 
120
int set_cloexec_flag(int fd)
123
121
{
124
122
  int ret = fcntl(fd, F_GETFD, 0);
125
123
  /* If reading the flags failed, return error indication now. */
130
128
  return fcntl(fd, F_SETFD, ret | FD_CLOEXEC);
131
129
}
132
130
 
 
131
#define BUFFER_SIZE 256
 
132
 
133
133
const char *argp_program_version = "plugbasedclient 0.9";
134
134
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
135
135