xattr returns other stuff....
authorAlan <alan@roojs.com>
Mon, 1 Nov 2021 05:59:08 +0000 (13:59 +0800)
committerAlan <alan@roojs.com>
Mon, 1 Nov 2021 05:59:08 +0000 (13:59 +0800)
File/Smb/Dir.php

index 3d55b42..fd29333 100644 (file)
@@ -88,18 +88,23 @@ class File_Smb_Dir {
         if (isset($this->atime)) {
             $this->access_datetime = date("Y-m-d H:i:s", $this->atime);
         }
-        $acls = explode(',',smbclient_getxattr($this->resource, 'smb://' . $this->server . '/'. $this->path, 'system.nt_sec_desc.*+'));
+        $acl_str = @smbclient_getxattr($this->resource, 'smb://' . $this->server . '/'. $this->path, 'system.nt_sec_desc.*+');
+        
+        $acls = explode(',',$act_str);
         $this->acls = array();
         foreach($acls as $a) {
             $aa = explode(":", $a);
+            if (empty($aa[1])) {
+                continue;
+            }
             if ($aa[0] == 'ACL') {
                 if (!in_array($aa[1], $this->acls)) {
                     $this->acls[] = $aa[1];
                 }
-                
-            } else {
-                $this->{strtolower($aa[0])} = $aa[1];
-            }
+                continue;
+            } 
+            $this->{strtolower($aa[0])} = $aa[1];
+            
             
             
         }