Displaying 20 results from an estimated 29 matches for "tilde_expand_filename".
2015 Aug 17
3
[PATCH] Expand tilde for UNIX domain socket forwards.
On Mon, 17 Aug 2015, Todd C. Miller wrote:
> I like the idea but tilde_expand_filename() calls fatal() if it
> cannot resolve ~foo. This is not terrible when using -L and -R on
> the normal command line but it seems pretty harsh to exit when -L
> or -R are used via the ~C escape or the streamlocal-forward at openssh.com
> request.
> Message-Id: <aea6cdc1d1b42d07 at...
2015 Aug 17
2
[PATCH] Expand tilde for UNIX domain socket forwards.
...b487..396e192 100644
--- a/channels.c
+++ b/channels.c
@@ -3014,10 +3014,14 @@ channel_setup_fwd_listener_streamlocal(int type, struct Forward *fwd,
debug3("%s: type %d path %s", __func__, type, fwd->listen_path);
+ /* Expand home directory if necessary */
+ char *expanded_path = tilde_expand_filename(fwd->listen_path, getuid());
+
/* Start a Unix domain listener. */
omask = umask(fwd_opts->streamlocal_bind_mask);
- sock = unix_listener(fwd->listen_path, SSH_LISTEN_BACKLOG,
+ sock = unix_listener(expanded_path, SSH_LISTEN_BACKLOG,
fwd_opts->streamlocal_bind_unlink);
+ free(...
2004 Aug 25
2
Default path to identity file
...ame of the identity file defaults to what fill_default_options() in
readconf.c does:
SSH_PROTO_1:
"~/%.100s", _PATH_SSH_CLIENT_IDENTITY
SSH_PROTO_2:
"~/%.100s", _PATH_SSH_CLIENT_ID_RSA
"~/%.100s", _PATH_SSH_CLIENT_ID_DSA
Identity files are always expanded by tilde_expand_filename() which gets
the name of the home directory from getpwuid(my_uid)->pw_dir.
This is not what I expect (well, hope :-) when my UID is 0 but I'm not
root.
In other words: my username is dahlem, my UID is 0, my HOME dir is
/home/dahlem. Ssh does not use /home/dahlem/.ssh/id_rsa but
/.ssh/i...
2007 Oct 17
2
[patch] ssh.c load_public_identity_files calls getpwuid twice without copy
Hi,
getpwuid is called as seen in the patch, and is then called again
indirectly by tilde_expand_filename without first copying off the
results from the first call.
This is fatal on MacOSX (and it would seem it should be fatal elsewhere, too).
Please CC me in replies; I'm not a subscriber.
--- openssh-4.4p1/ssh.c 2006-09-01 22:32:40.000000000 -0700
+++ openssh-4.4p1-fix/ssh.c 2007-10-17 10:2...
2003 Jan 18
0
[Patch] User-dependent IdentityFile
...wd *pw, const char *prompt)
{
@@ -103,7 +113,28 @@
break;
}
- snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name);
+
+ if(options.num_identity_files > 0) {
+ char *file=NULL;
+ char *p=strrchr(name,'/');
+ if(p) file = p+1;
+
+ name = tilde_expand_filename(options.identity_files[0],
+ original_real_uid);
+ name = expand_filename(name,pw);
+ p=strrchr(name,'/');
+ if(p) *p=0;
+
+ if(file && *file) {
+ snprintf(identity_file, sizeof(identity_file), "%s/%s", name,file);
+ }
+ else {
+ snprintf...
2014 Sep 08
1
possible deadcodes in sources
...|| *arg == '\0')
fatal("%s line %d: missing file name.",
filename, linenum);
- if (*activep && *charptr == NULL) {
+ if (*activep && *charptr == NULL)
*charptr = tilde_expand_filename(arg, getuid());
- /* increase optional counter */
- if (intptr != NULL)
- *intptr = *intptr + 1;
- }
break;
case sClientAliveInterval:
* monitor_wrap.c:720:dead_error_line ? Executi...
2002 Jan 27
0
IdentityFile patch
...0.2p1I/ssh.c Sun Jan 27 12:05:14 2002
@@ -1212,9 +1212,13 @@
key_free(public);
}
#endif /* SMARTCARD */
+ struct passwd *pw;
+ pw=getpwuid(original_real_uid);
+ if (!pw) fatal("Unknown user id: %d", original_real_uid);
for (; i < options.num_identity_files; i++) {
filename = tilde_expand_filename(options.identity_files[i],
original_real_uid);
+ filename = expand_filename(filename,pw);
public = key_load_public(filename, NULL);
debug("identity file %s type %d", filename,
public ? public->type : -1);
diff -ur openssh-3.0.2p1/tildexpand.c openssh-3.0.2p1I/tilde...
2015 Oct 21
7
[Bug 2481] New: Tilde expansion in -i option inconsistent
https://bugzilla.mindrot.org/show_bug.cgi?id=2481
Bug ID: 2481
Summary: Tilde expansion in -i option inconsistent
Product: Portable OpenSSH
Version: 6.6p1
Hardware: All
OS: Linux
Status: NEW
Severity: trivial
Priority: P5
Component: ssh
Assignee: unassigned-bugs at mindrot.org
2002 Jan 27
1
[PATCH] Add user-dependent IdentityFile to OpenSSH-3.0.2p1
...0.2p1I/ssh.c Sun Jan 27 12:05:14 2002
@@ -1212,9 +1212,13 @@
key_free(public);
}
#endif /* SMARTCARD */
+ struct passwd *pw;
+ pw=getpwuid(original_real_uid);
+ if (!pw) fatal("Unknown user id: %d", original_real_uid);
for (; i < options.num_identity_files; i++) {
filename = tilde_expand_filename(options.identity_files[i],
original_real_uid);
+ filename = expand_filename(filename,pw);
public = key_load_public(filename, NULL);
debug("identity file %s type %d", filename,
public ? public->type : -1);
diff -ur openssh-3.0.2p1/tildexpand.c openssh-3.0.2p1I/tilde...
2015 Jun 10
0
[Bug 1585] Allow an `Include' option which reads another config file in place and does not error out when `Include' file not readable
...|jjelen at redhat.com
--- Comment #20 from Jakub Jelen <jjelen at redhat.com> ---
Created attachment 2647
--> https://bugzilla.mindrot.org/attachment.cgi?id=2647&action=edit
proposed patch for ssh config
I don't know why there is not to used function tilde_expand_filename,
which does exactly the same thing that you are implementing on these 80
lines.
It works fine for including single file, but for conf.d use cases
(described in #2351 and #1613) would be great to have possibility to
include all directory.
I massaged this patch to do so (tilde, wildcard) and I woul...
2010 Mar 31
2
[Bug 1748] New: getcwd being called with invalid argument in servconf.c
...Severity: critical
Priority: P2
Component: sshd
AssignedTo: unassigned-bugs at mindrot.org
ReportedBy: dan.mitton at ymp.gov
In servconf.c, the code segment...
char *
derelativise_path(const char *path)
{
char *expanded, *ret, *cwd;
expanded = tilde_expand_filename(path, getuid());
if (*expanded == '/')
return expanded;
if ((cwd = getcwd(NULL, 0)) == NULL)
fatal("%s: getcwd: %s", __func__, strerror(errno));
xasprintf(&ret, "%s/%s", cwd, expanded);
xfree(cwd);...
2002 Feb 01
0
[Bug 95] New: Allow '%' expansion to work in ssh and ssh-add
...Severity: enhancement
Priority: P2
Component: ssh
AssignedTo: openssh-unix-dev at mindrot.org
ReportedBy: jprondak at visualmedia.com
By moving expand_filename() from auth.c into tildexpand.c, '%' substitution can be used but any programs that use tilde_expand_filename() as opposed
to just sshd.
The reason for this was to allow for IdentityFile inclusion like as follows:
[..ssh_config..]
IdentityFile /var/spool/ssh/%u/idenity
IdentityFile ~/.ssh/identity
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching...
2017 May 18
2
feature request: use HOME before getpwnam() in misc.c
it's really^3 annoying that no matter the value of $HOME, that tilde_expand_filename() only looks at getpwnam() and friends instead of at least trying getenv("HOME").
What is the use case?
HOME=longpath_to_config1
ssh -i ~/.ssh/key1
HOME=longpath_to_config2
ssh -i ~/.ssh/key2
but getpwnam() defeats this by always accessing what's in the passwd file. So .ssh/known_...
2003 Aug 09
2
[Bug 623] ssh, ssh-keygen and possibly others do not honour $HOME
http://bugzilla.mindrot.org/show_bug.cgi?id=623
Summary: ssh, ssh-keygen and possibly others do not honour $HOME
Product: Portable OpenSSH
Version: 3.6.1p2
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: ssh
AssignedTo: openssh-bugs at mindrot.org
2007 Oct 20
5
[Bug 1377] New: getpwuid called twice without pwcopy (percent_expand: NULL replacement)
https://bugzilla.mindrot.org/show_bug.cgi?id=1377
Summary: getpwuid called twice without pwcopy (percent_expand:
NULL replacement)
Classification: Unclassified
Product: Portable OpenSSH
Version: 4.4p1
Platform: ix86
OS/Version: Mac OS X
Status: NEW
Severity: major
Priority: P2
2005 Jun 12
2
%h,%p,%u expansion for ControlPath
...(sp->s_port);
+ else
+ options.port = SSH_DEFAULT_PORT;
+ }
+
if (options.proxy_command != NULL &&
strcmp(options.proxy_command, "none") == 0)
options.proxy_command = NULL;
@@ -611,6 +622,42 @@ again:
if (options.control_path != NULL) {
options.control_path = tilde_expand_filename(
options.control_path, original_real_uid);
+
+ if (strchr(options.control_path, '%')) {
+ Buffer path;
+ const char *cp;
+ char strport[NI_MAXSERV];
+
+ /* Convert the port number into a string. */
+ snprintf(strport, sizeof strport, "%hu", options.port);
+
+ b...
2006 Oct 09
1
About sftp-server root path
Hi,
I saw in archive that some people made a patch to sftp-server, and that patch
sets a root path.
I'd like to know if there's an ideia to apply that patch in main tree of
openssh?
With the use of SSHFS [wich uses sftp-server], it would be interesting to
have someting like that, because as we have netboot workstations, the access
to devices [such as, floppy, cdrom and usb data] are
2006 Feb 22
8
[Bug 1159] %u and %h not handled in IdentityFile
http://bugzilla.mindrot.org/show_bug.cgi?id=1159
Summary: %u and %h not handled in IdentityFile
Product: Portable OpenSSH
Version: 4.3p2
Platform: All
URL: http://www.math.ualberta.ca/imaging/snfs/openssh.html
OS/Version: Linux
Status: NEW
Keywords: patch
Severity: normal
Priority: P2
2008 Mar 31
0
Announce: OpenSSH 4.9 released
...not be opened. (bz#1375)
- Fixed ssh-keygen(1) selective host key hashing (i.e.
"ssh-keygen -HF hostname") to not include any IP address in the
data to be hashed. (bz#1376)
- Fix clobbering of struct passwd from multiple getpwid calls,
resulting in fatal errors inside tilde_expand_filename. (bz#1377)
- Fix parsing of port-forwarding specifications to correctly
detect errors in either specified port number. (bz#1378)
- Fix memory leak in ssh(1) ~ escape commandline handling. (bz#1379)
- Make ssh(1) skip listening on the IPv6 wildcard address when a
binding address o...
2008 Mar 31
0
Announce: OpenSSH 4.9 released
...not be opened. (bz#1375)
- Fixed ssh-keygen(1) selective host key hashing (i.e.
"ssh-keygen -HF hostname") to not include any IP address in the
data to be hashed. (bz#1376)
- Fix clobbering of struct passwd from multiple getpwid calls,
resulting in fatal errors inside tilde_expand_filename. (bz#1377)
- Fix parsing of port-forwarding specifications to correctly
detect errors in either specified port number. (bz#1378)
- Fix memory leak in ssh(1) ~ escape commandline handling. (bz#1379)
- Make ssh(1) skip listening on the IPv6 wildcard address when a
binding address o...