source: net-ftp/oftpd/files/oftpd-0.3.7-delay-root-check.patch @ f3987e6

Revision f3987e6, 778 bytes checked in by Mario Fetka <mario.fetka@…>, 10 months ago (diff)

Bump

  • Property mode set to 100644
  • src/oftpd.c

    check for root after processing args so non-root can run --help
    
    a b int main(int argc, char *argv[]) 
    5656        exe_name = argv[0]; 
    5757    } 
    5858 
    59     /* verify we're running as root */ 
    60     if (geteuid() != 0) { 
    61         fprintf(stderr, "%s: program needs root permission to run\n", exe_name); 
    62         exit(1); 
    63     } 
    64  
    6559    /* default command-line arguments */ 
    6660    port = FTP_PORT; 
    6761    user_ptr = NULL; 
    int main(int argc, char *argv[]) 
    187181        exit(1); 
    188182    } 
    189183 
     184    /* verify we're running as root */ 
     185    if (geteuid() != 0) { 
     186        fprintf(stderr, "%s: program needs root permission to run\n", exe_name); 
     187        exit(1); 
     188    } 
     189 
    190190    /* become a daemon */ 
    191191    if (detach) { 
    192192        daemonize(); 
Note: See TracBrowser for help on using the repository browser.