Package: fakeroot-ng
Version: 0.18-4.1
Severity: normal

Dear maintainer,

while working on #1001961 in fakeroot, I noticed the stat() call is not
properly wrapped by fakeoot-ng, and appearently never did - I checked
back to Debian 8 ("jessie").

Reproducer: Build the program below and run under either fakeroot or
fakeroot-ng.

Expected output (observed with fakeroot):

I: UID is 0, '.' is owned by 0
I: Pass

Received output:

I: UID is 0, '.' is owned by 1000
E: UID mismatch


While I haven't checked it, this should also break the python-apt
autopkgtest if it were run using fakeroot-ng instead of fakeroot.
See the bug# mentioned above for an explanation.

To me, it seems prudent to add this to have feature parity.

Regards,

    Christoph

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.89 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages fakeroot-ng depends on:
ii  libc6       2.33-2
ii  libgcc-s1   11.2.0-14
ii  libstdc++6  11.2.0-14

fakeroot-ng recommends no packages.

fakeroot-ng suggests no packages.

-- no debconf information


---------------------------------------------------------------------
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

int main (int argc, char **argv) {
    struct stat statbuf;
    if (stat (".", &statbuf)) {
        perror("Cannot stat '.'");
        exit(1);
    }
    uid_t uid = getuid();
    printf("I: UID is %u, '.' is owned by %u\n", uid, statbuf.st_uid);
    if (uid == statbuf.st_uid) {
        if (uid) {
            printf("W: UID is not zero - not running under fakeroot?\n");
        } else {
            printf("I: Pass\n");
        }
    } else {
        printf("E: UID mismatch\n");
    }
}
---------------------------------------------------------------------

Attachment: signature.asc
Description: PGP signature

Reply via email to