Displaying 20 results from an estimated 48 matches for "child_set_env".
2000 Feb 27
0
[PATCH] Fix login.conf, expiration, BSD compatibility in OpenSSH
...s, LOGIN_SETPRIORITY |
- LOGIN_SETRESOURCES | LOGIN_SETUMASK) == -1) {
- perror("setclasscontext");
- exit(1);
- }
-#endif /* LOGIN_CAP */
+ char **tmpenv;
+
+ /* Initialize temp environment */
+ envsize = 64;
+ env = xmalloc(envsize * sizeof(char *));
+ env[0] = NULL;
+
+ child_set_env(&env, &envsize, "PATH",
+ (pw->pw_uid == 0) ?
+ _PATH_STDPATH : _PATH_DEFPATH);
+
+ snprintf(buf, sizeof buf, "%.200s/%.50s",
+ _PATH_MAILDIR, pw->pw_name);
+ child_set_env(&env, &envsize, "MAIL", buf);
+
+ if (getenv("T...
2001 Feb 26
0
Problems with OpenSSH 2.5.1p1 on Solaris 8
...fine S_UFSIZE_HARD S_UFSIZE "_hard"
@@ -1173,6 +1177,12 @@
#endif
if (!options.use_login) {
+#ifdef HAVE_ETC_DEFAULT_LOGIN
+ int fd, pagesize;
+ struct stat inode;
+ char *onemore = MAP_FAILED, *logstr = MAP_FAILED;
+ char *pathstr;
+#endif
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
@@ -1188,7 +1198,83 @@
* needed for loading shared libraries. So the path better
* remains intact here.
*/
+# ifdef HAVE_ETC_DEFAULT_LOGIN
+ if ((f...
2006 Sep 18
1
BSD Auth: set child environment variables requested by login script [PATCH]
...clude "ssh-gss.h"
#endif
#include "monitor_wrap.h"
+
+/*
+ * Set child environment variables starting with "X_BSD_AUTH".
+ * After the call to auth_close(), these variables are in the
+ * current environment if the login script has requested them.
+ */
+void
+bsdauth_child_set_env(char ***envp, u_int *envsizep)
+{
+ extern char **environ;
+ char name[8*1024]; /* MAXSPOOLSIZE in auth_session_t */
+ char *value;
+ u_int i, namelen;
+
+ for (i = 0; environ[i] != NULL; i++) {
+ namelen = strcspn(environ[i], "=");
+ if (namelen + 1 > sizeof(name))
+ continue;
+...
2002 Nov 26
0
[Bug 446] New: $LOGIN not set by openssh under AIX
...their version.
What are the chances of getting this incorporated into the openssh
distribution?
*** session.c.3.5p1 Wed Sep 25 20:38:50 2002
--- session.c Mon Nov 25 12:28:41 2002
***************
*** 969,974 ****
--- 969,977 ----
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
+ #ifdef _AIX
+ child_set_env(&env, &envsize, "LOGIN", pw->pw_name);
+ #endif
child_set_env(&...
2000 Sep 04
1
trivial patch to post overridden command into env
...= forced_command;
debug("Forced command '%.500s'", forced_command);
+ } else {
+ saved_command = NULL;
}
if (have_pty)
do_exec_pty(s, command, pw);
@@ -1042,6 +1047,9 @@
env = xmalloc(envsize * sizeof(char *));
env[0] = NULL;
+ if (saved_command) {
+ child_set_env(&env, &envsize, "command", saved_command);
+ }
if (!options.use_login) {
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available...
2001 Dec 18
1
[PATCH]: Fix environment variable size restriction in Cygwin version
...;
+ if (i_size > size) {
+ var_name = xrealloc(var_name, i_size);
+ size = i_size;
+ }
+ strcpy(var_name, environ[i]);
+ if ((var_val = strchr(var_name, '=')) != NULL) {
+ *var_val++ = '\0';
debug3("Copy environment: %s=%s", var_name, var_val);
child_set_env(env, envsize, var_name, var_val);
}
}
+ if (var_name)
+ xfree(var_name);
}
#endif
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com
2001 Mar 29
3
Patches for OpenSSH 2.5.2p2: evaluate /etc/default/login, makefiles manpages
...* if it is defined then set the proper environment variables.
+ */
+
+ /* Set environment variable SHELL only if ALTSHELL has value "YES". */
+ value = get_environment_value(default_login_env, "ALTSHELL");
+ if (value == NULL) {
+ /* Normal systems set SHELL by default. */
+ child_set_env(env, envsize, "SHELL", shell);
+ } else if (strcmp(value, "YES") == 0) {
+ child_set_env(env, envsize, "SHELL", shell);
+ }
+
+ /*
+ * If the user is root and SUPATH is defined,
+ * set environment variable PATH to the value of SUPATH.
+ * Else if PATH is defined...
2000 Oct 07
0
OpenSSH changes for BSD/OS
...pw_class);
+ if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETALL) < 0)
+ fatal("setusercontext failed.");
+ #endif /* HAVE_SETUSERCONTEXT */
}
/*
* Get the shell from the password data. An empty shell field is
***************
*** 1013,1019 ****
--- 1026,1038 ----
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
child_set_env(&env, &envsize, "HOME", pw->pw_dir);
+ #ifdef HAVE_SETUSERCONTEXT
+ /* update the path to the one setusercontext set fo...
2000 Feb 24
1
A problem with PATH in sshd.c
Dear Sirs,
on my Linux (distribution Slackware 3.9), I have installed the
``openssh-1.2.2.tar.gz'' package into the /usr/local/bin directory.
In the ``sshd.c'' file, the PATH variable is set up:
child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
(line no. 2405). I am unable to connect to my machine using scp.
_PATH_STDPATH is "/usr/bin:/bin:/usr/sbin:/sbin", but the scp program
dwells in /usr/local/bin. If I try to connect, enter password (etc.,
all OK), then the shell...
2000 May 24
0
'command' option in authorized_keys
...g *custom_environment = NULL;
@@ -343,6 +344,7 @@
packet_integrity_check(plen, 0, type);
}
if (forced_command != NULL) {
+ original_command = command;
command = forced_command;
debug("Forced command '%.500s'", forced_command);
}
@@ -911,6 +913,8 @@
child_set_env(&env, &envsize, "TERM", term);
if (display)
child_set_env(&env, &envsize, "DISPLAY", display);
+ if (original_command) /* LEE */
+ child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", original_command); /* LEE */
#ifdef _AIX
{
--...
2001 Oct 13
0
local IP in environment
...addr(int);
*** openssh-2.9.9p2/session.c.bak Sun Sep 16 15:17:15 2001
--- openssh-2.9.9p2/session.c Fri Oct 12 16:52:09 2001
***************
*** 1255,1260 ****
--- 1255,1263 ----
snprintf(buf, sizeof buf, "%.50s %d %d",
get_remote_ipaddr(), get_remote_port(), get_local_port());
child_set_env(&env, &envsize, "SSH_CLIENT", buf);
+ snprintf(buf, sizeof buf, "%.50s",
+ get_local_ipaddr2());
+ child_set_env(&env, &envsize, "SSH_LOCAL", buf);
if (s->ttyfd != -1)
child_set_env(&env, &envsize, "SSH_TTY", s->tt...
2003 Nov 11
1
AIX KRB5CCNAME problem
...ed me a bit. This code exists in the OpenSSH source from at least
as far back as 3.1 to the current source tree.
On about line 1087 of session.c we see this:
#ifdef _AIX
{
char *cp;
if ((cp = getenv("AUTHSTATE")) != NULL)
child_set_env(&env, &envsize, "AUTHSTATE", cp);
if ((cp = getenv("KRB5CCNAME")) != NULL)
child_set_env(&env, &envsize, "KRB5CCNAME", cp);
read_environment_file(&env, &envsize, "/etc/environment"...
2001 Aug 13
1
[PATCH] Maildir support
...def MAILDIR_FORMAT */
+}
+
/*
* Performs common processing for the child, such as setting up the
* environment, closing extra file descriptors, setting the user and group
@@ -1226,6 +1302,8 @@
#endif
if (!options.use_login) {
+ struct stat mailstat;
+
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
@@ -1245,10 +1323,22 @@
# endif /* HAVE_CYGWIN */
#endif /* HAVE_LOGIN_CAP */
+#ifndef MAILDIR_FORMAT
snprintf(buf, sizeof buf, "%.200s/%.50s",...
2013 Aug 05
2
RemoteForward and dynamically allocated listen port
...t easy to add support for forwarding unix sockets, which I have missed
for a long time.
Would any of these approaches be acceptable? Any other ideas?
Thanks,
Andrew
--- session.c.orig 2013-08-03 13:22:10.354171156 -0700
+++ session.c 2013-08-05 09:58:00.017397667 -0700
@@ -1307,6 +1307,17 @@
child_set_env(&env, &envsize, SSH_AUTHSOCKET_ENV_NAME,
auth_sock_name);
+ char name[256];
+ u_int n = 0;
+ for (i = 0; i < 100; i++) {
+ Channel *c = channel_by_id(i);
+ if (c == NULL || c->type != SSH_CHANNEL_RPORT_LISTENER)
+ continue;
+ snprintf(name, sizeof name, "SSH_REMOTE_...
2001 May 17
0
Patch: Set SSH_AUTHKEY to key id used to authenticate.
...00:41:15 2001
@@ -57,6 +57,7 @@
#include "serverloop.h"
#include "canohost.h"
#include "session.h"
+#include "key.h"
#ifdef WITH_IRIX_PROJECT
#include <proj.h>
@@ -1281,6 +1282,8 @@
get_remote_ipaddr(), get_remote_port(), get_local_port());
child_set_env(&env, &envsize, "SSH_CLIENT", buf);
+ if (key_matching_data(NULL))
+ child_set_env(&env, &envsize, "SSH_AUTHKEY", key_matching_data(NULL));
if (s->ttyfd != -1)
child_set_env(&env, &envsize, "SSH_TTY", s->tty);
if (s->term)
2013 May 15
1
[PATCH] Expose remote forwarding ports as environment variable
...tener(char *buf, size_t size);
/* protocol handler */
diff -ru openssh-6.2p1/session.c openssh-6.2p1.patched/session.c
--- openssh-6.2p1/session.c 2013-03-15 01:22:37.000000000 +0100
+++ openssh-6.2p1.patched/session.c 2013-05-15 23:27:12.459989713 +0200
@@ -1235,6 +1235,9 @@
xfree(laddr);
child_set_env(&env, &envsize, "SSH_CONNECTION", buf);
+ channel_list_rport_listener(buf, sizeof buf);
+ child_set_env(&env, &envsize, "SSH_REMOTE_FORWARDING_PORTS", buf);
+
if (s->ttyfd != -1)
child_set_env(&env, &envsize, "SSH_TTY", s->tty);
i...
2001 Feb 16
1
OpenSSH 2.3.0p1 port to BSDI BSD/OS
...nt */
-#ifndef HAVE_VIS
-
#include "includes.h"
+
+#ifndef HAVE_VIS
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
Index: session.c
--- session.c 2001/02/13 07:43:17 1.1
+++ session.c 2001/02/13 07:45:46 1.2
@@ -1155,7 +1155,9 @@
child_set_env(&env, &envsize, "HOME", pw->pw_dir);
#ifdef HAVE_LOGIN_CAP
(void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH);
- child_set_env(&env, &envsize, "PATH", getenv("PATH"));
+ /* update the path to the one setusercontext set for us */
+ if...
2009 Sep 21
2
[patch] RFC: put server tunnel name in environment
If an ssh server receives a tun/tap tunnel request and sets up the tunnel
concerned, as far as I can see there is currently no way for the server
to configure the tunnel in a manner dependent upon (e.g) the key used to
set up the ssh session. Whilst an id based on the key can be passed to
the ssh child process, where the tunnel is dynamically allocated, its
tunnel name is lost.
This patch
2002 Apr 22
0
[Bug 101] session.c modifications for correct UNICOS behavior
...time_string, '\n'))
@@ -678,6 +697,7 @@
printf("Last login: %s from %s\r\n", time_string,
s->hostname);
}
+#endif /* ! _CRAY */
do_motd();
}
@@ -916,7 +936,10 @@
if (original_command)
child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND",
original_command);
-
+#ifdef _CRAY
+ if (cray_tmpdir[0] != '\0')
+ child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir);
+#endif /* _CRAY */
#ifdef _AIX
{...
2002 Sep 04
4
Determining Local IP Address within .profile
...connect and we like to know within .profile which interface the client has connected to.
I've looked at the sourcecode and maybe the following could do something I described :
session.c:871 RCSID("$OpenBSD: session.c,v 1.142 2002/06/26 13:49:26 deraadt Exp $");
do_setup_env
child_set_env(&env, &envsize, "SSH_LOCAL_IP", get_local_ipaddr(packet_get_connection_in());
what do you think of it ?
thanx, mario