Changeset 9009 in project


Ignore:
Timestamp:
02/26/08 00:41:56 (12 years ago)
Author:
Kon Lovett
Message:

Added user/group id setting.

Location:
release/3/osprocess
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • release/3/osprocess/tags/1.3/osprocess-common.scm

    r8888 r9009  
    2828             md data
    2929             reapf abexitf forkf waitf exactf
    30              sigmsk
     30             sigmsk curuid effuid curgid effgid
    3131             pid ssec esec
    3232             inp outp errp
     
    4747  (exactf       osp-exact?        #;osp-exact-set!)
    4848  (sigmsk       osp-sigmask       #;osp-sigmask-set!)
     49  (curuid       osp-curuid        #;osp-curuid-set!)
     50  (effuid       osp-effuid        #;osp-effuid-set!)
     51  (curgid       osp-curgid        #;osp-curgid-set!)
     52  (effgid       osp-effgid        #;osp-effgid-set!)
    4953  (pid          osp-pid           osp-pid-set!)
    5054  (ssec         osp-ssec          osp-ssec-set!)
     
    175179
    176180(define-inline (io-buffer-size? obj)
    177   (and (fixnum? obj)
    178        (<= 0 obj)) )
     181  (and (fixnum? obj) (not (negative? obj))) )
    179182
    180183(define-constant DEFAULT-REAPER-PERIOD 10.0)
  • release/3/osprocess/tags/1.3/osprocess-eggdoc.scm

    r8888 r9009  
    5151                        (subsection "Constructors"
    5252
    53                                 (procedure "(make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])"
     53                                (procedure "(make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:current-user-id #f] [#:effective-user-id #f] [#:current-group-id #f] [#:effective-group-id #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])"
    5454                                        (p "Returns an osprocess object.")
    5555
     
    7979                                                (describe #:signal-mask
    8080                                                        "List of signals. The signal-mask for the child process.")
     81                                                (describe #:current-user-id
     82                                                        "The current user id for the child process.")
     83                                                (describe #:effective-user-id
     84                                                        "The current effective user id for the child process.")
     85                                                (describe #:current-group-id
     86                                                        "The current group id for the child process.")
     87                                                (describe #:effective-group-id
     88                                                        "The current effective group id for the child process.")
    8189                                                (describe #:output
    8290                                                        "An output-port for the child process stdout, a pathname, a fileno for redirection, #t for pipe, or #f for shared.")
     
    369377
    370378                (history
    371                   (version "1.3" "Use of misc-extn 3.1 procedures.")
     379                  (version "1.3" "Use of misc-extn 3.1 procedures. Added user/group id setting.")
    372380                        (version "1.2" "Added collect?, search? & exact? option keywords. Added automatic input stream draining. Made osprocess result values order like osprocess-run result")
    373381                        (version "1.1" "Added fileno redirection")
  • release/3/osprocess/tags/1.3/osprocess-support.scm

    r8910 r9009  
    263263  (when (osp-sigmask osp)
    264264    (set-signal-mask! (osp-sigmask osp)) )
     265  (when (osp-curuid osp)
     266    (set! (current-user-id) (osp-curuid osp)) )
     267  (when (osp-effuid osp)
     268    (set! (current-effective-user-id) (osp-effuid osp)) )
     269  (when (osp-curgid osp)
     270    (set! (current-group-id) (osp-curgid osp)) )
     271  (when (osp-effgid osp)
     272    (set! (current-effective-group-id) (osp-effgid osp)) )
    265273  (process-execute (osp-cmd osp) (osp-args osp) (osp-env osp)) )
    266274
     
    336344                  md data
    337345                  reapf abexitf forkf waitf exactf
    338                   sigmsk
     346                  sigmsk curuid effuid curgid effgid
    339347                  inp outp errp
    340348                  inbf outbf errbf
     
    349357            md data
    350358            reapf abexitf forkf waitf exactf
    351             sigmsk
     359            sigmsk curuid effuid curgid effgid
    352360            (void) (void) (void)
    353361            (make-ospp loc inp inbf #t inmod fileno/stdin)
     
    653661
    654662(define (check-signal-mask loc obj)
    655   (unless (and (list? obj)
    656                (every signo? obj))
     663  (unless (and (list? obj) (every signo? obj))
    657664    (error loc "invalid signal-mask" obj)) )
     665
     666(define (check-user-id loc obj)
     667  (unless (and (fixnum? obj) (not (negative? obj)))
     668    (error loc "invalid user/group id" obj)) )
    658669
    659670(define (ensure-buffer-specification loc obj ps inf)
     
    840851                  forkf waitf exactf searchf collf
    841852                  sigmsk
     853                  curuid effuid
     854                  curgid effgid
    842855                  inp outp errp
    843856                  inbf outbf errbf
     
    891904
    892905  (when sigmsk (check-signal-mask loc sigmsk))
     906
     907  (when curuid (check-user-id loc curuid))
     908  (when effuid (check-user-id loc effuid))
     909
     910  (when curgid (check-user-id loc curgid))
     911  (when effgid (check-user-id loc effgid))
    893912
    894913  (check-port-specification loc outp #f)  ;When supplied port must be output
     
    967986            (or (and ptyf 'pty) (and shellf 'shell) 'command) data
    968987            reapf abexitf forkf waitf exactf
    969             sigmsk
     988            sigmsk curuid effuid curgid effgid
    970989            inp outp errp
    971990            inbf outbf errbf
  • release/3/osprocess/tags/1.3/osprocess.html

    r8888 r9009  
    173173<div class="subsection">
    174174<h4>Constructors</h4>
    175 <dt class="definition"><strong>procedure:</strong> (make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])</dt>
     175<dt class="definition"><strong>procedure:</strong> (make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:current-user-id #f] [#:effective-user-id #f] [#:current-group-id #f] [#:effective-group-id #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])</dt>
    176176<dd>
    177177<p>Returns an osprocess object.</p><table class="symbol-table">
     
    212212<td class="symbol">signal-mask:</td>
    213213<td>List of signals. The signal-mask for the child process.</td></tr>
     214<tr>
     215<td class="symbol">current-user-id:</td>
     216<td>The current user id for the child process.</td></tr>
     217<tr>
     218<td class="symbol">effective-user-id:</td>
     219<td>The current effective user id for the child process.</td></tr>
     220<tr>
     221<td class="symbol">current-group-id:</td>
     222<td>The current group id for the child process.</td></tr>
     223<tr>
     224<td class="symbol">effective-group-id:</td>
     225<td>The current effective group id for the child process.</td></tr>
    214226<tr>
    215227<td class="symbol">output:</td>
     
    420432<h3>Version</h3>
    421433<ul>
    422 <li>1.3 Use of misc-extn 3.1 procedures.</li>
     434<li>1.3 Use of misc-extn 3.1 procedures. Added user/group id setting.</li>
    423435<li>1.2 Added collect?, search? &amp; exact? option keywords. Added automatic input stream draining. Made osprocess result values order like osprocess-run result</li>
    424436<li>1.1 Added fileno redirection</li>
  • release/3/osprocess/tags/1.3/osprocess.scm

    r8888 r9009  
    188188      #:abnormal-exit-error?
    189189      #:signal-mask
     190      #:current-user-id #:effective-user-id
     191      #:current-group-id #:effective-group-id
    190192      #:output #:input #:error
    191193      #:output-buffer #:input-buffer #:error-buffer
     
    213215          (abnormal-exit-error? #f)
    214216          (signal-mask #f)
     217          (current-user-id #f) (effective-user-id #f)
     218          (current-group-id #f) (effective-group-id #f)
    215219          (output #t) (input #t) (error #t)
    216220          (output-buffer #f) (input-buffer #f) (error-buffer #f)
     
    223227    fork? wait? exact? search? collect?
    224228    signal-mask
     229    current-user-id effective-user-id
     230    current-group-id effective-group-id
    225231    input output error
    226232    input-buffer output-buffer error-buffer
     
    237243          (abnormal-exit-error? #f)
    238244          (signal-mask #f)
     245          (current-user-id #f) (effective-user-id #f)
     246          (current-group-id #f) (effective-group-id #f)
    239247          (output #t) (input #t) (error #t)
    240248          (output-buffer #f) (input-buffer #f) (error-buffer #f)
     
    254262            fork? wait? exact? search? collect?
    255263            signal-mask
     264            current-user-id effective-user-id
     265            current-group-id effective-group-id
    256266            input output error
    257267            input-buffer output-buffer error-buffer
  • release/3/osprocess/trunk/osprocess-common.scm

    r8888 r9009  
    2828             md data
    2929             reapf abexitf forkf waitf exactf
    30              sigmsk
     30             sigmsk curuid effuid curgid effgid
    3131             pid ssec esec
    3232             inp outp errp
     
    4747  (exactf       osp-exact?        #;osp-exact-set!)
    4848  (sigmsk       osp-sigmask       #;osp-sigmask-set!)
     49  (curuid       osp-curuid        #;osp-curuid-set!)
     50  (effuid       osp-effuid        #;osp-effuid-set!)
     51  (curgid       osp-curgid        #;osp-curgid-set!)
     52  (effgid       osp-effgid        #;osp-effgid-set!)
    4953  (pid          osp-pid           osp-pid-set!)
    5054  (ssec         osp-ssec          osp-ssec-set!)
     
    175179
    176180(define-inline (io-buffer-size? obj)
    177   (and (fixnum? obj)
    178        (<= 0 obj)) )
     181  (and (fixnum? obj) (not (negative? obj))) )
    179182
    180183(define-constant DEFAULT-REAPER-PERIOD 10.0)
  • release/3/osprocess/trunk/osprocess-eggdoc.scm

    r8888 r9009  
    5151                        (subsection "Constructors"
    5252
    53                                 (procedure "(make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])"
     53                                (procedure "(make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:current-user-id #f] [#:effective-user-id #f] [#:current-group-id #f] [#:effective-group-id #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])"
    5454                                        (p "Returns an osprocess object.")
    5555
     
    7979                                                (describe #:signal-mask
    8080                                                        "List of signals. The signal-mask for the child process.")
     81                                                (describe #:current-user-id
     82                                                        "The current user id for the child process.")
     83                                                (describe #:effective-user-id
     84                                                        "The current effective user id for the child process.")
     85                                                (describe #:current-group-id
     86                                                        "The current group id for the child process.")
     87                                                (describe #:effective-group-id
     88                                                        "The current effective group id for the child process.")
    8189                                                (describe #:output
    8290                                                        "An output-port for the child process stdout, a pathname, a fileno for redirection, #t for pipe, or #f for shared.")
     
    369377
    370378                (history
    371                   (version "1.3" "Use of misc-extn 3.1 procedures.")
     379                  (version "1.3" "Use of misc-extn 3.1 procedures. Added user/group id setting.")
    372380                        (version "1.2" "Added collect?, search? & exact? option keywords. Added automatic input stream draining. Made osprocess result values order like osprocess-run result")
    373381                        (version "1.1" "Added fileno redirection")
  • release/3/osprocess/trunk/osprocess-support.scm

    r8910 r9009  
    263263  (when (osp-sigmask osp)
    264264    (set-signal-mask! (osp-sigmask osp)) )
     265  (when (osp-curuid osp)
     266    (set! (current-user-id) (osp-curuid osp)) )
     267  (when (osp-effuid osp)
     268    (set! (current-effective-user-id) (osp-effuid osp)) )
     269  (when (osp-curgid osp)
     270    (set! (current-group-id) (osp-curgid osp)) )
     271  (when (osp-effgid osp)
     272    (set! (current-effective-group-id) (osp-effgid osp)) )
    265273  (process-execute (osp-cmd osp) (osp-args osp) (osp-env osp)) )
    266274
     
    336344                  md data
    337345                  reapf abexitf forkf waitf exactf
    338                   sigmsk
     346                  sigmsk curuid effuid curgid effgid
    339347                  inp outp errp
    340348                  inbf outbf errbf
     
    349357            md data
    350358            reapf abexitf forkf waitf exactf
    351             sigmsk
     359            sigmsk curuid effuid curgid effgid
    352360            (void) (void) (void)
    353361            (make-ospp loc inp inbf #t inmod fileno/stdin)
     
    653661
    654662(define (check-signal-mask loc obj)
    655   (unless (and (list? obj)
    656                (every signo? obj))
     663  (unless (and (list? obj) (every signo? obj))
    657664    (error loc "invalid signal-mask" obj)) )
     665
     666(define (check-user-id loc obj)
     667  (unless (and (fixnum? obj) (not (negative? obj)))
     668    (error loc "invalid user/group id" obj)) )
    658669
    659670(define (ensure-buffer-specification loc obj ps inf)
     
    840851                  forkf waitf exactf searchf collf
    841852                  sigmsk
     853                  curuid effuid
     854                  curgid effgid
    842855                  inp outp errp
    843856                  inbf outbf errbf
     
    891904
    892905  (when sigmsk (check-signal-mask loc sigmsk))
     906
     907  (when curuid (check-user-id loc curuid))
     908  (when effuid (check-user-id loc effuid))
     909
     910  (when curgid (check-user-id loc curgid))
     911  (when effgid (check-user-id loc effgid))
    893912
    894913  (check-port-specification loc outp #f)  ;When supplied port must be output
     
    967986            (or (and ptyf 'pty) (and shellf 'shell) 'command) data
    968987            reapf abexitf forkf waitf exactf
    969             sigmsk
     988            sigmsk curuid effuid curgid effgid
    970989            inp outp errp
    971990            inbf outbf errbf
  • release/3/osprocess/trunk/osprocess.html

    r8888 r9009  
    173173<div class="subsection">
    174174<h4>Constructors</h4>
    175 <dt class="definition"><strong>procedure:</strong> (make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])</dt>
     175<dt class="definition"><strong>procedure:</strong> (make-osprocess COMMAND [#:shell? #f] [#:pseudo-tty? #f] [#:reap? #t] [#:fork? #t] [#:wait? #f] [#:exact? #f] [#:search? #f] [#:collect? #f] [#:abnormal-exit-error? #f] [#:signal-mask #f] [#:current-user-id #f] [#:effective-user-id #f] [#:current-group-id #f] [#:effective-group-id #f] [#:output #t] [#:input #t] [#:error #t] [#:output-buffer #f] [#:input-buffer #f] [#:error-buffer #f] [#:output-mode #f] [#:input-mode #f] [#:error-mode #f] [#:arguments #f] [#:environment #f] [ARGUMENT ...])</dt>
    176176<dd>
    177177<p>Returns an osprocess object.</p><table class="symbol-table">
     
    212212<td class="symbol">signal-mask:</td>
    213213<td>List of signals. The signal-mask for the child process.</td></tr>
     214<tr>
     215<td class="symbol">current-user-id:</td>
     216<td>The current user id for the child process.</td></tr>
     217<tr>
     218<td class="symbol">effective-user-id:</td>
     219<td>The current effective user id for the child process.</td></tr>
     220<tr>
     221<td class="symbol">current-group-id:</td>
     222<td>The current group id for the child process.</td></tr>
     223<tr>
     224<td class="symbol">effective-group-id:</td>
     225<td>The current effective group id for the child process.</td></tr>
    214226<tr>
    215227<td class="symbol">output:</td>
     
    420432<h3>Version</h3>
    421433<ul>
    422 <li>1.3 Use of misc-extn 3.1 procedures.</li>
     434<li>1.3 Use of misc-extn 3.1 procedures. Added user/group id setting.</li>
    423435<li>1.2 Added collect?, search? &amp; exact? option keywords. Added automatic input stream draining. Made osprocess result values order like osprocess-run result</li>
    424436<li>1.1 Added fileno redirection</li>
  • release/3/osprocess/trunk/osprocess.scm

    r8888 r9009  
    188188      #:abnormal-exit-error?
    189189      #:signal-mask
     190      #:current-user-id #:effective-user-id
     191      #:current-group-id #:effective-group-id
    190192      #:output #:input #:error
    191193      #:output-buffer #:input-buffer #:error-buffer
     
    213215          (abnormal-exit-error? #f)
    214216          (signal-mask #f)
     217          (current-user-id #f) (effective-user-id #f)
     218          (current-group-id #f) (effective-group-id #f)
    215219          (output #t) (input #t) (error #t)
    216220          (output-buffer #f) (input-buffer #f) (error-buffer #f)
     
    223227    fork? wait? exact? search? collect?
    224228    signal-mask
     229    current-user-id effective-user-id
     230    current-group-id effective-group-id
    225231    input output error
    226232    input-buffer output-buffer error-buffer
     
    237243          (abnormal-exit-error? #f)
    238244          (signal-mask #f)
     245          (current-user-id #f) (effective-user-id #f)
     246          (current-group-id #f) (effective-group-id #f)
    239247          (output #t) (input #t) (error #t)
    240248          (output-buffer #f) (input-buffer #f) (error-buffer #f)
     
    254262            fork? wait? exact? search? collect?
    255263            signal-mask
     264            current-user-id effective-user-id
     265            current-group-id effective-group-id
    256266            input output error
    257267            input-buffer output-buffer error-buffer
Note: See TracChangeset for help on using the changeset viewer.