p-alik / nfsen

Attention! This repository contains inofficial copy of NfSen. The official site of the NfSen project: http://nfsen.sourceforge.net/
Other
17 stars 10 forks source link

Can't use string ("live") as a HASH ref while "strict refs" in use at libexec/NfProfile.pm line 1238 #1

Closed p-alik closed 6 years ago

p-alik commented 6 years ago

actually it's not a new issue.

Steps to reproduce:

Rebuilding profile stats for './live' Can't use string ("live") as a HASH ref while "strict refs" in use at libexec/NfProfile.pm line 1238

p-alik commented 6 years ago

nfsen is the project of @phaag. With regard to the install message:

* You may want to subscribe to the nfsen-discuss mailing list:
* http://lists.sourceforge.net/lists/listinfo/nfsen-discuss
* Please send bug reports back to me: phaag@sourceforge.net

I tried unfortunately without success to report the issue.

t0d0r commented 6 years ago

There is the patch about it, ref: https://sourceforge.net/p/nfsen/mailman/message/35850749/

diff --git a/install.pl b/install.pl
index 5ce265e..2a213db 100755
--- a/install.pl
+++ b/install.pl
@@ -553,7 +553,7 @@ sub UpgradeProfiles {
                if( ! -f "$NfConf::PROFILEDATADIR/$profilepath/$channel/.nfstat") {
                    # no shadow profile, but missing channel stat
                    print "Rebuilding profile stats for '$profilegroup/$profilename'\n";
-                   NfProfile::DoRebuild(\%profileinfo, $profilename, $profilegroup, $profilepath, 1, 0);
+                   NfProfile::DoRebuild(*STDOUT, \%profileinfo, $profilename, $profilegroup, $profilepath, 1, 0);
                    NfProfile::WriteProfile(\%profileinfo);
                }
                # make sure it's own by nfsen_uid after the rebuild
diff --git a/libexec/NfProfile.pm b/libexec/NfProfile.pm
index 1ca7436..d58fcd2 100644
--- a/libexec/NfProfile.pm
+++ b/libexec/NfProfile.pm
@@ -3441,7 +3441,7 @@ sub CheckProfiles {
                } else {
                    $profileinfo{'type'} = 1;
                }
-               my $status = DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
+               my $status = DoRebuild(*STDOUT, \%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
                syslog('err', "Rebuilded profile '$profile' in group '$profilegroup': $status ");
            }
            if ( -f "$NfConf::PROFILESTATDIR/$profilepath/.CANCELED" ) {
@@ -3453,7 +3453,7 @@ sub CheckProfiles {
                } else {
                    $profileinfo{'type'} = 1;
                }
-               my $status = DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
+               my $status = DoRebuild(*STDOUT, \%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
                syslog('err', "Rebuilded profile '$profile' in group '$profilegroup': $status ");
            }
            if ( $profileinfo{'locked'} ) {
p-alik commented 6 years ago

Indeed, but the issue was reported 2016 for 1.3.7. https://sourceforge.net/p/nfsen/mailman/message/35147369/

aiso-net commented 6 years ago

Im having this issue on CentOS 7 with stable 1.3.8, how do I fix it?

t0d0r commented 6 years ago

@aiso-net, did you tried to apply the patch?

aiso-net commented 6 years ago

sorry, not familiar with that, any info on how to?

t0d0r commented 6 years ago

https://www.thegeekstuff.com/2014/12/patch-command-examples

TLDR:

- remove the line
+ add the line 
aiso-net commented 6 years ago

thanks, but that didnt work: [root@nms nfsen-1.3.8]# patch libexec/NfProfile.pm NfProfile.pm-patch patching file libexec/NfProfile.pm Hunk #1 FAILED at 3441. Hunk #2 FAILED at 3453. 2 out of 2 hunks FAILED -- saving rejects to file libexec/NfProfile.pm.rej [root@nms nfsen-1.3.8]# >install.pl-patch [root@nms nfsen-1.3.8]# vi install.pl-patch [root@nms nfsen-1.3.8]# patch install.pl install.pl-patch patching file install.pl Hunk #1 FAILED at 553. 1 out of 1 hunk FAILED -- saving rejects to file install.pl.rej

aiso-net commented 6 years ago

Applied the patch manually and that fixed it, thanks

sebastian-be commented 6 years ago

This one works:

patch -p 1 -i fix.patch

patching file install.pl Hunk #1 succeeded at 553 with fuzz 1. patching file libexec/NfProfile.pm

Ps: the fix.patch contains content as posted by t0d0r above

p-alik commented 6 years ago

https://github.com/p-alik/nfsen/releases/tag/nfsen-1.3.8 based on origin nfsen-1.3.8 but includes the patch 98bf068eb78cf8e5acdfdb2ebdd3cdf11d164869 for the issue.

p-alik commented 5 years ago

In PR #8 @candlerb described the matter of doRebuild + $socket.