summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-07-09 11:35:20 -0700
committerJeremy Allison <jra@samba.org>2012-07-09 11:35:20 -0700
commit1f37ed7a5283ef3abd095d6a92efa231e7e2444d (patch)
treeac52b6016361e9b16b48af67c99b6c82d4899de8 /source3/smbd
parent7b1fb36ad0df810b8629a4f5d5f069de4466d080 (diff)
downloadsamba-1f37ed7a5283ef3abd095d6a92efa231e7e2444d.tar.gz
samba-1f37ed7a5283ef3abd095d6a92efa231e7e2444d.tar.bz2
samba-1f37ed7a5283ef3abd095d6a92efa231e7e2444d.zip
Factor out check_same_dev_ino() from check_same_stat() so it can be called separately.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index c88fe65a34..145a8a4e6a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -40,6 +40,20 @@ struct deferred_open_record {
};
/****************************************************************************
+ 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
overrides this.
@@ -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;