Closed
Bug 201554
Opened 23 years ago
Closed 21 years ago
checksetup.pl gives un-necessary warning to non-root user with webservergroup access
Categories
(Bugzilla :: Installation & Upgrading, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: justdave, Assigned: robzilla)
References
Details
Attachments
(2 files, 2 obsolete files)
|
2.05 KB,
patch
|
goobix
:
review+
|
Details | Diff | Splinter Review |
|
2.04 KB,
patch
|
goobix
:
review+
|
Details | Diff | Splinter Review |
If you have $webservergroup set, but run checksetup.pl as a non-root user, you
get the following warning:
---------
Warning: you have entered a value for the "webservergroup" parameter
in localconfig, but you are not running this script as root.
This can cause permissions problems and decreased security. If you
experience problems running Bugzilla scripts, log in as root and re-run
this script, or remove the value of the "webservergroup" parameter.
Note that any warnings about "uninitialized values" that you may
see below are caused by this.
---------
If the user is not root, but *is* a member of the group named in
$webservergroup, then this warning is unnecessary. We should test for it and
skip the warning if that's the case.
Suggested way to test for it is to attempt to chgrp a file to $webservergroup
and either test for errors and/or go back and see if it actually changed.
| Reporter | ||
Comment 1•21 years ago
|
||
*** Bug 246196 has been marked as a duplicate of this bug. ***
Comment 2•21 years ago
|
||
Wouldn't it be simpler to just compare the groupid of webservergroup with $( ??
| Reporter | ||
Comment 3•21 years ago
|
||
Hmm, suppose it would. $( in list context does indeed give all of your groups
and not just the primary. $) might be better though (effective group), which
also gives all of them when referenced in list context.
| Reporter | ||
Updated•21 years ago
|
Flags: blocking2.20+
Flags: blocking2.18+
Target Milestone: --- → Bugzilla 2.18
Updated•21 years ago
|
Whiteboard: bug awaiting patch
| Assignee | ||
Comment 5•21 years ago
|
||
Patch for 2.18 branch
| Assignee | ||
Updated•21 years ago
|
Attachment #168229 -
Flags: review?
| Assignee | ||
Updated•21 years ago
|
Attachment #168230 -
Flags: review?
| Assignee | ||
Updated•21 years ago
|
Whiteboard: bug awaiting patch → patch awaiting review
Comment 6•21 years ago
|
||
Comment on attachment 168229 [details] [diff] [review]
rsiklos_v1
+ my $webservergid = (getgrnam($my_webservergroup))[2];
Is there any chance of $webservergid to be undefined? Or is it guaranteed that
getgrnam will always return a result? If there is a chance to be undef, the
grep below will emit an undef warning and strange results. :-)
+localconfig, but you are not either a) running this script as $::root; or b) a
Not sure about:
"not either" --> "neither"
"or" --> "nor"
but since I'm not a native English speaker, maybe the one evaluating the
approval could put some light on this.
Attachment #168229 -
Flags: review? → review+
Updated•21 years ago
|
Attachment #168230 -
Flags: review? → review+
Updated•21 years ago
|
Flags: approval?
Flags: approval2.18?
Whiteboard: patch awaiting review → patch awaiting approval
Comment on attachment 168229 [details] [diff] [review]
rsiklos_v1
>+ my $webservergid = (getgrnam($my_webservergroup))[2];
>+ if ($< != 0 && !grep(/^$webservergid$/, split(" ", $)))) {
this will break on win32 (getgrnam is not implemented).
Attachment #168229 -
Flags: review-
Comment on attachment 168230 [details] [diff] [review]
rsiklos_v1-218
>- if ($< != 0) { # zach: if not root, yell at them, bug 87398
>+ my $webservergid = (getgrnam($my_webservergroup))[2];
>+ if ($< != 0 && !grep(/^$webservergid$/, split(" ", $)))) {
same win32 breakage.
Attachment #168230 -
Flags: review-
Comment 9•21 years ago
|
||
Comment on attachment 168229 [details] [diff] [review]
rsiklos_v1
I thought about that as well but somehow my brain thought $my_webservergroup is
undefined in Windows.
Maybe we should do that instead (undef $my_webservergroup somewhere up in the
.cgi); that would save us from checking the platform twice.
Attachment #168229 -
Flags: review+
Updated•21 years ago
|
Attachment #168230 -
Flags: review+
Updated•21 years ago
|
Flags: approval?
Flags: approval2.18?
Whiteboard: patch awaiting approval → bug awaiting patch
Comment 10•21 years ago
|
||
Rob, can you upload new patches in which you stick the new code inside a:
if ($^O !~ /MSWin32/i) {
// new, Unix-only code goes here
}
block? Thanks! :)
| Assignee | ||
Comment 11•21 years ago
|
||
Ok, this should be better.
Attachment #168230 -
Attachment is obsolete: true
| Assignee | ||
Comment 12•21 years ago
|
||
patch v2 for trunk
Attachment #168229 -
Attachment is obsolete: true
| Assignee | ||
Updated•21 years ago
|
Attachment #168307 -
Flags: review?
| Assignee | ||
Updated•21 years ago
|
Attachment #168308 -
Flags: review?
| Assignee | ||
Updated•21 years ago
|
Whiteboard: bug awaiting patch → patch awaiting review
Updated•21 years ago
|
Attachment #168307 -
Flags: review? → review+
Updated•21 years ago
|
Attachment #168308 -
Flags: review? → review+
Updated•21 years ago
|
Flags: approval?
Flags: approval2.18?
Whiteboard: patch awaiting review → patch awaiting approval
| Reporter | ||
Comment 13•21 years ago
|
||
Nit: the $::root variable contains "Administrator" on Win32 and "root"
otherwise. This chunk of text is now inside a block that prevents it from
running on Win32, so the use of the variable for it is unnecessary.
Flags: approval?
Flags: approval2.18?
Flags: approval2.18+
Flags: approval+
| Reporter | ||
Updated•21 years ago
|
Whiteboard: patch awaiting approval → patch awaiting checkin
Comment 14•21 years ago
|
||
I thought about the $::root stuff as well, but then I thought that maybe
sometimes we will be able to control ACL (access lists) from NTFS from Perl :-),
and a Windows version of getgrnam will be available :) Heh, one can only dream :)
But anyway, in the case where we will be able to port this code on Windows as
well, file permissions security-wise, I won't like to replace "root" with
"$::root" back again. So I guess leaving it as $::root for now doesn't make any
harm.
Comment 15•21 years ago
|
||
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl
new revision: 1.314; previous revision: 1.313
done
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl
new revision: 1.289.2.12; previous revision: 1.289.2.11
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Whiteboard: patch awaiting checkin
Updated•13 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•