Hi Roel,

Sorry that I wasn't more clear on the drawbacks of the 'proctitleutils'...
The big BAD thing is that it messes up the argv and envp memory space.
All environment variables are copied to the external 'environ' array...
The command line arguments are not copied so they are gone... if they are
not done so by the caller program. Something like:
configFile = strndup(argv[2], strlen(argv[2])+1);

I found set_proc_title on the internet somewhere and modified it to suit my
needs,
so to tell you the truth I can't say how the sizelimit worked in the first
version
(patch version), i.e. the maxlen part. I've updated it to a new version
which I
understand and attached it. It now has a limit that is the size of argv and
envp together.


Regards
/Klas
[EMAIL PROTECTED]

>
>Well i spotted the problem - if you give the '-f <filename>' option,
>the filename is overwritten by the new functionality. Could you find a
>way to overcome this? Furthermore i was wondering if there is a
>sizelimit on the command line and wheter you are checking against it -
>wouldn't like segfaults because of a long username after all.
>
>regards roel
>
>
>Roel Rozendaal - IC&S heeft op vrijdag, 6 dec 2002 om 11:00
>(Europe/Amsterdam) het volgende geschreven:
>
>> Hi klas,
>>
>> like that idea, i patched my version here but it does not show
>> anything new in the process list. I'm running OS X - do you have any
>> idea how portable your code is?
>>
>> regards roel
>>
>>
>> Klas Handel heeft op vrijdag, 6 dec 2002 om 06:03 (Europe/Amsterdam)
>> het volgende geschreven:
>>
>>> Hello,
>>>
>>> Attached is a patch that can (if you #define PROC_TITLES in config.h)
>>> give you some useful information about imap and pop clients.
>>> Instead of giving you the normal information:
>>> 20842 ?        S      0:00 ./dbmail-imapd
>>> 20843 ?        S      0:00 ./dbmail-imapd
>>> 20844 ?        S      0:00 ./dbmail-imapd
>>>
>>> when you run 'ps ax' (or similar), you get:
>>> 21480 ?        S      0:00 dbmail/imap4d : Idle
>>> 21481 ?        S      0:00 dbmail/imap4d : USER root [127.0.0.1]
>>> 21482 ?        S      0:00 dbmail/imap4d : USER klas [200.12.11.13]
>>>
>>> I find it quite useful when I'm tracing errors for different users.
>>> (I've patched the 2002-12-06 cvs version)
>>>
>>> Regards
>>> /Klas
>>> [EMAIL PROTECTED]
>>> <process_titles.patch>
>>
>> _______________________________________________
>> Dbmail mailing list
>> Dbmail@dbmail.org
>> https://mailman.fastxs.nl/mailman/listinfo/dbmail

Attachment: proctitleutils.c
Description: Binary data

Reply via email to