1
0
mirror of https://github.com/moparisthebest/socat synced 2024-12-22 06:58:47 -05:00

merged shutdown, shutnull branches

This commit is contained in:
Gerhard Rieger 2009-04-02 17:09:59 +02:00
commit 90633dd508
6 changed files with 19 additions and 8 deletions

View File

@ -9,6 +9,9 @@ new features:
option null-eof changes the behaviour of sockets that receive an empty option null-eof changes the behaviour of sockets that receive an empty
packet to see EOF instead of ignoring it packet to see EOF instead of ignoring it
introduced option names substuser-early and su-e, currently equivalent
to option substuser (thanks to Mike Perry for providing the patch)
####################### V 1.7.0.1: ####################### V 1.7.0.1:
corrections: corrections:

View File

@ -1682,16 +1682,18 @@ label(OPTION_CHROOT_EARLY)dit(bf(tt(chroot-early=<directory>)))
before opening the address. This call might require root privilege. before opening the address. This call might require root privilege.
label(OPTION_SETGID)dit(bf(tt(setgid=<group>))) label(OPTION_SETGID)dit(bf(tt(setgid=<group>)))
Changes the primary link(<group>)(TYPE_GROUP) of the process after Changes the primary link(<group>)(TYPE_GROUP) of the process after
processing the address. This call might require root privilege. processing the address. This call might require root privilege. Please note
that this option does not drop other group related privileges.
label(OPTION_SETGID_EARLY)dit(bf(tt(setgid-early=<group>))) label(OPTION_SETGID_EARLY)dit(bf(tt(setgid-early=<group>)))
Changes the primary link(<group>)(TYPE_GROUP) of the process before opening Like link(setgit)(OPTION_SETGID) but is performed before opening the address.
the address. This call might require root privilege.
label(OPTION_SETUID)dit(bf(tt(setuid=<user>))) label(OPTION_SETUID)dit(bf(tt(setuid=<user>)))
Changes the link(<user>)(TYPE_USER) (owner) of the process after processing Changes the link(<user>)(TYPE_USER) (owner) of the process after processing
the address. This call might require root privilege. the address. This call might require root privilege. Please note that this
option does not drop group related privileges. Check if option
link(su)(OPTION_SUBSTUSER) better fits your needs.
label(OPTION_SETUID_EARLY)dit(bf(tt(setuid-early=<user>))) label(OPTION_SETUID_EARLY)dit(bf(tt(setuid-early=<user>)))
Changes the link(<user>)(TYPE_USER) (owner) of the process before opening Like link(setuid)(OPTION_SETSUID) but is performed before opening the
the address. This call might require root privilege. address.
label(OPTION_SUBSTUSER)dit(bf(tt(su=<user>))) label(OPTION_SUBSTUSER)dit(bf(tt(su=<user>)))
Changes the link(<user>)(TYPE_USER) (owner) and groups of the process after Changes the link(<user>)(TYPE_USER) (owner) and groups of the process after
processing the address (link(example)(EXAMPLE_OPTION_SUBSTUSER)). This call might require root privilege. processing the address (link(example)(EXAMPLE_OPTION_SUBSTUSER)). This call might require root privilege.

View File

