Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6196107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:35:04+00:00 2026-05-24T03:35:04+00:00

popen buffers output while system does not. is that the only difference? I understand

  • 0

popen buffers output while system does not. is that the only difference?

I understand that popen and system both run the command through the shell. However, is popen() as evil as system()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:35:06+00:00Added an answer on May 24, 2026 at 3:35 am

    Look, the whole thing about “system being evil” is, at heart, people who don’t think about the security consequences of their particular use case. The only reason system is “more evil” than doing your own fork/dup/exec is that used badly, it’s possible for someone to introduce a malicious command line. So, for example

    #include <stdlib.h>
    
    int main(int argc, char** argv){
        (void) system(argv[1]);
    }
    

    is certainly dumb, because someone could put, eg, rm -rf / in as the argument. And, of course, something similarly dumb could be done with popen.

    But then consider something that does fork and exec using a user string for the command: the exact same vulnerability and stupidity exists.

    The evil — which is to say, the error — lies in using a random input string as a command without some filtering, not in the system call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you run something through popen in Python, the results come in from the
What is the difference between subprocess.Popen() and os.system() ?
I'm told subprocess.Popen does not block, so the process runs in the background and
I'm using IO.popen in Ruby to run a series of command line commands in
I am using Popen to run a command but I don't know how I
I create a subprocess using subprocess.Popen() that runs for a long time. It is
I am using popen to execute a command under linux, then 4 process wile
I'm using os.popen() in order to run a few commands. This is what man
When I use IO::popen with a non-existent command, I get an error message printed
With either subprocess.call or subprocess.Popen , executing a shell command makes a shell window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.