Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Issue 490028: Linux: use readlink() and prctl() in SetProcTitle() to fix "exe" showing in process listings. (Closed)

Created:
11 years ago by Mike Mammarella
Modified:
9 years, 7 months ago
Reviewers:
satorux1, Evan Martin, ambrose
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org
Visibility:
Public.

Description

Linux: use readlink() and prctl() in SetProcTitle() to fix "exe" showing in process listings. BUG=29118 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=35441

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 3

Patch Set 4 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -4 lines) Patch
M base/command_line.cc View 1 2 3 2 chunks +35 lines, -2 lines 3 comments Download
M base/setproctitle_linux.h View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/plugin/plugin_main.cc View 2 3 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Mike Mammarella
It was not immediately obvious to me where to put a call to SetProcTitle() so ...
11 years ago (2009-12-11 22:42:59 UTC) #1
Evan Martin
http://codereview.chromium.org/490028/diff/1/2 File base/command_line.cc (right): http://codereview.chromium.org/490028/diff/1/2#newcode223 base/command_line.cc:223: title = buffer; title.assign(buffer, r); for the above two ...
11 years ago (2009-12-11 23:46:22 UTC) #2
satorux1
Coming from http://crbug.com/22703. Just FYI. top command on my Linux box (ubuntu 9.10) does not ...
11 years ago (2009-12-13 04:16:06 UTC) #3
satorux1
FWIW, prctl() worked for me. We could do something like prctl(PR_SET_NAME, basename(resolved_path)) to set the ...
11 years ago (2009-12-13 05:00:36 UTC) #4
Mike Mammarella
On 2009/12/13 05:00:36, satorux1 wrote: > FWIW, prctl() worked for me. We could do something ...
11 years ago (2009-12-14 04:42:13 UTC) #5
satorux1
On 2009/12/14 04:42:13, Mike Mammarella wrote: > On 2009/12/13 05:00:36, satorux1 wrote: > > FWIW, ...
11 years ago (2009-12-14 05:20:08 UTC) #6
Mike Mammarella
10 years, 11 months ago (2010-01-01 19:16:55 UTC) #7
satorux1
LGTM, but please wait for lgtm from Evan just in case. Minor comments below: http://codereview.chromium.org/490028/diff/8001/8002 ...
10 years, 11 months ago (2010-01-02 01:47:27 UTC) #8
Evan Martin
10 years, 11 months ago (2010-01-03 01:52:32 UTC) #9
LGTM with some suggestions, also adding on Ambrose since he had some thoughts on
this prctl business (but don't wait for him to respond)

http://codereview.chromium.org/490028/diff/11001/6006
File base/command_line.cc (right):

http://codereview.chromium.org/490028/diff/11001/6006#newcode10
base/command_line.cc:10: #elif defined(OS_LINUX) || defined(OS_FREEBSD)
seems harmless to use this on osx, so why not just OS_POSIX

http://codereview.chromium.org/490028/diff/11001/6006#newcode217
base/command_line.cc:217: // feature, but this makes us show up as "exe" in
process listings. Read
not a security feature, it's so updates don't swap ourselves out from under us. 
Since we also exec ourselves for renderers (though through a different
mechanism) I would just drop the "as a security feature".

http://codereview.chromium.org/490028/diff/11001/6006#newcode223
base/command_line.cc:223: ssize_t r = readlink("/proc/self/exe", buffer,
sizeof(buffer));
google style frowns on one-letter variable names.  why not "length" ?

Powered by Google App Engine
This is Rietveld 408576698