Explorar o código

Little fix to avoid errors in agent

Fixes the next errors:
Use of uninitialized value $uid in getpwuid at /usr/share/ogp_agent/ogp_agent.pl line 1351.
Use of uninitialized value $gid in getgrgid at /usr/share/ogp_agent/ogp_agent.pl line 1352.
DieFeM %!s(int64=8) %!d(string=hai) anos
pai
achega
fdda3dd8b4
Modificáronse 1 ficheiros con 17 adicións e 2 borrados
  1. 17 2
      OGP/ogp_agent.pl

+ 17 - 2
OGP/ogp_agent.pl

@@ -1348,8 +1348,23 @@ sub dirlistfm
 		 $size, $atime, $mtime, $ctime, $blksize, $blocks
 		) = stat($_);
 		
-		$uid = getpwuid($uid);
-		$gid = getgrgid($gid);
+		if(defined $uid)
+		{
+			$uid = getpwuid($uid);
+		}
+		else
+		{
+			$uid = '';
+		}
+		
+		if(defined $gid)
+		{
+			$gid = getgrgid($gid);
+		}
+		else
+		{
+			$gid = '';
+		}
 
 		#This if else logic determines what it is, File, Directory, other	
 		if (-T $_)