Changeset 5324:d8a11b9bfafb in roaraudio


Ignore:
Timestamp:
12/05/11 15:18:04 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

honor $SSH_CLIENT and $SSH_CONNECTION

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/enumdev.c

    r5270 r5324  
    101101 int i; 
    102102#endif 
     103 char * ssh_buf, * tmp; 
    103104 
    104105 (void)flags, (void)dir, (void)socktype; 
    105106 
    106  if ( maxlen < 10 ) 
     107 if ( maxlen < 11 ) 
    107108  return -1; 
    108109 
     
    120121 } 
    121122#endif 
     123 
     124 new = getenv("SSH_CLIENT"); 
     125 if ( new == NULL ) 
     126  new = getenv("SSH_CONNECTION"); 
     127 
     128 if ( new != NULL ) { 
     129  ssh_buf = roar_mm_strdup(new); 
     130  if ( ssh_buf != NULL ) { 
     131   tmp = strstr(ssh_buf, " "); 
     132   if ( tmp == NULL ) { 
     133    // invalid format. 
     134    roar_mm_free(ssh_buf); 
     135   } else { 
     136    *tmp = 0; 
     137    servers[ret++] = ssh_buf; 
     138   } 
     139  } 
     140 } 
    122141 
    123142#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) 
Note: See TracChangeset for help on using the changeset viewer.