Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #14186

Closed (moved)
Open
Opened Jan 13, 2015 by Andrea Shepard@andrea

Try to use fchmod() first when changing permissions on an AF_UNIX socket

In connection_listener_new() of connection.c, we need to change permissions of an AF_UNIX socket in one case, and on some platforms it doesn't work to use fchmod(), or so a comment claims. It'd be better to avoid the race condition by using fchmod() when possible though.

We should move this to a unix_socket_chmod() function in compat.c, perhaps, which should take a file handle, a path and a mode, and try fchmod() and then fall back to chmod() if it fails.

Point of clarification: if fchmod() fails, will it fail by returning a sensible error code or by silently not modifying the permissions? Should unix_socket_chmod() also fdstat() as needed to check that the mode is correct?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Tor: unspecified
Milestone
Tor: unspecified
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#14186