Richard Shaw
2017-03-29 18:38:16 UTC
I'm working on the 4.1.0 release for Fedora and I've been working through
all the patches I inherited, most of which aren't necessary anymore.
Here's one that I'm not sure what effect it actually has:
$ cat rpmbuild/BackupPC/SOURCES/BackupPC-4.0.0-fix-shadow-access.patch
--- a/lib/BackupPC/CGI/Lib.pm
+++ b/lib/BackupPC/CGI/Lib.pm
@@ -143,7 +143,7 @@ sub NewRequest
# Verify we are running as the correct user
#
if ( $Conf{BackupPCUserVerify}
- && $> != (my $uid = (getpwnam($Conf{BackupPCUser}))[2]) ) {
+ && $> != (my $uid = (getpwnam($Conf{BackupPCUser}))) ) {
ErrorExit(eval("qq{$Lang->{Wrong_user__my_userid_is___}}"), <<EOF);
This script needs to run as the user specified in \$Conf{BackupPCUser},
which is set to $Conf{BackupPCUser}.
--- a/lib/BackupPC/Lib.pm
+++ b/lib/BackupPC/Lib.pm
@@ -127,7 +127,7 @@ sub new
#
if ( !$noUserCheck
&& $bpc->{Conf}{BackupPCUserVerify}
- && $> != (my $uid = (getpwnam($bpc->{Conf}{BackupPCUser}))[2])
) {
+ && $> != (my $uid = (getpwnam($bpc->{Conf}{BackupPCUser}))) ) {
print(STDERR "$0: Wrong user: my userid is $>, instead of $uid"
. " ($bpc->{Conf}{BackupPCUser})\n");
print(STDERR "Please su $bpc->{Conf}{BackupPCUser} first\n");
What's the effect of removing the [2] from these?
Thanks,
Richard
all the patches I inherited, most of which aren't necessary anymore.
Here's one that I'm not sure what effect it actually has:
$ cat rpmbuild/BackupPC/SOURCES/BackupPC-4.0.0-fix-shadow-access.patch
--- a/lib/BackupPC/CGI/Lib.pm
+++ b/lib/BackupPC/CGI/Lib.pm
@@ -143,7 +143,7 @@ sub NewRequest
# Verify we are running as the correct user
#
if ( $Conf{BackupPCUserVerify}
- && $> != (my $uid = (getpwnam($Conf{BackupPCUser}))[2]) ) {
+ && $> != (my $uid = (getpwnam($Conf{BackupPCUser}))) ) {
ErrorExit(eval("qq{$Lang->{Wrong_user__my_userid_is___}}"), <<EOF);
This script needs to run as the user specified in \$Conf{BackupPCUser},
which is set to $Conf{BackupPCUser}.
--- a/lib/BackupPC/Lib.pm
+++ b/lib/BackupPC/Lib.pm
@@ -127,7 +127,7 @@ sub new
#
if ( !$noUserCheck
&& $bpc->{Conf}{BackupPCUserVerify}
- && $> != (my $uid = (getpwnam($bpc->{Conf}{BackupPCUser}))[2])
) {
+ && $> != (my $uid = (getpwnam($bpc->{Conf}{BackupPCUser}))) ) {
print(STDERR "$0: Wrong user: my userid is $>, instead of $uid"
. " ($bpc->{Conf}{BackupPCUser})\n");
print(STDERR "Please su $bpc->{Conf}{BackupPCUser} first\n");
What's the effect of removing the [2] from these?
Thanks,
Richard