Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at rawshark.c:290

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

raw_pipe_open

(/home/sate/Testcases/c/cve/wireshark-1.2.0/rawshark.c)expand/collapse
Show more  
 244  raw_pipe_open(const char *pipe_name)
 245  {
 246  #ifndef _WIN32 
 247    struct stat pipe_stat;
 248  #else
 249    char *pncopy, *pos;
 250    DWORD err;
 251    wchar_t *err_str;
 252    HANDLE hPipe = NULL;
 253  #endif
 254    int          rfd;
 255   
 256    g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "open_raw_pipe: %s", pipe_name);
 257   
 258    /*
 259     * XXX Rawshark blocks until we return
 260     */
 261    if (strcmp(pipe_name, "-") == 0) {
 262      rfd = 0; /* read from stdin */
 263  #ifdef _WIN32 
 264      /*
 265       * This is needed to set the stdin pipe into binary mode, otherwise 
 266       * CR/LF are mangled...
 267       */
 268      _setmode(0, _O_BINARY);
 269  #endif  /* _WIN32 */
 270    } else {
 271  #ifndef _WIN32 
 272      if (ws_stat(pipe_name, &pipe_stat) < 0) {
 273        fprintf(stderr, "rawshark: The pipe %s could not be checked: %s\n",
 274                pipe_name, strerror(errno));
 275        return -1;
 276      }
 277      if (! S_ISFIFO(pipe_stat.st_mode)) {
 278        if (S_ISCHR(pipe_stat.st_mode)) {
 279          /*
 280           * Assume the user specified an interface on a system where
 281           * interfaces are in /dev.  Pretend we haven't seen it.
 282           */
 283        } else 
 284        {
 285          fprintf(stderr, "rawshark: \"%s\" is neither an interface nor a pipe\n",
 286                  pipe_name);
 287        }
 288        return -1;
 289      }
 290      rfd = ws_open(pipe_name, O_RDONLY | O_NONBLOCK, 0000 /* no creation so don't matter */);
Show more  




Change Warning 5051.29922 : File System Race Condition

Priority:
State:
Finding:
Owner:
Note: