search for: xasprintf

Displaying 20 results from an estimated 171 matches for "xasprintf".

Did you mean: kasprintf
2016 Jun 01
0
[PATCH v2] rescue: add --autosysroot option RHBZ#1183493
...+/* Use autodetected suggested filesystems */ +static void +use_suggestions (char **cmds) +{ + size_t i; + if (cmds == NULL) return; + read_only = 0; + + /* Craft kernel command line from suggested commands */ + for (i = 0; cmds[i] != NULL; i++) { + char *old_append = append; + append = xasprintf ("%s guestfs_command=%s;", append == NULL? "" : append, cmds[i]); + if (old_append != NULL) + free (old_append); + } +} + /* virt-rescue --suggest flag does a kind of inspection on the * drives and suggests mount commands that you should use. */ -static void +stati...
2016 May 24
1
[PATCH] rescue: add --autosysroot option RHBZ#1183493
--autosysroot option uses suggestions to user on how to mount filesystems and change root suggested by --suggest option in virt-rescue. Commands are passed on kernel command line in format guestfs_command=command;. Command ends with a semicolon and there can be multiple commands specified. These are executed just before bash starts. On successfull run user is presented directly with bash in
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...and then use a sequence of Xs of the same length as input to the underlying C printf to determine the amount of leading and trailing padding. Finally we replace the Xs with the actual string before writing it out. In order to print out the temporary string containing Xs and padding, a new helper xasprintf is added. Unlike asprintf though, our xasprintf prints to the ash stack rather than using straight malloc memory. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 80 +++++++++++++++++++++++...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...and then use a sequence of Xs of the same length as input to the underlying C printf to determine the amount of leading and trailing padding. Finally we replace the Xs with the actual string before writing it out. In order to print out the temporary string containing Xs and padding, a new helper xasprintf is added. Unlike asprintf though, our xasprintf prints to the ash stack rather than using straight malloc memory. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 80 +++++++++++++++++++++++...
2023 Nov 14
1
[PATCH v3 1/2] Permit %L and %l percent escapes in ssh Include
...+ shorthost[strcspn(thishost, ".")] = '\0'; + value = 0; while ((arg = argv_next(&ac, &av)) != NULL) { if (*arg == '\0') { @@ -1971,11 +1978,14 @@ parse_pubkey_algos: goto out; } if (!path_absolute(arg) && *arg != '~') { - xasprintf(&arg2, "%s/%s", + xasprintf(&arg_pre, "%s/%s", (flags & SSHCONF_USERCONF) ? "~/" _PATH_SSH_USER_DIR : SSHDIR, arg); } else - arg2 = xstrdup(arg); + arg_pre = xstrdup(arg); + arg2 = percent_expand(arg_pre, + "l"...
2024 Jul 01
1
[PATCH RESEND 1/2] Permit %L and %l percent escapes in Include
...+ shorthost[strcspn(thishost, ".")] = '\0'; + value = 0; while ((arg = argv_next(&ac, &av)) != NULL) { if (*arg == '\0') { @@ -2003,11 +2010,14 @@ parse_pubkey_algos: goto out; } if (!path_absolute(arg) && *arg != '~') { - xasprintf(&arg2, "%s/%s", + xasprintf(&arg_pre, "%s/%s", (flags & SSHCONF_USERCONF) ? "~/" _PATH_SSH_USER_DIR : SSHDIR, arg); } else - arg2 = xstrdup(arg); + arg_pre = xstrdup(arg); + arg2 = percent_expand(arg_pre, + "l"...
2023 Dec 20
2
[PATCH RESEND 0/2] Permit %L and %l percent escapes in Include
Using these escapes, the include directive can be crafted to include differing, host-specific configuration. Ronan Pigott (2): Permit %L and %l percent escapes in ssh Include Permit %L and %l percent escapes in sshd Include readconf.c | 16 +++++++++++++--- servconf.c | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) base-commit:
2024 Jul 01
2
[PATCH RESEND 0/2] Permit %L and %L percent escapes in Include
Using these escapes, the include directive can be crafted to include differing, host-specific configuration. Ronan Pigott (2): Permit %L and %l percent escapes in Include Permit %L and %l percent escapes in server Include readconf.c | 16 +++++++++++++--- servconf.c | 21 ++++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) base-commit:
2015 May 23
5
Name based SSH proxy
...41.426983727 +0200 @@ -515,12 +515,13 @@ ssh_connect(const char *host, struct add } static void -send_client_banner(int connection_out, int minor1) +send_client_banner(int connection_out, int minor1, const char *host) { /* Send our own protocol version identification. */ if (compat20) { - xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n", - PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION); + xasprintf(&client_version_string, + "SSH-%d.%d-%.100s {\"SNI\": \"%.133s\"}\r\n", + PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION,...
2016 Jun 01
2
[PATCH v2] rescue: add --autosysroot option RHBZ#1183493
--autosysroot option uses suggestions to user on how to mount filesystems and change root suggested by --suggest option in virt-rescue. Commands are passed on kernel command line in format guestfs_command=command;. Command ends with a semicolon and there can be multiple commands specified. These are executed just before bash starts. On successfull run user is presented directly with bash in
2011 Aug 17
1
openssh-unix-dev Digest, Vol 100, Issue 3
...1.170 > +++ scp.c 9 Aug 2011 06:10:08 -0000 > @@ -580,12 +580,14 @@ toremote(char *targ, int argc, char **ar > host = cleanhostname(argv[i]); > suser = NULL; > } > - xasprintf(&bp, "%s -f -- %s", cmd, src); > + xasprintf(&bp, "%s -f %s%s", cmd, > + *src == '-' ? "-- " : "", src); > if (do_cmd(host, suser, bp, &remin, &remout) &lt...
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
2023 Nov 13
2
[PATCH v2] Permit %L and %l percent escapes in Include
...+ shorthost[strcspn(thishost, ".")] = '\0'; + value = 0; while ((arg = argv_next(&ac, &av)) != NULL) { if (*arg == '\0') { @@ -1971,11 +1978,14 @@ parse_pubkey_algos: goto out; } if (!path_absolute(arg) && *arg != '~') { - xasprintf(&arg2, "%s/%s", + xasprintf(&arg_pre, "%s/%s", (flags & SSHCONF_USERCONF) ? "~/" _PATH_SSH_USER_DIR : SSHDIR, arg); } else - arg2 = xstrdup(arg); + arg_pre = xstrdup(arg); + arg2 = percent_expand(arg_pre, + "l"...
2023 Nov 14
0
[PATCH v3 2/2] Permit %L and %l percent escapes in sshd Include
...9;; + value = 0; while ((arg2 = argv_next(&ac, &av)) != NULL) { if (*arg2 == '\0') { @@ -2140,9 +2147,13 @@ process_server_config_line_depth(ServerOptions *options, char *line, value++; found = 0; if (*arg2 != '/' && *arg2 != '~') { - xasprintf(&arg, "%s/%s", SSHDIR, arg2); + xasprintf(&arg_pre, "%s/%s", SSHDIR, arg2); } else - arg = xstrdup(arg2); + arg_pre = xstrdup(arg2); + + arg = percent_expand(arg_pre, + "l", thishost, "L", shorthost, (char *) NULL); + free(arg_pre...
2024 Jul 01
0
[PATCH RESEND 2/2] Permit %L and %l percent escapes in server Include
...9;; + value = 0; while ((arg2 = argv_next(&ac, &av)) != NULL) { if (*arg2 == '\0') { @@ -2240,9 +2247,13 @@ process_server_config_line_depth(ServerOptions *options, char *line, value++; found = 0; if (*arg2 != '/' && *arg2 != '~') { - xasprintf(&arg, "%s/%s", SSHDIR, arg2); + xasprintf(&arg_pre, "%s/%s", SSHDIR, arg2); } else - arg = xstrdup(arg2); + arg_pre = xstrdup(arg2); + + arg = percent_expand(arg_pre, + "l", thishost, "L", shorthost, (char *) NULL); + free(arg_pre...
2024 Jul 01
1
[PATCH RESEND 1/2] Permit %L and %l percent escapes in Include
....")] = '\0'; >+ > value = 0; g> while ((arg = argv_next(&ac, &av)) != NULL) { > if (*arg == '\0') { >@@ -2003,11 +2010,14 @@ parse_pubkey_algos: > goto out; > } > if (!path_absolute(arg) && *arg != '~') { >- xasprintf(&arg2, "%s/%s", >+ xasprintf(&arg_pre, "%s/%s", > (flags & SSHCONF_USERCONF) ? > "~/" _PATH_SSH_USER_DIR : SSHDIR, arg); > } else >- arg2 = xstrdup(arg); >+ arg_pre = xstrdup(arg); >+ arg2 = percent_expand(...
2015 May 16
1
tinc 1.1 "Got ADD_EDGE ... which does not match existing entry"
On Sat, 16 May 2015, Guus Sliepen wrote: > On Sat, May 16, 2015 at 12:09:52AM +0200, Sven-Haegar Koch wrote: > > > This change is not so good: > > > > Connection with aaa_vpnhub1 (1.2.3.4 port 443) activated > > Error while translating addresses: ai_family not supported > > > > (And then the tinc process exists) > > Hm, I couldn't reproduce
2020 Oct 06
2
Accessing SSH key path using SSH_ASKPASS and passwordstore
Hello, With the introduction of SSH_ASKPASS_REQUIRE in version 8.4, I've set up a script for SSH_ASKPASS to query my local passwordstore (https://www.passwordstore.org/) vault to retrieve the password for a given key. This works for ssh-add as well as ssh (configured with AddKeysToAgent set to 'yes'). My workflow effectively transforms into entering the password for the GPG key used
2016 Apr 03
22
[Bug 2561] New: ssh-keygen -A does not recreate broken zero-sized host keys
https://bugzilla.mindrot.org/show_bug.cgi?id=2561 Bug ID: 2561 Summary: ssh-keygen -A does not recreate broken zero-sized host keys Product: Portable OpenSSH Version: 7.2p1 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 Component: ssh-keygen
2016 Feb 13
4
[Bug 2540] New: Adds xstrndup() to xmalloc.h/xmalloc.c in OpenSSH 7.x
...ed): --- xmalloc.h.orig 2016-02-13 09:15:50.418982399 -0800 +++ xmalloc.h 2016-02-13 09:16:24.760347010 -0800 @@ -20,6 +20,7 @@ void *xcalloc(size_t, size_t); void *xreallocarray(void *, size_t, size_t); char *xstrdup(const char *); +char *xstrndup(const char *, size_t); int xasprintf(char **, const char *, ...) __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2))); ======================================================================= --- xmalloc.c.orig 2016-02-13 09:33:10.108121542 -0800 +++ xmalloc.c 2016-02-13...