]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Merge pull request #101 from ahippo/master
authorhallyn <serge@hallyn.com>
Fri, 13 Dec 2013 21:13:19 +0000 (13:13 -0800)
committerhallyn <serge@hallyn.com>
Fri, 13 Dec 2013 21:13:19 +0000 (13:13 -0800)
run_buffer(): unblock all signals for spawned scripts.

1  2 
src/lxc/conf.c

diff --cc src/lxc/conf.c
index c8f0f7d1c6ee31901b715930a2cb77765a4808ed,fa776188ab9842fb60a055dbf0c04f3fb58be07e..8e40e591a13fe11f0999d80596d90838c76c9369
@@@ -278,9 -280,77 +278,9 @@@ static struct caps_opt caps_opt[] = 
  static struct caps_opt caps_opt[] = {};
  #endif
  
 -static char padchar[] =
 -"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 -
 -static char *mkifname(char *template)
 -{
 -      char *name = NULL;
 -      int i = 0;
 -      FILE *urandom;
 -      unsigned int seed;
 -      struct ifaddrs *ifaddr, *ifa;
 -      int ifexists = 0;
 -
 -      /* Get all the network interfaces */
 -      getifaddrs(&ifaddr);
 -
 -      /* Initialize the random number generator */
 -      process_lock();
 -      urandom = fopen ("/dev/urandom", "r");
 -      process_unlock();
 -      if (urandom != NULL) {
 -              if (fread (&seed, sizeof(seed), 1, urandom) <= 0)
 -                      seed = time(0);
 -              process_lock();
 -              fclose(urandom);
 -              process_unlock();
 -      }
 -      else
 -              seed = time(0);
 -
 -#ifndef HAVE_RAND_R
 -      srand(seed);
 -#endif
 -
 -      /* Generate random names until we find one that doesn't exist */
 -      while(1) {
 -              ifexists = 0;
 -              name = strdup(template);
 -
 -              if (name == NULL)
 -                      return NULL;
 -
 -              for (i = 0; i < strlen(name); i++) {
 -                      if (name[i] == 'X') {
 -#ifdef HAVE_RAND_R
 -                              name[i] = padchar[rand_r(&seed) % (strlen(padchar) - 1)];
 -#else
 -                              name[i] = padchar[rand() % (strlen(padchar) - 1)];
 -#endif
 -                      }
 -              }
 -
 -              for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
 -                      if (strcmp(ifa->ifa_name, name) == 0) {
 -                              ifexists = 1;
 -                              break;
 -                      }
 -              }
 -
 -              if (ifexists == 0)
 -                      break;
 -
 -              free(name);
 -      }
 -
 -      freeifaddrs(ifaddr);
 -      return name;
 -}
 -
  static int run_buffer(char *buffer)
  {
-       FILE *f;
+       struct lxc_popen_FILE *f;
        char *output;
        int ret;