[cs631apue] Setproctitle not available on Linux Lab

Tejas Nadkarni tnadkarn at stevens.edu
Sun Dec 8 14:18:34 EST 2013


So I figured it out and verified with ps auxwww | grep aed.

It now shows './aed -e -p ****'

The problem I have is when I pipe to another instance it breaks that
instance and I can't figure out why. When I redirect to files and
output/readin files it works fine. Something with the pipe and modifying
argv. Any ideas

my code is only executed when getopt sees the 'p' parameter set...

strncpy(argv[optind-1],STARS,strlen(argv[optind-1]));

Which replaces the passphrase with asterisks

i.e.

./aed -e -p Tejas <file | ./aed -d p Tejas - WORKS

./aed -e < | ./aed -d -p Tejas - DOES NOT WORK. Prompts for passphrase and
I enter but get encrypted text back

./aed -e -p Tejas <file | ./aed -d  - Prompts me for passphrase but when I
enter it, I get encrypted text back.

./aed -e <file | ./aed -d - WORKS

If I remove the strncpy, all conditions work. Also like I mentioned,
working with files works always.




On Sat, Dec 7, 2013 at 8:11 PM, Jan Schaumann <jschauma at stevens.edu> wrote:

> Tejas Nadkarni <tnadkarn at stevens.edu> wrote:
> > I modified the contents of argv for the entry relating to the
> passphrase, I
> > printed it before the change and after the change and so I know I
> modified
> > it. However, when I run 'ps aux | grep aed' I still see the original
> > passphrase and not what I modified. Is there another step to refresh the
> > process entry??
>
> Post your code.
>
> If you manipulated the right pointer (and not a copy of it), then that
> should be sufficient.
>
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131208/7cda5177/attachment.html>


More information about the cs631apue mailing list