delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/12/11:39:54

X-Spam-Check-By: sourceware.org
Date: Wed, 12 Apr 2006 17:39:37 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Spam:Re: Find not working w/ Samba drive
Message-ID: <20060412153937.GF9135@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <443BA3CA DOT 6070208 AT byu DOT net> <2919 DOT 71 DOT 113 DOT 94 DOT 37 DOT 1144784474 DOT squirrel AT wm0> <443C0749 DOT 6000106 AT maplesoft DOT com> <20060412094839 DOT GA10758 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20060412094839.GA10758@calimero.vinschen.de>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Apr 12 11:48, Corinna Vinschen wrote:
> On Apr 11 15:45, Stefan Vorkoetter wrote:
> > And here's one from a Samba 2.2.3a share, repeated twice. Notice the inodes 
> > are different each time.
> > 
> > ~/sandboxes/main/internal/src [920] $ ls -i 
> > v:/internal_html/2006-04-10/*.jpg
> > 3796172808 v:/internal_html/2006-04-10/17-50-56.jpg
> > [...]
> 
> I have a vague hope.  It really looks like the inode numbers sent by
> older Samba versions are 32 bit values, which would allow to distinguish
> between old and new versions.
> 
> Would you or anybody with an older Samba version mind to look into
> more directories on the share and try to figure out if the inode number
> is always smaller than UINT_MAX (4294967295)?  I just need a feedback
> of yes or no.

Btw., I have hacked together a tiny testcase which lists a directory and
evaluates the inode numbers using readdir and lstat.  I would be
interested to see the output for some smaller directories on shares
using pre-3.0 Samba versions.  This should also simplify testing in
general.


Corinna


======================== SNIP =====================
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>

int
main(int argc, char **argv)
{
  DIR *dirp;
  int fd;
  struct stat sb;
  struct dirent *d;

  if (argc > 1)
    {
      dirp = opendir(argv[1]);
      if (dirp)
        {
          while (d = readdir (dirp))
            {
              char buf[256];
              struct stat st;

              strcpy (buf, argv[1]);
              if (buf[strlen (buf) - 1] != '/')
                strcat (buf, "/");
              strcat (buf, d->d_name);
              lstat (buf, &st);
              printf ("%24s d: %18.18llu, st: %18.18llu\n",
                      d->d_name, d->d_ino, st.st_ino);
            }
          closedir (dirp);
        }
      else
          printf("dirp = NULL\n");
    }
  return 0;
}
======================== SNAP =====================


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019