@ -1,5 +1,5 @@
/* source: xio-process.c */ /* source: xio-process.c */
/* Copyright Gerhard Rieger 2001-2003 */ /* Copyright Gerhard Rieger 2001-2009 */
/* Published under the GNU General Public License V.2, see file COPYING */ /* Published under the GNU General Public License V.2, see file COPYING */
/* this file handles process related addresses options */ /* this file handles process related addresses options */
@ -14,6 +14,7 @@ const struct optdesc opt_setgid_early= { "setgid-early",NULL, OPT_SETGID_EARLY,
const struct optdesc opt_setgid = { "setgid", NULL, OPT_SETGID, GROUP_PROCESS, PH_LATE2, TYPE_GIDT, OFUNC_SPEC }; const struct optdesc opt_setgid = { "setgid", NULL, OPT_SETGID, GROUP_PROCESS, PH_LATE2, TYPE_GIDT, OFUNC_SPEC };
const struct optdesc opt_setuid_early= { "setuid-early",NULL, OPT_SETUID_EARLY,GROUP_PROCESS, PH_EARLY, TYPE_UIDT, OFUNC_SPEC }; const struct optdesc opt_setuid_early= { "setuid-early",NULL, OPT_SETUID_EARLY,GROUP_PROCESS, PH_EARLY, TYPE_UIDT, OFUNC_SPEC };
const struct optdesc opt_setuid = { "setuid", NULL, OPT_SETUID, GROUP_PROCESS, PH_LATE2, TYPE_UIDT, OFUNC_SPEC }; const struct optdesc opt_setuid = { "setuid", NULL, OPT_SETUID, GROUP_PROCESS, PH_LATE2, TYPE_UIDT, OFUNC_SPEC };
const struct optdesc opt_substuser_early = { "substuser-early", "su-e", OPT_SUBSTUSER_EARLY, GROUP_PROCESS, PH_EARLY, TYPE_UIDT, OFUNC_SPEC };
const struct optdesc opt_substuser = { "substuser", "su", OPT_SUBSTUSER, GROUP_PROCESS, PH_LATE2, TYPE_UIDT, OFUNC_SPEC }; const struct optdesc opt_substuser = { "substuser", "su", OPT_SUBSTUSER, GROUP_PROCESS, PH_LATE2, TYPE_UIDT, OFUNC_SPEC };
const struct optdesc opt_substuser_delayed = { "substuser-delayed", "su-d", OPT_SUBSTUSER_DELAYED, GROUP_PROCESS, PH_INIT, TYPE_UIDT, OFUNC_SPEC }; const struct optdesc opt_substuser_delayed = { "substuser-delayed", "su-d", OPT_SUBSTUSER_DELAYED, GROUP_PROCESS, PH_INIT, TYPE_UIDT, OFUNC_SPEC };
const struct optdesc opt_chroot_early = { "chroot-early", NULL, OPT_CHROOT_EARLY, GROUP_PROCESS, PH_EARLY, TYPE_STRING, OFUNC_SPEC }; const struct optdesc opt_chroot_early = { "chroot-early", NULL, OPT_CHROOT_EARLY, GROUP_PROCESS, PH_EARLY, TYPE_STRING, OFUNC_SPEC };

View File

@ -1,5 +1,5 @@
/* source: xio-process.h */ /* source: xio-process.h */
/* Copyright Gerhard Rieger 2001, 2002 */ /* Copyright Gerhard Rieger 2001-2009 */
/* Published under the GNU General Public License V.2, see file COPYING */ /* Published under the GNU General Public License V.2, see file COPYING */
#ifndef __xio_process_h_included #ifndef __xio_process_h_included
@ -9,6 +9,7 @@ extern const struct optdesc opt_setgid_early;
extern const struct optdesc opt_setgid; extern const struct optdesc opt_setgid;
extern const struct optdesc opt_setuid_early; extern const struct optdesc opt_setuid_early;
extern const struct optdesc opt_setuid; extern const struct optdesc opt_setuid;
extern const struct optdesc opt_substuser_early;
extern const struct optdesc opt_substuser; extern const struct optdesc opt_substuser;
extern const struct optdesc opt_substuser_delayed; extern const struct optdesc opt_substuser_delayed;
extern const struct optdesc opt_chroot_early; extern const struct optdesc opt_chroot_early;

View File

@ -1458,8 +1458,10 @@ const struct optname optionnames[] = {
#endif #endif
IF_ANY ("su", &opt_substuser) IF_ANY ("su", &opt_substuser)
IF_ANY ("su-d", &opt_substuser_delayed) IF_ANY ("su-d", &opt_substuser_delayed)
IF_ANY ("su-e", &opt_substuser_early)
IF_ANY ("substuser", &opt_substuser) IF_ANY ("substuser", &opt_substuser)
IF_ANY ("substuser-delayed", &opt_substuser_delayed) IF_ANY ("substuser-delayed", &opt_substuser_delayed)
IF_ANY ("substuser-early", &opt_substuser_early)
IF_TERMIOS("susp", &opt_vsusp) IF_TERMIOS("susp", &opt_vsusp)
#ifdef VSWTC #ifdef VSWTC
IF_TERMIOS("swtc", &opt_vswtc) IF_TERMIOS("swtc", &opt_vswtc)
@ -3262,6 +3264,7 @@ int applyopts(int fd, struct opt *opts, enum e_phase phase) {
opt->desc = ODESC_ERROR; ++opt; continue; opt->desc = ODESC_ERROR; ++opt; continue;
} }
break; break;
case OPT_SUBSTUSER_EARLY:
case OPT_SUBSTUSER: case OPT_SUBSTUSER:
{ {
struct passwd *pwd; struct passwd *pwd;

View File

@ -700,6 +700,7 @@ enum e_optcode {
# define ENABLE_OPTCODE # define ENABLE_OPTCODE
# include "xio-streams.h" # include "xio-streams.h"
# undef ENABLE_OPTCODE # undef ENABLE_OPTCODE
OPT_SUBSTUSER_EARLY,
OPT_SUBSTUSER, OPT_SUBSTUSER,
OPT_SUBSTUSER_DELAYED, OPT_SUBSTUSER_DELAYED,
OPT_SYMBOLIC_LINK, /* with pty */ OPT_SYMBOLIC_LINK, /* with pty */