Comments (3)
here an strace.
the only EACCES occurs in line 2947, followed by printing the error message:
2947 openat(AT_FDCWD, "/srv", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
2948 write(2, "cd: Permission denied: '/srv'\n", 30) = 30
from fish-shell.
builtins/cd.rs
calls fds::wopen_dir
, which calls fds::open_dir
, which sets O_RDONLY
. changing it to O_PATH works for me on Linux, but is neither portable nor correct for a function called open_dir
But it looks like open_dir is only used in cd and in the parser to initialize LibraryData::cwd_fd
.
It also seems like cwd_fd is never read (grep does not find usages, and it still builds when changing it to pub(crate) in struct LibraryData.)
so can we just remove the functions, skip the filedescriptor and directly chdir
? this would be portable to platforms without O_PATH
(like it seems, macos) or O_SEARCH
(all platforms, even if this is specified by posix)
from fish-shell.
If we want to keep cwd_fd
, we can first chdir
and then open(".", ...)
(as done in the Parser
's constructor).
As cwd_fd is an Option, this would be ok to fail.
The flag can be O_SEARCH
, O_SEARCH
or O_RDONLY
, whatever is supported on the platform.
from fish-shell.
Related Issues (20)
- Key input after piping to `fzf` does not work with new extended keyboard input functionality HOT 3
- Focus reporting stays on in long-running loop
- Commandline is needlessly repainted with new extended keyboard input functionality HOT 4
- Multiple successive up-or-search broken in gnome terminal HOT 3
- Autosuggestions suggest non-existing files HOT 5
- mipsel arch lacks AtomicU64 support HOT 5
- Suppress wildcards-globbing for http(s) parameters HOT 1
- Can't use Windows Terminal's Starting Directory HOT 4
- document limitations of --condition HOT 4
- Request to add support for piping into `fish -c 'builtin'` for built-ins HOT 3
- Inconsistanc behavior when changing a symlinked folder in the current working directory HOT 1
- [Suggestion] Do not include final slash on path completion for symlinks to directories HOT 2
- `commandline` seems to lose line break characters HOT 2
- consider making `history-prefix-search-backward` and forward don't change cursor position HOT 1
- [Feature] [vi-mode] Support command count HOT 2
- `history merge` has mmap issues with certain remote filesystems HOT 8
- WARNING: 'envvar' reference target not found when running 'sphinx-build' to build docs HOT 3
- Using `read` in script cause panic
- Parse and even freeze issue on pasting large input HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fish-shell.