Comments (10)
According to AIX 7.2 ioctl manual, it requires one more include:
#include <stropts.h>
Could you help try if that can fix the issue?
from passh.
I added the line:
$ diff -u passh.c.original passh.c
--- passh.c.original 2020-03-20 05:37:40.000000000 +0200
+++ passh.c 2020-05-20 09:19:04.000000000 +0200
@@ -43,6 +43,7 @@
#include <regex.h>
#include <time.h>
#include <fcntl.h>
+ #include <stropts.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/types.h>
then when I run make, a new error line shows:
$ make
gcc -O passh.c -o passh
passh.c:360:18: warning: 'struct winsize' declared inside parameter list will not be visible outside of this definition or declaration
const struct winsize *slave_winsize)
^~~~~~~
In file included from /usr/include/stropts.h:30,
from passh.c:46:
passh.c: In function 'pty_fork':
passh.c:411:28: error: invalid application of 'sizeof' to incomplete type 'struct winsize'
if (ioctl(fds, TIOCSWINSZ, slave_winsize) < 0)
^~~~~~~~~~
passh.c: In function 'big_loop':
passh.c:728:28: error: storage size of 'ttysize' isn't known
struct winsize ttysize;
^~~~~~~
In file included from /usr/include/stropts.h:30,
from passh.c:46:
passh.c:740:31: error: invalid application of 'sizeof' to incomplete type 'struct winsize'
if (ioctl(ourtty, TIOCGWINSZ, &ttysize) == 0) {
^~~~~~~~~~
passh.c:741:34: error: invalid application of 'sizeof' to incomplete type 'struct winsize'
ioctl(g.fd_ptym, TIOCSWINSZ, &ttysize);
^~~~~~~~~~
passh.c: In function 'main':
passh.c:929:20: error: storage size of 'size' isn't known
struct winsize size;
^~~~
In file included from /usr/include/stropts.h:30,
from passh.c:46:
passh.c:942:33: error: invalid application of 'sizeof' to incomplete type 'struct winsize'
if (ioctl(STDIN_FILENO, TIOCGWINSZ, (char *) &size) < 0)
^~~~~~~~~~
make: 1254-004 The error code from the last command is 1.
Stop.
would anything from ./configure
that runs for sshpass
assist us?
from passh.
Just checked sshpass code. It does not include stropts.h
so that may be not an issue. The only .h which is in sshpass but not in passh is sys/stat.h
though it does not seem to relate to struct winsize
. Anyway, you can try:
-
Include
sys/stat.h
and see if it helps; -
If it does not, try removing the following lines from passh.c:
#if !defined(__APPLE__) && !defined(__FreeBSD__) #define _XOPEN_SOURCE 600 /* for posix_openpt() */ #endif
from passh.
This worked for me, I restored the original passh.c
and commented the lines out:
- If it does not, try removing the following lines from passh.c:
#if !defined(__APPLE__) && !defined(__FreeBSD__) #define _XOPEN_SOURCE 600 /* for posix_openpt() */ #endif
There is a small problem with the Makefile on AIX:
$ make
gcc -O passh.c -o passh
rm passh
Target ".PHONY" is up to date.
it seems to run clean too
So I ran: gcc passh.c -o passh
All is well. Thank you
from passh.
Just committed a fix (one line change). Could you help verify?
from passh.
Oh. Did not notice your last update. My commit only fixed the gcc error. Will see how I can deal with the makefile.
from passh.
Makefile also updated. Please try (make clean; make
).
from passh.
$ make clean; make
rm passh
rm: passh: A file or directory in the path name does not exist.
make: 1254-004 The error code from the last command is 2.
Stop.
cc -O passh.c -o passh
cc: not found
make: 1254-004 The error code from the last command is 1.
Stop.
I added the following:
$ echo "CC = gcc" >> Makefile
then ran:
$ make
gcc -O passh.c -o passh
Target "all" is up to date.
and the passh
file exists. Thank you
$ ./passh -h
Usage: passh [OPTION]... COMMAND...
-c <N> Send at most <N> passwords (0 means infinite. Default: 0)
-C Exit if prompted for the <N+1>th password
-h Help
-i Case insensitive for password prompt matching
-n Nohup the child (e.g. used for `ssh -f')
-p <password> The password (Default: `password')
-p env:<var> Read password from env var
-p file:<file> Read password from file
-P <prompt> Regexp (BRE) for the password prompt
(Default: `[Pp]assword: \{0,1\}$')
-l <file> Save data written to the pty
-L <file> Save data read from the pty
-t <timeout> Timeout waiting for next password prompt
(0 means no timeout. Default: 0)
-T Exit if timed out waiting for password prompt
-y Auto answer `(yes/no)?' questions
Report bugs to Clark Wang <[email protected]>
from passh.
Thanks for helping verify. For the cc part you can CC=gcc make
.
from passh.
Thanks for helping verify. For the cc part you can
CC=gcc make
.
yes that did the trick.
$ CC=gcc make
gcc -O passh.c -o passh
Target "all" is up to date.
Thank you. I think this issue is closed now.
from passh.
Related Issues (15)
- wont compile in freebsd HOT 3
- Do not feed stdin until interactive HOT 2
- Add support for ERE?
- Heads-up: passh has been added to the FreeBSD Ports Collection HOT 2
- Add support for "cmd1 ... | passh cmd2 ... | cmd3 ..." ? HOT 1
- passh segfaults when provided a non-existing password file HOT 1
- Complementary Project : `PasshPapyrusScribe` HOT 1
- What is the argument of connection host port plz? HOT 4
- Usage Example on Travis-CI HOT 2
- hide password prompt... HOT 3
- Need help in compiling for openwrt HOT 11
- Please set a license HOT 2
- big -C option is broken by design HOT 3
- Thank your very much for this program! HOT 1
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 passh.