Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10.x] Backport pending pull requests #21172

Closed
wants to merge 14 commits into from

Commits on Jun 6, 2018

  1. fs: don't limit ftruncate() length to 32 bits

    The length used by ftruncate() is 64 bits in the binding layer.
    This commit removes the 32 bit restriction in the JS layer.
    
    Backport-PR-URL: nodejs#21171
    PR-URL: nodejs#20851
    Fixes: nodejs#20844
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    
    Backport-PR-URL: nodejs#21171
    Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
    2 people authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    0577312 View commit details
    Browse the repository at this point in the history
  2. process: backport process/methods file

    To ease future backports, create the process/methods file introduced in
    nodejs#19973. This commit just adds
    the JS functions that forward calls to C++ and does not change type
    checking.
    targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    39df351 View commit details
    Browse the repository at this point in the history
  3. lib: mask mode_t type of arguments with 0o777

    - Introduce the `validateAndMaskMode` validator that
      validates `mode_t` arguments and mask them with 0o777
      if they are 32-bit unsigned integer or octal string
      to be more consistent with POSIX APIs.
    - Use the validator in fs APIs and process.umask for
      consistency.
    - Add tests for 32-bit unsigned modes larger than 0o777.
    
    PR-URL: nodejs#20636
    Fixes: nodejs#20498
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    joyeecheung authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    748ca53 View commit details
    Browse the repository at this point in the history
  4. doc: document file mode caveats on Windows

    - On Windows only the write permission (read-only bit) can be
      manipulated, and there is no distinction among owner, group
      or others.
    - mkdir on Windows does not support the mode argument.
    
    PR-URL: nodejs#20636
    Fixes: nodejs#20498
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    joyeecheung authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    57a11af View commit details
    Browse the repository at this point in the history
  5. fs: drop duplicate API in promises mode

    This drops exporting duplicate methods that accept FileHandle as the
    first argument (to mirror callback-based methods accepting 'fd').
    
    Those methods were not adding actual value to the API because all of
    those are already present as FileHandle methods, and they would
    probably be confusing to the new users and making docs harder to read.
    
    Also, the API was a bit inconsistent and lacked .close(handle).
    
    Fixes: nodejs#20548
    PR-URL: nodejs#20559
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    ChALkeR authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    f6ab989 View commit details
    Browse the repository at this point in the history
  6. lib: support ranges in validateInt32()

    This commit adds minimum and maximum value checks to the
    validateInt32() validator.
    
    PR-URL: nodejs#20588
    Fixes: nodejs#20498
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Weijia Wang <starkwang@126.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    cjihrig authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    436cf2d View commit details
    Browse the repository at this point in the history
  7. fs: improve fchmod{Sync} validation

    This commit validates the fd parameters to fs.fchmod{Sync} as
    int32s instead of uint32s because they are ints in the binding
    layer.
    
    PR-URL: nodejs#20588
    Fixes: nodejs#20498
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Weijia Wang <starkwang@126.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    cjihrig authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    c6e9e54 View commit details
    Browse the repository at this point in the history
  8. fs: refactor fs module

    PR-URL: nodejs#20764
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    jasnell authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    b50c42e View commit details
    Browse the repository at this point in the history
  9. test: increase coverage for fs.promises.truncate

    To increase test coverage, added tests for fs.promises.truncate
    and FileHandle.truncate.
    
    PR-URL: nodejs#20638
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Masashi Hirano authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    f4287e6 View commit details
    Browse the repository at this point in the history
  10. src: refactor bootstrap to use bootstrap object

    PR-URL: nodejs#20917
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    jasnell authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    c13cd35 View commit details
    Browse the repository at this point in the history
  11. doc: fix inconsistent documentation (host vs hostname)

    Update reference to read `hostname` instead of `host` for consistency.
    
    Also update function signature to use `hostname` rather than `host`
    
    PR-URL: nodejs#20933
    Refs: nodejs#20892
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    davisokoth authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    1bdc06b View commit details
    Browse the repository at this point in the history
  12. lib: unmask mode_t values with 0o777

    This commit allows permission bits higher than 0o777 to go through
    the API (e.g. `S_ISVTX`=`0o1000`, `S_ISGID`=`0o2000`,
    `S_ISUID`=`0o4000`).
    
    Also documents that these bits are not exposed through `fs.constants`
    and their behaviors are platform-specific, so the users need to
    use them on their own risk.
    
    PR-URL: nodejs#20975
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    joyeecheung authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    633b24d View commit details
    Browse the repository at this point in the history
  13. fs: do not crash when using a closed fs event watcher

    Before this commit, when the user calls methods on a closed or
    errored fs event watcher, they could hit a crash since the
    FSEventWrap in C++ land may have already been destroyed with
    the internal pointer set to nullptr. This commit makes sure
    that the user cannot hit crashes like that, instead the
    methods calling on a closed watcher will be noops.
    
    Also explicitly documents that the watchers should not be used
    in `close` and `error` event handlers.
    
    PR-URL: nodejs#20985
    Fixes: nodejs#20738
    Fixes: nodejs#20297
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Ron Korving <ron@ronkorving.nl>
    Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    joyeecheung authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    d2ad241 View commit details
    Browse the repository at this point in the history
  14. async_hooks: remove deprecated example

    PR-URL: nodejs#20998
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    mafintosh authored and targos committed Jun 6, 2018
    Configuration menu
    Copy the full SHA
    a20498a View commit details
    Browse the repository at this point in the history