s3:utils: let smbstatus report anonymous signing/encryption explicitly
[samba.git] / source3 / modules / vfs_fileid.c
index f9472c275ee2a587c448b3ec8d248140f2899a8d..2c67946efb3fdb52dbffd08581c9d70c96c8293f 100644 (file)
@@ -471,6 +471,8 @@ static int fileid_connect(struct vfs_handle_struct *handle,
        ino_t nolockinode;
        uint64_t max_slots = 0;
        bool rootdir_nolock = false;
+       const char **nolock_paths = NULL;
+       size_t i;
        int saved_errno;
        int ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
 
@@ -575,6 +577,13 @@ static int fileid_connect(struct vfs_handle_struct *handle,
                }
        }
 
+       data->nolock.force_all_inodes = lp_parm_bool(SNUM(handle->conn),
+                                                    "fileid", "nolock_all_inodes",
+                                                    data->nolock.force_all_inodes);
+       data->nolock.force_all_dirs = lp_parm_bool(SNUM(handle->conn),
+                                                  "fileid", "nolock_all_dirs",
+                                                  data->nolock.force_all_dirs);
+
        max_slots = lp_parm_ulonglong(SNUM(handle->conn),
                                      "fileid", "nolock_max_slots",
                                      max_slots);
@@ -615,6 +624,34 @@ static int fileid_connect(struct vfs_handle_struct *handle,
                }
        }
 
+       nolock_paths = lp_parm_string_list(SNUM(handle->conn), "fileid", "nolock_paths", NULL);
+       for (i = 0; nolock_paths != NULL && nolock_paths[i] != NULL; i++) {
+               SMB_STRUCT_STAT tmpsbuf;
+
+               ret = get_connectpath_ino(handle, nolock_paths[i], &tmpsbuf);
+               if (ret == -1 && errno == ENOENT) {
+                       DBG_ERR("ignoring non existing nolock_paths[%zu]='%s'\n",
+                               i, nolock_paths[i]);
+                       continue;
+               }
+               if (ret != 0) {
+                       saved_errno = errno;
+                       SMB_VFS_NEXT_DISCONNECT(handle);
+                       errno = saved_errno;
+                       return -1;
+               }
+
+               ret = fileid_add_nolock_inode(data, &tmpsbuf);
+               if (ret != 0) {
+                       saved_errno = errno;
+                       SMB_VFS_NEXT_DISCONNECT(handle);
+                       errno = saved_errno;
+                       return -1;
+               }
+               DBG_DEBUG("Adding nolock_paths[%zu]='%s'\n",
+                         i, nolock_paths[i]);
+       }
+
        SMB_VFS_HANDLE_SET_DATA(handle, data, NULL,
                                struct fileid_handle_data,
                                return -1);