New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find2perl -ls very slow on some LDAP based getpwent systems #8678
Comments
From david.dyck@fluke.comThis is a bug report for perl from david.dyck@fluke.com, [Please enter your report here] find2perl . -ls while (($name, $pw, $uid) = getpwent) { I just ran into a system where this loop takes many minutes to I did a test where I patched the OUTPUT of find2perl What cautions would others have How could this be made configurable for the find2perl users, Here's my 2n'd patch where I got rid of the preloading of Inline Patch--- f2p.ls 2006-11-13 11:12:03.000021000 -0800
+++ f2p.ls-optg 2006-11-13 16:14:32.000080000 -0800
@@ -5,13 +5,7 @@
@rwx = ('---','--x','-w-','-wx','r--','r-x','rw-','rwx');
@moname = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
-while (($name, $pw, $uid) = getpwent) {
- $user{$uid} = $name unless $user{$uid};
-}
-while (($name, $pw, $gid) = getgrent) {
- $group{$gid} = $name unless $group{$gid};
-}
require "find.pl";
@@ -59,6 +53,15 @@
substr($tmp,8,1) =~ tr/-x/Tt/ if -k _;
$perms .= $tmp;
+ unless (exists $user{$uid}) {
+ $user{$uid} = getpwuid($uid);
+ warn "looked up $uid => $user{$uid}\n";
+ }
+
+ unless (exists $group{$gid}) {
+ $group{$gid} = getgrgid($gid);
+ warn "looked up group $gid => $group{$gid}\n";
+ }
$user = $user{$uid} || $uid;
$group = $group{$gid} || $gid;
|
From @rgarciaOn 14/11/06, via RT David Dyck <perlbug-followup@perl.org> wrote:
I think that your (future) patch is acceptable since every used user |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Mon Nov 13 17:57:52 2006, dcd wrote:
Discussion in this RT petered out in 2006. AFAICT, the patch proposed was never applied to find2perl. Is there anyone familiar with find2perl who could evaluate whether this patch would be beneficial? Thank you very much. |
From @LeontOn Sun, Feb 2, 2014 at 2:22 AM, James E Keenan via RT <
The bug report looks sensible to me. The patch was against find2perl Leon |
From @jkeenanOn Sun Feb 02 01:39:59 2014, LeonT wrote:
At TonyC's request, tonight I explored the possibility of adapting this patch to be drawn against x2p/find2perl.PL in blead. Unfortunately, I don't think it's adaptable to the current x2p/find2perl.PL. Here's what I think is the relevant code in that file: ##### if (exists $init{group} || exists $init{ls} || exists $init{tar}) { Now, all those 'print' statements are really confusing. However, if we squint to see what's really happening, I *think* it's this: ##### my (%gid, %group); ##### AFAICT, the OP's patch only assigns to: ##### That leaves 4 hash elements unassigned to. So I can't figure out how to rewrite this patch against blead. Thank you very much. |
From @tonycozOn Mon Feb 03 18:08:00 2014, jkeenan wrote:
Taking a closer look at it, it would break a few other things that use %uid, %user, %gid and %group. The -name implementation uses %uid. The -group implementation uses %gid. The -tar implementation uses %user and %group. So the code generation for those would also need to be updated. Tony |
From @LeontOn Tue, Feb 4, 2014 at 5:36 AM, Tony Cook via RT
I also looked into fixing it and came to similar conclusions. My strategy Leon |
Migrated from rt.perl.org#40867 (status was 'open')
Searchable as RT40867$
The text was updated successfully, but these errors were encountered: