Comments (13)
It is related to this code:
if (freopen("/dev/tty", "rw", stdin) == NULL) { fprintf(stderr, "cannot to reopen stdin: %s\n", strerror(errno)); exit(1); }
I am changing to switch from stdin (because it is used in pipe, and it is a change to interactive mode). It looks so command executed in this mode has not a access to tty. Now I have not idea, how it should be fixed.
from pspg.
I am not sure if it is fixed correctly, but it looks like good workaround. Please, test it.
from pspg.
Seems it is still a problem, this time with permission:
cannot to reopen stdin: Permission denied
from pspg.
isn't is selinux issue? Now I cannot to reproduce it.
from pspg.
No selinux
root@roadwarrior:~# echo 'testing 1-2-3'| su postgres -c "pspg"
cannot to reopen stdin: Permission denied
from pspg.
I can reproduce it :-(
from pspg.
I found a workaround, but probably not sure how much is secure or unsecure. You can run tty
command instead pspg
and you get number of pts
device. Then you can allow rights:
[pavel@nemesis pspg-master]$ chmod a+rw /dev/pts/3
[pavel@nemesis pspg-master]$ su - postgres -c "PSQL_PAGER='/usr/local/bin/pspg -s 0' /usr/local/pgsql/bin/psql"
This is working
from pspg.
wow-wow-wow, that is a horrible workaround. The problem is not that I am not able to make
use of pspg, but I think it should work the way I am executing it as well, I think you could accomplish
whatever you want with reopening terminal another way, that will also work with su user -c "pspg"
from pspg.
yes, it is horrible workaround and doesn't work in fresh terminal. I have minimal knowledges about terminals, and I miss some about usage of ptsx
from pspg.
su user -c "pspg" is not problem (not now, because the work with streams are ugly in pspg). In this case I have assigned terminal device in good mode. But when it is executed as nested command from psql, then I have not assigned stdin for interactive mode.
from pspg.
@bjne - please, can you check cda02ea ?
from pspg.
This seems to work, great! Thanks for your attention to fixing!
from pspg.
super
from pspg.
Related Issues (20)
- work with the file without restriction of rights. HOT 1
- Crashes HOT 7
- Feature idea: table editor? HOT 2
- Meaning of name 'pspg' HOT 1
- quicker horizontal scrolling HOT 1
- CSV-only build HOT 3
- ESC-q broken on MacOS HOT 9
- Question: How does "Upper case sentitive search work"? HOT 4
- Man pages? HOT 1
- 5.5.6 + master: build fails HOT 5
- Erase bottom line at exit HOT 13
- Pspg and postgis columns HOT 2
- Some styles cause shell styles to break HOT 8
- Support for Ubuntu 18.04? HOT 11
- Segfault on empty input HOT 3
- tabs in fields have adverse effects on columns boundaries and alignment HOT 8
- Feature req: freeze-columns as a config file setting HOT 3
- pspg crashes when copying long text HOT 9
- segfault when watching non existing --querystream file HOT 4
- Saving to CSV on large number of rows only exports partial rows HOT 22
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 pspg.