Factor out check_same_dev_ino() from check_same_stat() so it can be called separately.
authorJeremy Allison <jra@samba.org>
Mon, 9 Jul 2012 18:35:20 +0000 (11:35 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 9 Jul 2012 18:35:20 +0000 (11:35 -0700)
source3/smbd/open.c

index c88fe65a3466f267ece78c90d09a86caa8f17dca..145a8a4e6af495e979031c09bd88e692c25725c7 100644 (file)
@@ -39,6 +39,20 @@ struct deferred_open_record {
         struct file_id id;
 };
 
+/****************************************************************************
+ Check two stats have identical dev and ino fields.
+****************************************************************************/
+
+static bool check_same_dev_ino(const SMB_STRUCT_STAT *sbuf1,
+                       const SMB_STRUCT_STAT *sbuf2)
+{
+       if (sbuf1->st_ex_dev != sbuf2->st_ex_dev ||
+                       sbuf1->st_ex_ino != sbuf2->st_ex_ino) {
+               return false;
+       }
+       return true;
+}
+
 /****************************************************************************
  If the requester wanted DELETE_ACCESS and was rejected because
  the file ACL didn't include DELETE_ACCESS, see if the parent ACL
@@ -2745,8 +2759,7 @@ bool check_same_stat(const SMB_STRUCT_STAT *sbuf1,
 {
        if (sbuf1->st_ex_uid != sbuf2->st_ex_uid ||
                        sbuf1->st_ex_gid != sbuf2->st_ex_gid ||
-                       sbuf1->st_ex_dev != sbuf2->st_ex_dev ||
-                       sbuf1->st_ex_ino != sbuf2->st_ex_ino) {
+                       !check_same_dev_ino(sbuf1, sbuf2)) {
                return false;
        }
        return true;