/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 plugins.d/usplash.c

  • Committer: Teddy Hogeborn
  • Date: 2009-02-13 05:38:21 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090213053821-03e696gckk4nbjps
Support not using IPv6 in server:

* mandos (AvahiService.__init__): Take new "protocol" parameter.  All
                                  callers changed.
  (IPv6_TCPServer.__init__): Take new "use_ipv6" parameter.  All
                             callers changed.
  (IPv6_TCPServer.server_bind): Create IPv4 socket if not using IPv6.
  (main): New "--no-ipv6" command line option.  New "use_ipv6" config
          option.
* mandos-options.xml ([@id="address"]): Document conditional IPv4
                                        address support.
  ([@id="ipv6"]): New paragraph.
* mandos.conf (use_ipv6): New config option.
* mandos.conf.xml (OPTIONS): Document new "use_dbus" option.
  (EXAMPLE): Changed to use IPv6 link-local address.  Added "use_ipv6"
             option.
* mandos.xml (SYNOPSIS): New "--no-ipv6" option.
  (OPTIONS): Document new "--no-ipv6" option.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                   dirent */
37
37
#include <stddef.h>             /* NULL */
38
38
#include <string.h>             /* strlen(), memcmp() */
39
 
#include <stdio.h>              /* asprintf(), perror(), sscanf() */
 
39
#include <stdio.h>              /* asprintf(), perror() */
40
40
#include <unistd.h>             /* close(), write(), readlink(),
41
41
                                   read(), STDOUT_FILENO, sleep(),
42
42
                                   fork(), setuid(), geteuid(),
46
46
                                   EXIT_SUCCESS, malloc(), _exit() */
47
47
#include <stdlib.h>             /* getenv() */
48
48
#include <dirent.h>             /* opendir(), readdir(), closedir() */
49
 
#include <inttypes.h>           /* intmax_t, SCNdMAX */
 
49
#include <inttypes.h>           /* intmax_t, strtoimax() */
50
50
#include <sys/stat.h>           /* struct stat, lstat(), S_ISLNK */
51
51
 
52
52
sig_atomic_t interrupted_by_signal = 0;
173
173
      pid_t pid;
174
174
      {
175
175
        intmax_t tmpmax;
176
 
        int numchars;
177
 
        ret = sscanf(proc_ent->d_name, "%" SCNdMAX "%n", &tmpmax,
178
 
                     &numchars);
179
 
        if(ret < 1 or tmpmax != (pid_t)tmpmax
180
 
           or proc_ent->d_name[numchars] != '\0'){
 
176
        char *tmp;
 
177
        errno = 0;
 
178
        tmpmax = strtoimax(proc_ent->d_name, &tmp, 10);
 
179
        if(errno != 0 or tmp == proc_ent->d_name or *tmp != '\0'
 
180
           or tmpmax != (pid_t)tmpmax){
181
181
          /* Not a process */
182
182
          continue;
183
183
        }