Comment 5 for bug 794202

Revision history for this message
Mikhail Kulinich (tysonite) wrote :

Just checked the source code of setcap and found that it does not support large files.
Consider the following code in cap_file.c/cap_set_file:
...
    struct stat buf;

    if (lstat(filename, &buf) != 0) {
 _cap_debug("unable to stat file [%s]", filename);
 return -1;
    }
...

If it is built on 32-bit linux, this code will not work for files large than 2Gb, because lstat() uses stat structure which represents size of file as off_t type.
As a workaround I suppose _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS=64 can be defined during compilation.