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

x/sys/unix: missing Fgetxattr and Fsetxattr #26832

Closed
masiulaniec opened this issue Aug 6, 2018 · 8 comments
Closed

x/sys/unix: missing Fgetxattr and Fsetxattr #26832

masiulaniec opened this issue Aug 6, 2018 · 8 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Linux
Milestone

Comments

@masiulaniec
Copy link

The system calls fgetxattr(2) and fsetxattr(2) are not exposed. These variants are required to avoid some path-based race conditions caused by concurrent rename(2) calls.

@gopherbot gopherbot added this to the Unreleased milestone Aug 6, 2018
@FiloSottile
Copy link
Contributor

/cc @ianlancetaylor @bradfitz @tklauser

@FiloSottile FiloSottile added OS-Linux NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 7, 2018
@ianlancetaylor
Copy link
Contributor

@masiulaniec Which operating system?

@tklauser
Copy link
Member

tklauser commented Aug 7, 2018

FWIW, it seems to be missing on all operating systems except FreeBSD.

@gopherbot
Copy link

Change https://golang.org/cl/128176 mentions this issue: unix: add F*xattr on Linux

@tklauser tklauser added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 7, 2018
gopherbot pushed a commit to golang/sys that referenced this issue Aug 7, 2018
Add Fgetxattr, Flistxattr, Fremovexattr and Fsetxattr on Linux.

Updates golang/go#26832

Change-Id: Ia79915e91a928188c6c985ef301d5445f630b19c
Reviewed-on: https://go-review.googlesource.com/128176
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@masiulaniec
Copy link
Author

@masiulaniec Which operating system?

I need it on Linux and Darwin. It might be applicable to other systems.

@gopherbot
Copy link

Change https://golang.org/cl/128495 mentions this issue: unix: drop incorrect Fsetxattr size return value

gopherbot pushed a commit to golang/sys that referenced this issue Aug 8, 2018
Fsetxattr should just return an error (like Setxattr and like Fsetxattr
is already doing on FreeBSD).

Fix for CL 128176

Updates golang/go#26832

Change-Id: Id1c1315d9eb6952128e0c0ce44b19060e0403cc0
Reviewed-on: https://go-review.googlesource.com/128495
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/128537 mentions this issue: unix: add F*xattr on Darwin

gopherbot pushed a commit to golang/sys that referenced this issue Aug 8, 2018
Add Fgetxattr, Flistxattr, Fremovexattr and Fsetxattr on Darwin. Also
add a corresponding test.

Updates golang/go#26832

Change-Id: Id75bfce90ccc024b567a7b066a9188a615b9eec4
Reviewed-on: https://go-review.googlesource.com/128537
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@tklauser
Copy link
Member

tklauser commented Aug 16, 2018

Added on Linux (https://golang.org/cl/128176) and Darwin (https://golang.org/cl/128537). FreeBSD already supports them and NetBSD support (using the same implementation as FreeBSD) was added through (https://golang.org/cl/128256).

As for the remaining OSes: DragonflyBSD only provides syscalls for {Get,Set,List,Remove}xattr but not their F*xattr counterparts. OpenBSD does not support xattrs at all, it seems. And Solaris has an entirely different API to deal with xattrs (see https://docs.oracle.com/cd/E86824_01/html/E54776/fsattr-5.html#REFMAN5fsattr-5). Thus, I'd consider this issue fixed.

@golang golang locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Linux
Projects
None yet
Development

No branches or pull requests

5 participants