public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] linux: make getcwd(3) fail if it cannot obtain an absolute path [BZ #22679]
Date: Mon, 05 Feb 2018 19:18:00 -0000	[thread overview]
Message-ID: <871shzjm3e.fsf@linux-m68k.org> (raw)
In-Reply-To: <1b4f7d9a-627a-85ec-e87a-bab0dc57df90@redhat.com> (Florian Weimer's message of "Mon, 5 Feb 2018 19:49:53 +0100")

On Feb 05 2018, Florian Weimer <fweimer@redhat.com> wrote:

> /* Like chdir(), but it keeps track of the current directory (in the
>  * global "curr_dir"), and ensures that the path size doesn't overflow.
>  * Also cleans the path using the clean_fname() function. */
> int change_dir(const char *dir, int set_path_only)
> {
> 	static int initialised, skipped_chdir;
> 	unsigned int len;
>
> 	if (!initialised) {
> 		initialised = 1;
> 		if (getcwd(curr_dir, sizeof curr_dir - 1) == NULL) {
> 			rsyserr(FERROR, errno, "getcwd()");
> 			exit_cleanup(RERR_FILESELECT);
> 		}
> 		curr_dir_len = strlen(curr_dir);
> 	}

This will also fail when rsync is started from a directory that has
since been removed, where getcwd (even the syscall) has always returned
an error.  So this isn't a new failure.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2018-02-05 19:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07  3:05 Dmitry V. Levin
2018-01-07  8:23 ` Andreas Schwab
2018-01-07 11:33   ` Dmitry V. Levin
2018-01-07 12:20     ` Andreas Schwab
2018-01-07 12:36       ` Dmitry V. Levin
2018-01-07 12:41         ` [PATCH v2] " Dmitry V. Levin
2018-01-07 13:10           ` Florian Weimer
2018-01-07 13:39             ` [PATCH v3] " Dmitry V. Levin
2018-01-08 15:07               ` Dmitry V. Levin
2018-01-11 22:03                 ` [PATCH v4] " Dmitry V. Levin
2018-01-11 23:44                   ` Florian Weimer
2018-01-12  0:11                     ` Dmitry V. Levin
2018-01-12 12:56                   ` Florian Weimer
2018-01-07 15:53       ` [PATCH] " Zack Weinberg
2018-01-07 16:07         ` Andreas Schwab
2018-01-07 16:21           ` Zack Weinberg
2018-01-07 17:07             ` Dmitry V. Levin
2018-01-07 20:04               ` Zack Weinberg
2018-01-07 16:24           ` Dmitry V. Levin
2018-02-05 19:03 ` Florian Weimer
2018-02-05 19:18   ` Andreas Schwab [this message]
2018-02-05 20:03     ` Florian Weimer
2018-02-06  0:10       ` Dmitry V. Levin
2018-02-06 16:57         ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871shzjm3e.fsf@linux-m68k.org \
    --to=schwab@linux-m68k.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).