If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

configure outputs incorrect definition for DEFINES if whoami returns a name with a space

RESOLVED FIXED in mozilla1.2alpha

Status

SeaMonkey
Build Config
P4
minor
RESOLVED FIXED
16 years ago
13 years ago

People

(Reporter: Jonathan Wilson, Assigned: hacker formerly known as seawood@netscape.com)

Tracking

Trunk
mozilla1.2alpha
x86
Windows XP
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

16 years ago
On my system, whoami (from cygwin) returns Jonathan Wilson
This causes something inside configure to define DEFINES as 
-DDEBUG_Jonathan=Wilson\ 1 (plus other defines).

Is this infact a problem with configure and if so, what do we do to fix it?
This is questionably a problem with configure.  We don't support spaces in
usernames and that's what's causing whomai to return that bogus value.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 2

16 years ago
Accepting this bug, fix should be available shortly
Status: NEW → ASSIGNED
(Reporter)

Updated

16 years ago
Blocks: 134113
(Reporter)

Comment 3

16 years ago
I got a fix for this bug available but I cant make a patch since my configure.in
files have changed because of bug 134113
You change line 323 of nsprpub/configure.in to this
    AC_DEFINE_UNQUOTED(DEBUG_`$WHOAMI | sed -e's/ /_/g;'`)
and line 3316 of configure.in to this
        MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME}
| sed -e's/ /_/g;'`"

Anyone that has vanila configure.in files want to do the changes then post a fix
to the bug?

Comment 4

16 years ago
Created attachment 81145 [details] [diff] [review]
Jonathan's patch

Comment 5

16 years ago
Created attachment 81147 [details] [diff] [review]
Corrected patch
Attachment #81145 - Attachment is obsolete: true

Comment 6

16 years ago
I suggest that we simply not define the DEBUG_`$WHOAMI` macro.
This is what I will do to the NSPR build system (bug 140399).
In fact I doubt anyone is using the DEBUG_`$WHOAMI` macro now.
Depends on: 140399
Well, it's not used in NSPR but it is used all over the rest of the tree, as an
lxr for DEBUG_ will show (or DEBUG_<your favorite hacker here>).  I don't see
any benefit of dropping the define at this point. 
Priority: -- → P4
Target Milestone: --- → mozilla1.0.1
Target Milestone: mozilla1.0.1 → mozilla1.1beta

Comment 8

16 years ago
*** Bug 89302 has been marked as a duplicate of this bug. ***
Created attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too
Attachment #81147 - Attachment is obsolete: true
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

r=dmose@netscape.com
Attachment #94527 - Flags: review+

Comment 11

15 years ago
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

r=mcs
The patch has been checked into:
mozilla trunk
nspr trunk
ldap trunk
nspr NSPRPUB_PRE_4_2_CLIENT_BRANCH
ldap ldapcsdk_50_client_branch
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED

Comment 13

15 years ago
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

>+    case "${target_os}" in
>+    beos*)
>+        DEFINES="$DEFINES -DDEBUG_${USER}"
>+        ;;
>+    msvc*|mksnt*|cygwin*|mingw*)
>+        DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
>+        ;;
>+    *) 
>+        DEFINES="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
>+        ;;
>+    esac

MOZ_DEBUG_ENABLE_DEFS is not defined in mozilla/nsprpub/configure.in.
Perhaps the code for the default case should say:
	  DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"

Comment 14

15 years ago
Just wondering:
Why is "whoami" used at all ? AFAIK the ${LOGNAME} env variable provides the
same info...

Comment 15

15 years ago
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

In nsprpub/configure.in, I changed
	DEFINES="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
to
	DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
on the tip and NSPRPUB_PRE_4_2_CLIENT_BRANCH of NSPR.

The same change needs to be made to directory/c-sdk/configure.in.
Attachment #94527 - Flags: needs-work+

Comment 16

15 years ago
wtc:
Any idea why we use "whoami" and not $LOGNAME ?

Comment 17

15 years ago
The use of "whoami" comes from the original
Netscape browser build system (ns/config/*.mk).
I don't know why it used "whoami", not $LOGNAME.

Comment 18

15 years ago
Wan-Teh Chang wrote:
> I don't know why it used "whoami", not $LOGNAME

What about killing all the "whoami" stuff and simply use $LOGNAME instead ?
FWIW, $LOGNAME is not universal either.  LOGNAME is not set when using the BeOS
version of bash.  $USER is as close as you'll get to having universal coverage
afaict and even that's not set by win32's cmd.exe.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.