From: Johannes Sixt <J.Sixt@eudaptics.com>
To: git@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: "git clone" executed as root on solaris 10 shreds UFS (it ispossible to create hardlinks for directories as root under solaris)
Date: Mon, 16 Jul 2007 16:35:10 +0200 [thread overview]
Message-ID: <469B821E.85E5EDA9@eudaptics.com> (raw)
In-Reply-To: 20070716134529.GC26675@cip.informatik.uni-erlangen.de
Thomas Glanzmann wrote:
> static void create_directories(const char *path, const struct checkout *state)
> {
> ...
> if (mkdir(buf, 0777)) {
> => if (errno == EEXIST) {
> struct stat st;
> => if (len > state->base_dir_len && state->force && !unlink(buf) && !mkdir(buf, 0777))
> continue;
> if (!stat(buf, &st) && S_ISDIR(st.st_mode))
> continue; /* ok */
> }
> die("cannot create directory at %s", buf);
> }
> ...
>
> I think here is the problem. I don't understand what the code should do
> actually. Or why the directory is deleted and re-created (maybe something todo
> with permissions)?
It tries to remove a *file* that is in the way and create the directory
in its place. But since your unlink() behaves incorrectly (it is
supposed to *fail* for directories), the logic does not quite work as
expected - it mistakes the directory for a file.
Try swapping the two inner-most if-blocks.
-- Hannes
next prev parent reply other threads:[~2007-07-16 14:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 10:08 "git clone" executed as root on solaris 10 shreds UFS (it is possible to create hardlinks for directories as root under solaris) Thomas Glanzmann
2007-07-16 10:43 ` Thomas Glanzmann
2007-07-16 10:48 ` David Kastrup
2007-07-16 12:35 ` Thomas Glanzmann
2007-07-16 10:51 ` David Kastrup
2007-07-16 12:39 ` Thomas Glanzmann
2007-07-16 12:58 ` David Kastrup
2007-07-16 13:15 ` Thomas Glanzmann
2007-07-16 16:40 ` Thomas Glanzmann
2007-07-16 12:46 ` Thomas Glanzmann
2007-07-16 13:36 ` Thomas Glanzmann
2007-07-16 16:29 ` David Kastrup
2007-07-16 17:03 ` Linus Torvalds
2007-07-16 17:07 ` Linus Torvalds
2007-07-16 17:17 ` Thomas Glanzmann
2007-07-16 18:09 ` Thomas Glanzmann
2007-07-18 8:50 ` Thomas Glanzmann
2007-07-18 15:45 ` Linus Torvalds
2007-07-18 18:15 ` Thomas Glanzmann
2007-07-16 13:45 ` Thomas Glanzmann
2007-07-16 14:35 ` Johannes Sixt [this message]
2007-07-16 15:45 ` "git clone" executed as root on solaris 10 shreds UFS (it ispossible " Brian Downing
2007-07-16 15:50 ` Brian Downing
2007-07-16 19:57 ` David Kastrup
2007-07-16 17:12 ` Thomas Glanzmann
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=469B821E.85E5EDA9@eudaptics.com \
--to=j.sixt@eudaptics.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.