Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/smbrun.c

    r414 r988  
    1919
    2020#include "includes.h"
     21#include "system/filesys.h"
    2122
    2223/* need to move this from here!! need some sleep ... */
     
    3233        TALLOC_CTX *ctx = talloc_stackframe();
    3334        char *path = NULL;
     35        mode_t mask;
    3436
    3537        path = talloc_asprintf(ctx,
     
    4345
    4446        /* now create the file */
     47        mask = umask(S_IRWXO | S_IRWXG);
    4548        fd = mkstemp(path);
     49        umask(mask);
    4650
    4751        if (fd == -1) {
     
    7074        uid_t uid = current_user.ut.uid;
    7175        gid_t gid = current_user.ut.gid;
     76        void (*saved_handler)(int);
    7277
    7378        /*
     
    9196         */
    9297
    93         CatchChildLeaveStatus();
     98        saved_handler = CatchChildLeaveStatus();
    9499                                       
    95         if ((pid=sys_fork()) < 0) {
     100        if ((pid=fork()) < 0) {
    96101                DEBUG(0,("smbrun: fork failed with error %s\n", strerror(errno) ));
    97                 CatchChild();
     102                (void)CatchSignal(SIGCLD, saved_handler);
    98103                if (outfd) {
    99104                        close(*outfd);
     
    120125                }
    121126
    122                 CatchChild();
     127                (void)CatchSignal(SIGCLD, saved_handler);
    123128
    124129                if (wpid != pid) {
     
    133138                /* Reset the seek pointer. */
    134139                if (outfd) {
    135                         sys_lseek(*outfd, 0, SEEK_SET);
     140                        lseek(*outfd, 0, SEEK_SET);
    136141                }
    137142
     
    145150        }
    146151       
    147         CatchChild();
     152        (void)CatchChild();
    148153       
    149154        /* we are in the child. we exec /bin/sh to do the work for us. we
     
    234239        gid_t gid = current_user.ut.gid;
    235240        int ifd[2];
     241        void (*saved_handler)(int);
    236242       
    237243        /*
     
    254260         */
    255261
    256         CatchChildLeaveStatus();
     262        saved_handler = CatchChildLeaveStatus();
    257263                                       
    258         if ((pid=sys_fork()) < 0) {
     264        if ((pid=fork()) < 0) {
    259265                DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
    260                 CatchChild();
     266                (void)CatchSignal(SIGCLD, saved_handler);
    261267                return errno;
    262268        }
     
    290296                }
    291297
    292                 CatchChild();
     298                (void)CatchSignal(SIGCLD, saved_handler);
    293299
    294300                if (wpid != pid) {
     
    306312        }
    307313       
    308         CatchChild();
     314        (void)CatchChild();
    309315       
    310316        /* we are in the child. we exec /bin/sh to do the work for us. we
Note: See TracChangeset for help on using the changeset viewer.