Changeset 245


Ignore:
Timestamp:
May 31, 2009, 6:01:46 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Made SWAT workable (#51, 54, 55) in 3.2 branch

Location:
branches/samba-3.2.x/source/web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/samba-3.2.x/source/web/cgi.c

    r137 r245  
    315315        }
    316316
     317#ifndef __OS2__
    317318        pwd = getpwnam_alloc(NULL, user);
    318319        if (!pwd) {
     
    329330        }
    330331        TALLOC_FREE(pwd);
     332#endif
    331333}
    332334
  • TabularUnified branches/samba-3.2.x/source/web/startstop.c

    r133 r245  
    1919
    2020#include "includes.h"
     21
     22#ifdef __OS2__
     23        /* fork() in klibc on OS/2 ends all children when parent
     24           is closed, therefore we use spawn() */
     25#include "process.h"
     26#define SWAT_HELPER(WHAT, WHO) \
     27        asprintf(&binfile, "%s/swathelp.cmd", get_dyn_SWATDIR()); \
     28        int rc; \
     29        rc=spawnl(P_NOWAIT, binfile, binfile, #WHAT, #WHO, NULL);
     30#endif
     31
    2132#include "web/swat_proto.h"
    2233#include "dynconfig.h"
     
    3142                 return;
    3243        }
    33 
     44#ifdef __OS2__
     45        /* fork() in klibc on OS/2 ends all children when parent
     46           is closed, therefore we use spawn() */
     47        SWAT_HELPER(start, smbd)       
     48#else                     
    3449        if (fork()) {
    3550                return;
     
    4156        }
    4257        exit(0);
     58#endif
    4359}
    4460
     
    5167                return;
    5268        }
    53 
     69#ifdef __OS2__
     70        /* fork() in klibc on OS/2 ends all children when parent
     71           is closed, therefore we use spawn() */
     72        SWAT_HELPER(start, nmbd)
     73#else   
    5474        if (fork()) {
    5575                return;
     
    6181        }
    6282        exit(0);
     83#endif
    6384}
    6485
     
    7192                return;
    7293        }
    73 
     94#ifdef __OS2__
     95        /* fork() in klibc on OS/2 ends all children when parent
     96           is closed, therefore we use spawn() */
     97        SWAT_HELPER(start, winbindd)
     98#else   
    7499        if (fork()) {
    75100                return;
     
    81106        }
    82107        exit(0);
     108#endif
    83109}
    84110
     
    88114{
    89115        pid_t pid = pidfile_pid("smbd");
    90 
    91116        if (geteuid() != 0) return;
    92117
     118#ifdef __OS2__  /* we do it a bit nicer */
     119        if (smbd_running()) {
     120                char *binfile = NULL;
     121                SWAT_HELPER(stop, smbd)
     122        }
     123#else
    93124        if (pid <= 0) return;
    94125
    95126        kill(pid, SIGTERM);
     127#endif
    96128}
    97 
    98129/* stop nmbd */
    99130void stop_nmbd(void)
    100131{
    101132        pid_t pid = pidfile_pid("nmbd");
    102 
    103133        if (geteuid() != 0) return;
    104134
     135#ifdef __OS2__  /* we do it a bit nicer */
     136        if (nmbd_running()) {
     137                char *binfile = NULL;
     138                SWAT_HELPER(stop, nmbd)
     139        }
     140#else
    105141        if (pid <= 0) return;
    106142
    107143        kill(pid, SIGTERM);
     144#endif
    108145}
     146
    109147#ifdef WITH_WINBIND
    110148/* stop winbindd */
     
    115153        if (geteuid() != 0) return;
    116154
     155#ifdef __OS2__  /* we do it a bit nicer */
     156        if (winbindd_running()) {
     157                char *binfile = NULL;
     158                SWAT_HELPER(stop, winbindd)
     159        }
     160#else
    117161        if (pid <= 0) return;
    118162
    119163        kill(pid, SIGTERM);
     164#endif
    120165}
    121166#endif
Note: See TracChangeset for help on using the changeset viewer.