/mandos/trunk

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

« back to all changes in this revision

Viewing changes to plugbasedclient.c

not working midwork...

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
 
324
324
  
325
325
  setgid(gid);
326
326
  if (ret == -1){
327
 
    perror("setgid");
 
327
    perror("setuid");
328
328
  }
329
329
  
330
330
  dir = opendir(plugindir);