Bug 115394 - SCR::Read( .target.stat, ...) and SCR::Read(.target.size, ...) fail on large files
Summary: SCR::Read( .target.stat, ...) and SCR::Read(.target.size, ...) fail on large ...
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Beta 4 Plus
Hardware: Other All
: P5 - None : Critical
Target Milestone: ---
Assignee: Klaus Kämpf
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 113322
  Show dependency treegraph
 
Reported: 2005-09-06 11:13 UTC by Thomas Fehr
Modified: 2005-09-06 15:47 UTC (History)
2 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Fehr 2005-09-06 11:13:47 UTC
Hi,

Apparently SCR::Read(.target.size, ... ) amd SCR::Read(.target.stat, ... ) fail
if the pathname points to a file larger than 4 Gigabyte.

This makes my check for existence of crypto files fail when the crypto file is
large (se bugzilla #113322)

Since .target.size and .target.stat are used in many places I consider this
critical.

The following small ycp file:
{
integer tmp = (integer)SCR::Read(.target.size, "/tmp/crfile");
y2milestone( "size=%1", tmp );
map stat = (map)SCR::Read(.target.stat, "/tmp/crfile");
y2milestone( "stat=%1", stat );
}

logs the following if "/tmp/crfile" is larger than 4 Gigabyte:
2005-09-06 13:00:56 <1> Lagrange(10580) [YCP] ycp/emil18.ycp:3 size=-1
2005-09-06 13:00:56 <1> Lagrange(10580) [YCP] ycp/emil18.ycp:5 stat=$[]

but works file if "/tmp/crfile" is smaller:
2005-09-06 13:11:49 <1> Lagrange(10622) [YCP] ycp/emil18.ycp:3 size=104857600
2005-09-06 13:11:49 <1> Lagrange(10622) [YCP] ycp/emil18.ycp:5
stat=$["atime":1126004551, "ctime":1126004551, "gid":0, "inode":17500,
"isblock":false, "ischr":false, "isdir":false, "isfifo":false, "islink":false,
"isreg":true, "issock":false, "mtime":1126004551, "nlink":1, "size":104857600,
"uid":0]
Comment 1 Klaus Kämpf 2005-09-06 11:27:43 UTC
I'll check  
Comment 2 Klaus Kämpf 2005-09-06 11:32:32 UTC
Hmm, SystemAgent uses the st_size property of 'struct stat' and converts it to 
a YCPInteger (which is implemented as 'long long') 
Comment 3 Klaus Kämpf 2005-09-06 11:35:14 UTC
Looks like we have to use 'struct stat64' here ... 
Comment 4 Klaus Kämpf 2005-09-06 11:47:26 UTC
This should fix it: 
 
Index: configure.in.in 
=================================================================== 
--- configure.in.in     (revision 25391) 
+++ configure.in.in     (working copy) 
@@ -2,6 +2,8 @@ 
 
 ## initialize 
 @YAST2-INIT-COMMON@ 
+AC_SYS_LARGEFILE 
+ 
 @YAST2-INIT-PROGRAM@ 
 
 ## special stuff 
 
Comment 7 Klaus Kämpf 2005-09-06 13:11:07 UTC
submitted to svn, as yast2-core 2.12.24 
will add a testcase later 
Comment 8 Klaus Kämpf 2005-09-06 13:13:41 UTC
adding AC_SYS_LARGEFILE might also be valid for yast2-devtools when creating 
configure.in 
Comment 9 Klaus Kämpf 2005-09-06 15:47:24 UTC
testcase added now. submitted as 2.12.25