Print this page
6198 Let's EOL cachefs

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libpkg/common/isdir.c
          +++ new/usr/src/lib/libpkg/common/isdir.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  25   26   */
  26   27  
  27   28  /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  28   29  /* All Rights Reserved */
  29   30  
  30   31  
  31   32  #include <stdio.h>
  32   33  #include <sys/types.h>
  33   34  #include <sys/stat.h>
  34   35  #include <archives.h>
↓ open down ↓ 303 lines elided ↑ open up ↑
 338  339  
 339  340          if (numRemoteFstypes == -1) {
 340  341                  numRemoteFstypes = 0;
 341  342          }
 342  343  
 343  344          /* open the remote file system type database file */
 344  345  
 345  346          if ((fp = fopen(REMOTE_FS_DBFILE, "r")) == NULL) {
 346  347                  /* no remote type database: use predefined remote types */
 347  348                  remoteFstypes = (char **)realloc(remoteFstypes,
 348      -                                        sizeof (char *) * (numRemoteFstypes+3));
      349 +                    sizeof (char *) * (numRemoteFstypes+2));
 349  350                  remoteFstypes[numRemoteFstypes++] = "nfs";      /* +1 */
 350  351                  remoteFstypes[numRemoteFstypes++] = "autofs";   /* +2 */
 351      -                remoteFstypes[numRemoteFstypes++] = "cachefs";  /* +3 */
 352  352                  return;
 353  353          }
 354  354  
 355  355          /*
 356  356           * Read the remote file system type database; from fstypes(4):
 357  357           *
 358  358           * fstypes resides in directory /etc/dfs and lists distributed file
 359  359           * system utilities packages installed on the system. For each installed
 360  360           * distributed file system type, there is a line that begins with the
 361  361           * file system type name (for example, ``nfs''), followed by white space
 362  362           * and descriptive text.
 363  363           *
 364  364           * Lines will look at lot like this:
 365  365           *
 366  366           *      nfs NFS Utilities
 367  367           *      autofs AUTOFS Utilities
 368      -         *      cachefs CACHEFS Utilities
 369  368           */
 370  369  
 371  370          while (fgets(line_buf, sizeof (line_buf), fp) != NULL) {
 372  371                  char            buf[LINE_MAX];
 373  372                  static char     format[128] = {'\0'};
 374  373  
 375  374                  if (format[0] == '\0') {
 376  375                          /* create bounded format: %ns */
 377  376                          (void) snprintf(format, sizeof (format),
 378      -                                "%%%ds", sizeof (buf)-1);
      377 +                            "%%%ds", sizeof (buf)-1);
 379  378                  }
 380  379  
 381  380                  (void) sscanf(line_buf, format, buf);
 382  381  
 383  382                  remoteFstypes = realloc(remoteFstypes,
 384      -                                        sizeof (char *) * (numRemoteFstypes+1));
      383 +                    sizeof (char *) * (numRemoteFstypes+1));
 385  384                  remoteFstypes[numRemoteFstypes++] = strdup(buf);
 386  385          }
 387  386  
 388  387          /* close database file and return */
 389  388  
 390  389          (void) fclose(fp);
 391  390  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX