macOS getgrent returns no groups while getgrgid works
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 47/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend, operating-systems
Direzione di ricerca
Start by reading ExtendedNativeUtils.getgrent, FFMPosixLinux.getgrent, and FFMPosixMacOS to trace the native call and how a null result becomes an empty list. Then compare the macOS FFM binding and enumeration setup with the host libc behavior; the issue says the failure occurs on both execution backends. Done means successive getgrent calls return group records after setgrent, with regression coverage for list context and File::Finder's nogroup predicates.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On macOS, PerlOnJava's getgrent returns no group entries, even though getgrgid can look up a group by GID. This breaks Perl code that enumerates the group database. It causes the released CPAN distribution File-Finder 1.01 to misclassify every path for its nogroup and not nogroup predicates.
Reproduction
The following probe was run with both the JVM backend and --interpreter:
my $gid = (stat ".")[5];
my @by_gid = getgrgid($gid);
print "gid=$gid getgrgid=", scalar(@by_gid), " ", join("|", @by_gid), "\n";
setgrent();
my @entry = getgrent();
print "getgrent=", scalar(@entry), " ", join("|", @entry), "\n";
PerlOnJava reports a valid getgrgid record, then getgrent=0. Repeated getgrent calls also return no entries. System Perl on the same macOS host returns group entries from getgrent (and a valid record from getgrgid).
CPAN evidence
In CPAN random tester run 20261109-091152-39587, File-Finder-1.01 failed 2 of 87 tests, both in t/05-steps.t:
nogroup: PerlOnJava included.although the system-Perl expected result was empty.not nogroup: PerlOnJava returned an empty result although system Perl included..
System Perl passed all 87 tests. The other File-Finder tests passed or were skipped for optional dependencies. This is a pure-Perl distribution; no XS/native distribution prioritization applies.
The affected code in File-Finder builds a GID-to-group map by iterating getgrent. Because PerlOnJava returns no entries, _gid_to_group cannot resolve the directory's GID; nogroup then treats it as unknown. The same failure was observed with both PerlOnJava backends.
Suspected implementation path
ExtendedNativeUtils.getgrent calls FFMPosix.get().getgrent() and converts a null native result into an empty Perl list. The FFM implementation in FFMPosixLinux.getgrent invokes the native getgrent handle and returns null when the pointer is null. On macOS, FFMPosixMacOS inherits this implementation. In contrast, the native getgrgid path succeeds for the current GID.
This localizes the failure to native group enumeration, shared by the two execution backends. The precise reason the native getgrent call returns null still needs investigation; likely follow-up is to validate the macOS FFM binding and enumeration setup against the platform libc behavior.
Expected behavior
After setgrent, successive getgrent calls should enumerate the same available group records as system Perl on the host. The regression should cover list-context results and the File::Finder nogroup/not nogroup behavior on both execution backends.
- Lingua principale
- Perl
- Stelle
- 67
- Fork
- 8
- Merge medio
- 5h 12m
- PR unite (30g)
- 131
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
area:cpan-port bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
fglock/PerlOnJava#2153 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:parser bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
fglock/PerlOnJava#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
area:backend area:cpan-port area:runtime bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fglock/PerlOnJava#2071 ·
I maintainer di solito rispondono entro 1 giorno
-
area:runtime documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
fglock/PerlOnJava#2157 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksApertateam-cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 93/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
inverse-inc/packetfence#9728 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(char-create): show the real reason a character is refusedForse già presa @baphomello l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno