/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

merge +
mandosclient
        Added a adjustbuffer function.

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
 
53
55
struct process;
54
56
 
55
57
typedef struct process{
72
74
  struct plugin *next;
73
75
} plugin;
74
76
 
75
 
plugin *getplugin(char *name, plugin **plugin_list){
 
77
static plugin *getplugin(char *name, plugin **plugin_list){
76
78
  for (plugin *p = *plugin_list; p != NULL; p = p->next){
77
79
    if ((p->name == name)
78
80
        or (p->name and name and (strcmp(p->name, name) == 0))){
101
103
  return new_plugin;
102
104
}
103
105
 
104
 
void addargument(plugin *p, char *arg){
 
106
static void addargument(plugin *p, char *arg){
105
107
  p->argv[p->argc] = arg;
106
108
  p->argv = realloc(p->argv, sizeof(char *) * (size_t)(p->argc + 2));
107
109
  if (p->argv == NULL){
117
119
 * Descriptor Flags".
118
120
 * *Note File Descriptor Flags:(libc)Descriptor Flags.
119
121
 */
120
 
int set_cloexec_flag(int fd)
 
122
static int set_cloexec_flag(int fd)
121
123
{
122
124
  int ret = fcntl(fd, F_GETFD, 0);
123
125
  /* If reading the flags failed, return error indication now. */
128
130
  return fcntl(fd, F_SETFD, ret | FD_CLOEXEC);
129
131
}
130
132
 
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("setuid");
 
327
    perror("setgid");
328
328
  }
329
329
  
330
330
  dir = opendir(plugindir);