Changeset 5959:b568f7b84e08 in roaraudio for libroar/serverinfo.c


Ignore:
Timestamp:
01/04/14 05:16:50 (10 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Also use uname() and hostid for seeding nonce generator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/serverinfo.c

    r5825 r5959  
    123123#ifdef ROAR_HAVE_GETHOSTID 
    124124 hostid = gethostid(); 
     125 roar_random_salt_nonce(&hostid, sizeof(hostid)); 
    125126 snprintf(hostidbuf, _HOSTID_BUFLEN, sizeof(long) == 8 ? "0x%.16lx" : "0x%.8lx", hostid); 
    126127 ret->hostid = hostidbuf; 
     
    131132#ifdef ROAR_HAVE_UNAME 
    132133 if ( !utsname_inited ) 
    133   if ( uname(&utsname) == 0 ) 
     134  if ( uname(&utsname) == 0 ) { 
    134135   utsname_inited = 1; 
     136   roar_random_salt_nonce(&utsname, sizeof(utsname)); 
     137  } 
    135138 
    136139 if ( utsname_inited ) { 
Note: See TracChangeset for help on using the changeset viewer.