search for: o_noctty

Displaying 20 results from an estimated 101 matches for "o_noctty".

2009 Jul 09
0
Hanging ssh sessions with openssh-5.1p1 and Solaris 8 & 10
...O_RDWR|O_NONBLOCK FD_CLOEXEC 7: S_IFSOCK mode:0666 dev:363,0 ino:3489 uid:0 gid:0 size:0 O_RDWR FD_CLOEXEC SOCK_STREAM SO_SNDBUF(16384),SO_RCVBUF(5120) sockname: AF_UNIX 8: S_IFCHR mode:0000 dev:356,0 ino:56458 uid:0 gid:0 rdev:23,9 O_RDWR|O_NONBLOCK|O_NOCTTY|O_LARGEFILE /devices/pseudo/clone at 0:ptm 10: S_IFCHR mode:0000 dev:356,0 ino:56458 uid:0 gid:0 rdev:23,9 O_RDWR|O_NONBLOCK|O_NOCTTY|O_LARGEFILE /devices/pseudo/clone at 0:ptm 11: S_IFCHR mode:0000 dev:356,0 ino:56458 uid:0 gid:0 rdev:23,9 O_RDWR|O_NONBLOCK|O_NOCTTY|O_L...
2012 Jul 25
1
[PATCH] fish: Use minimal permissions when initially creating history file
...2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish/fish.c b/fish/fish.c index ded80ec..9bb8c90 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1455,7 +1455,7 @@ cleanup_readline (void) int fd; if (histfile[0] != '\0') { - fd = open (histfile, O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC, 0644); + fd = open (histfile, O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC, 0600); if (fd == -1) { perror (histfile); return; -- 1.7.10.4
2014 Jun 11
2
[PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
...erhaps controlled by some flags, but on by default?) If getpid() == 1 then fork a child, continue in the child, have the parent wait for the child to terminate, then exit child should setsid() close(2) close(1) close(0) open("/dev/ttyS0", O_RDONLY) open("/dev/ttyS0", O_WRONLY|O_NOCTTY) open("/dev/ttyS0", O_WRONLY|O_NOCTTY) And /dev/ttyS0 should either be /dev/console or specified on commandline, or parsed out of kernel command line console= string. Just loose ideas.
2000 Aug 28
1
PTY-Allocation under SCO 5
Hello, I used the sshd under SCO 5, and always get the error that the deamon couldn't allcoate a pseudo tty. This depends on that SCO use a different method to create the tty's in the /dev directory. The pseudo tty line looks like: /dev/ttypXXX where XXX depends on the number of pseudo tty's entered in the scoadmin Tool for the network interface. So I change the allocation routine in
2002 Dec 13
5
[Bug 245] SSH can not log out under Solaris 2.6
...again, calls setsid and attempts to make pty controlling terminal. This fails because the pty is already controlling terminal for another session. Looking at a truss -f of sshd for access to that pty shows: # grep /dev/pt /tmp/sshd.trace |grep 21690 21690: open64("/dev/ptmx", O_RDWR|O_NOCTTY) = 6 21690: access("/dev/pts/2", 0) = 0 21690: open64("/dev/pts/2", O_RDWR|O_NOCTTY) = 7 21690: stat64("/dev/pts/2", 0xEFFFF020) = 0 21690: chown("/dev/pts/2", 500, 7) = 0 My...
2015 Jun 23
2
[PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...++++++++-------- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/daemon/copy.c b/daemon/copy.c index bab00fe..6f3e844 100644 --- a/daemon/copy.c +++ b/daemon/copy.c @@ -30,7 +30,6 @@ #include "actions.h" /* wrflags */ -#define DEST_FILE_FLAGS O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666 #define DEST_DEVICE_FLAGS O_WRONLY|O_CLOEXEC, 0 /* flags */ @@ -210,8 +209,13 @@ copy (const char *src, const char *src_display, int do_copy_device_to_device (const char *src, const char *dest, int64_t srcoffset, int64_t destoffset, int64_t size, -...
2014 Jun 11
3
[PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
H. Peter Anvin dixit: >But is that really a tty, then? I also understand that virtio console Hm. Both eglibc and dietlibc return true for isatty on it. >doesn't support termios, which makes this an ugly bifurcation. All of Let me test that? quick? hah not really (CONFIG_VIRTIO_CONSOLE=m)? ok luckily Ubuntu?s linux-image-3.15.0-5-generic is installable on Debian stable and has
2015 Jun 23
0
Re: [PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...), 15 deletions(-) > > diff --git a/daemon/copy.c b/daemon/copy.c > index bab00fe..6f3e844 100644 > --- a/daemon/copy.c > +++ b/daemon/copy.c > @@ -30,7 +30,6 @@ > #include "actions.h" > > /* wrflags */ > -#define DEST_FILE_FLAGS O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666 > #define DEST_DEVICE_FLAGS O_WRONLY|O_CLOEXEC, 0 > > /* flags */ > @@ -210,8 +209,13 @@ copy (const char *src, const char *src_display, > int > do_copy_device_to_device (const char *src, const char *dest, > int64_t srcoffset, in...
2016 Jan 06
0
[klibc:master] Remove obsolete getpt() function
...Peter Anvin <hpa at linux.intel.com> AuthorDate: Tue, 5 Jan 2016 18:01:55 -0800 Committer: H. Peter Anvin <hpa at linux.intel.com> CommitDate: Tue, 5 Jan 2016 18:01:55 -0800 [klibc] Remove obsolete getpt() function getpt() has long since been obsolete; instead use posix_openpt(O_RDWR|O_NOCTTY). Signed-off-by: H. Peter Anvin <hpa at linux.intel.com> --- usr/include/stdlib.h | 1 - usr/klibc/Kbuild | 2 +- usr/klibc/getpt.c | 16 ---------------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/usr/include/stdlib.h b/usr/include/stdlib.h index 856c647..c2d6...
1999 Dec 09
1
openssh-1.2pre16 patch to pty.c for Solaris 2.6
...ex: pty.c --- pty.c~ 1999/12/09 09:31:41 +++ pty.c 1999/12/09 16:41:46 @@ -27,6 +27,12 @@ #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) #undef HAVE_DEV_PTMX #endif + +#ifdef HAVE_DEV_PTMX +#ifndef I_PUSH +#include <stropts.h> +#endif /* I_PUSH */ +#endif /* HAVE_DEV_PTMX */ #ifndef O_NOCTTY #define O_NOCTTY 0 Enjoy! -- Mark
2014 Jun 12
0
[PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
...that it might be desirable to have the >klibc shell do some dancing (perhaps controlled by some flags, but on There is no klibc shell. >child should > >setsid() >close(2) >close(1) >close(0) >open("/dev/ttyS0", O_RDONLY) >open("/dev/ttyS0", O_WRONLY|O_NOCTTY) >open("/dev/ttyS0", O_WRONLY|O_NOCTTY) Yes. You boot with init=/bin/mksh (for example), then type mksh -lT!/dev/ttyS0 and it does that. This functionality is built into the shell. Busybox has some magic to divine the real console device used, but this is too fragile. In the rescu...
2014 Jan 28
1
Re: [PATCH 05/10] examples: Update various examples to use new disk-create API.
...ones wrote: > --- a/ocaml/examples/create_disk.ml > +++ b/ocaml/examples/create_disk.ml > @@ -9,9 +9,7 @@ let () = > let g = new Guestfs.guestfs () in > > (* Create a raw-format sparse disk image, 512 MB in size. *) > - let fd = openfile output [O_WRONLY;O_CREAT;O_TRUNC;O_NOCTTY] 0o666 in > - ftruncate fd (512 * 1024 * 1024); > - close fd; > + g#disk_create output "raw" 536870912L; Minor niptick: I'd leave the multiplication, as it was before and as the other examples do (easier to spot and to change). -- Pino Toscano
2013 Jun 28
0
Re: [PATCH] hivex: Add O_BINARY flag to open calls for platforms where this isn't the default (such as Win32)
...ename, O_RDONLY | O_BINARY); > #endif > if (h->fd == -1) > goto error; > @@ -2261,7 +2261,7 @@ hivex_commit (hive_h *h, const char *filename, int flags) > } > > filename = filename ? : h->filename; > - int fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, 0666); > + int fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_BINARY, 0666); > if (fd == -1) > return -1; Thanks - I've pushed this. I don't know *how* it works on Linux. I can't find O_BINARY in any header at all ... Rich. -- Richard Jones, Virtualiza...
2014 Jun 11
0
[PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
...=/usr/bin/strace"]) = 0 setsid() = 1216 close(2) = 0 close(1) = 0 close(0) = 0 open("/dev/ttyS0", O_RDONLY) = 0 open("/dev/ttyS0", O_WRONLY|O_NOCTTY) = 1 open("/dev/ttyS0", O_WRONLY|O_NOCTTY) = 2 execve("/bin/bash", ["bash"], ["HOME=/root", "TERM=xterm"]) = 0 I'm not sure how much of the above is relevant to /dev/console as opposed to the /dev/ttyS0 I've obviously been using.
2017 Sep 20
1
Re: [PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
....%d", cmd->g->tmpdir, ++cmd->g->unique); > + cmd->error_file = guestfs_int_make_temp_path (cmd->g, "cmderr", "txt"); > + if (!cmd->error_file) > + goto error; > errfd = open (cmd->error_file, > O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0600); > if (errfd == -1) { > diff --git a/lib/drives.c b/lib/drives.c > index 117c8bf85..f43e64b10 100644 > --- a/lib/drives.c > +++ b/lib/drives.c > @@ -989,7 +989,9 @@ guestfs_impl_add_drive_scratch (guestfs_h *g, int64_t size, > */ > if (gues...
2007 Dec 26
1
sshd's -e doesn't work as expected
...rror(errno)); + close(STDIN_FILENO); + open(_PATH_DEVNULL, O_RDONLY); + close(STDOUT_FILENO); + open(_PATH_DEVNULL, O_WRONLY); + if (!log_stderr) { + close(STDERR_FILENO); + open(_PATH_DEVNULL, O_WRONLY); + } /* Disconnect from the controlling tty. */ fd = open(_PATH_TTY, O_RDWR | O_NOCTTY); -- Julio M. Merino Vidal <jmmv at NetBSD.org>
2013 Jun 27
2
[PATCH] hivex: Add O_BINARY flag to open calls for platforms where this isn't the default (such as Win32)
Hi As my cross platform registry editor (FRED available from https://www.pinguin.lu (sorry for advertising but I couldn't resist ;-))) is evolving, I recently added write support to it. While under Linux everything worked nice, the Windblows build didn't. It seems that Windows opens files by default in text mode (O_TEXT) which is a problem. The attached patch adds the O_BINARY flag to
2003 Apr 08
2
OpenSSH 3.6.1p1 on NCR MP-RAS v4.3, several weird terminal problems
I compiled OpenSSH 3.6.1p1 on NCR MP-RAS v4.3 (or at least "uname -a"'s output of 4.0.3.0 suggests v4.3, I'm not positive). I was able to compile zlib (1.1.4) and openssl (0.9.7a) with little trouble. OpenSSH took hand-hacking the includes.h file as follows: diff -cr openssh-3.6.1p1/includes.h openssh-3.6.1p1-customized/includes.h *** openssh-3.6.1p1/includes.h Sun Oct 20
2015 May 26
2
[PATCH] api: Don't truncate /dev/stdout or /dev/stderr when used as FileOut.
...gfile (Printexc.to_string exn) in diff --git a/src/proto.c b/src/proto.c index a019625..a46a382 100644 --- a/src/proto.c +++ b/src/proto.c @@ -756,9 +756,18 @@ guestfs_int_recv_file (guestfs_h *g, const char *filename) g->user_cancel = 0; - fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666); + /* If downloading to /dev/stdout or /dev/stderr, dup the file + * descriptor instead of reopening the file, so that redirected + * stdout/stderr work properly. + */ + if (STREQ (filename, "/dev/stdout")) + fd = dup (1); + else if (STREQ (filename, "/de...
2020 Apr 07
2
[PATCH nbdkit v2] tmpdisk: Generalize the tmpdisk plugin
An evolution of v1 here: https://www.redhat.com/archives/libguestfs/2020-April/msg00035.html I want to generalize the tmpdisk plugin, particularly so you can use commands like ‘qemu-img create’ or even ‘virt-builder’. (Actually virt-builder really works - I tested it - but of course it causes a 30+ second delay when connecting to the server.) You can now use commands such as: nbdkit tmpdisk