Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • P Pacman Contrib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
    • Locked files
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Admin message

Due to an influx of spam, we have had to temporarily disable account registrations. Please write an email to accountsupport@archlinux.org, with your desired username, if you want to get access. Sorry for the inconvenience.

  • Pacman
  • Pacman Contrib
  • Repository
  • pacman-contrib
  • src
  • pacdiff.sh.in
Find file Blame History Permalink
  • Denton Liu's avatar
    pacdiff: Don't use $SUDO on temporary files · c066a07a
    Denton Liu authored Apr 01, 2021 and Daniel M. Capella's avatar Daniel M. Capella committed Jul 27, 2021
    In 19ab4fac (pacdiff: Add option to use sudo/sudoedit to manage files,
    2021-03-27), pacdiff was taught to accept -s to run various commands
    with $SUDO. This introduced many instances of $SUDO in merge_file()
    where most of them are unnecessary.
    
    In particular, it is not necessary to $SUDO to write the temporary files
    as /tmp should be writable by all[0][1].
    
    Also, the usage of sudoedit when comparing the original file with the
    merge result is unnecessary. This is because root permissions are not
    really required since users should not write to the original file
    anyway. The merged file will be used to overwrite the original file at
    the end of the function anyway.
    
    Remove these unnecessary usages of $SUDO.
    
    [0]: https://unix.stackexchange.com/a/71625
    [1]: https://serverfault.com/a/427290
    
    
    
    Signed-off-by: default avatarDenton Liu <liu.denton@gmail.com>
    Signed-off-by: default avatarDaniel M. Capella <polyzen@archlinux.org>
    c066a07a