apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1533107 - in /apr/apr/branches/1.5.x: ./ include/ include/arch/unix/ locks/beos/ locks/netware/ locks/os2/ locks/unix/ locks/win32/ shmem/beos/ shmem/os2/ shmem/unix/ shmem/win32/ strings/ threadproc/beos/ threadproc/netware/ threadproc/os...
Date Thu, 17 Oct 2013 15:14:28 GMT
Author: jim
Date: Thu Oct 17 15:14:27 2013
New Revision: 1533107

URL: http://svn.apache.org/r1533107
Log:
revret 1533105

Modified:
    apr/apr/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/include/apr_global_mutex.h
    apr/apr/branches/1.5.x/include/apr_proc_mutex.h
    apr/apr/branches/1.5.x/include/apr_shm.h
    apr/apr/branches/1.5.x/include/apr_thread_proc.h
    apr/apr/branches/1.5.x/include/arch/unix/apr_arch_proc_mutex.h
    apr/apr/branches/1.5.x/include/arch/unix/apr_arch_shm.h
    apr/apr/branches/1.5.x/include/arch/unix/apr_arch_threadproc.h
    apr/apr/branches/1.5.x/locks/beos/proc_mutex.c
    apr/apr/branches/1.5.x/locks/netware/proc_mutex.c
    apr/apr/branches/1.5.x/locks/os2/proc_mutex.c
    apr/apr/branches/1.5.x/locks/unix/global_mutex.c
    apr/apr/branches/1.5.x/locks/unix/proc_mutex.c
    apr/apr/branches/1.5.x/locks/win32/proc_mutex.c
    apr/apr/branches/1.5.x/shmem/beos/shm.c
    apr/apr/branches/1.5.x/shmem/os2/shm.c
    apr/apr/branches/1.5.x/shmem/unix/shm.c
    apr/apr/branches/1.5.x/shmem/win32/shm.c
    apr/apr/branches/1.5.x/strings/apr_cpystrn.c
    apr/apr/branches/1.5.x/threadproc/beos/proc.c
    apr/apr/branches/1.5.x/threadproc/netware/proc.c
    apr/apr/branches/1.5.x/threadproc/os2/proc.c
    apr/apr/branches/1.5.x/threadproc/unix/proc.c
    apr/apr/branches/1.5.x/threadproc/win32/proc.c

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Reverse-merged /apr/apr/trunk:r1533104

Modified: apr/apr/branches/1.5.x/include/apr_global_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_global_mutex.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_global_mutex.h (original)
+++ apr/apr/branches/1.5.x/include/apr_global_mutex.h Thu Oct 17 15:14:27 2013
@@ -135,11 +135,6 @@ APR_DECLARE(const char *) apr_global_mut
 APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex);
 
 /**
- * Set mutex permissions.
- */
-APR_PERMS_SET_IMPLEMENT(global_mutex);
-
-/**
  * Get the pool used by this global_mutex.
  * @return apr_pool_t the pool
  */

Modified: apr/apr/branches/1.5.x/include/apr_proc_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_proc_mutex.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_proc_mutex.h (original)
+++ apr/apr/branches/1.5.x/include/apr_proc_mutex.h Thu Oct 17 15:14:27 2013
@@ -25,7 +25,6 @@
 #include "apr.h"
 #include "apr_pools.h"
 #include "apr_errno.h"
-#include "apr_perms_set.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -153,11 +152,6 @@ APR_DECLARE(const char *) apr_proc_mutex
 APR_DECLARE(const char *) apr_proc_mutex_defname(void);
 
 /**
- * Set mutex permissions.
- */
-APR_PERMS_SET_IMPLEMENT(proc_mutex);
-
-/**
  * Get the pool used by this proc_mutex.
  * @return apr_pool_t the pool
  */

Modified: apr/apr/branches/1.5.x/include/apr_shm.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_shm.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_shm.h (original)
+++ apr/apr/branches/1.5.x/include/apr_shm.h Thu Oct 17 15:14:27 2013
@@ -25,7 +25,6 @@
 #include "apr.h"
 #include "apr_pools.h"
 #include "apr_errno.h"
-#include "apr_perms_set.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -134,11 +133,6 @@ APR_DECLARE(void *) apr_shm_baseaddr_get
 APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m);
 
 /**
- * Set shared memory permissions.
- */
-APR_PERMS_SET_IMPLEMENT(shm);
-
-/**
  * Get the pool used by this shared memory segment.
  */
 APR_POOL_DECLARE_ACCESSOR(shm);

Modified: apr/apr/branches/1.5.x/include/apr_thread_proc.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_thread_proc.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_thread_proc.h (original)
+++ apr/apr/branches/1.5.x/include/apr_thread_proc.h Thu Oct 17 15:14:27 2013
@@ -26,7 +26,6 @@
 #include "apr_file_io.h"
 #include "apr_pools.h"
 #include "apr_errno.h"
-#include "apr_perms_set.h"
 
 #if APR_HAVE_STRUCT_RLIMIT
 #include <sys/time.h>
@@ -578,18 +577,6 @@ APR_DECLARE(apr_status_t) apr_procattr_g
                                                  const char *groupname);
 
 
-/**
- * Register permission set function
- * @param attr The procattr we care about. 
- * @param perms_set_fn Permission set callback
- * @param data Data to pass to permission callback function
- * @param perms Permissions to set
- */
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms);
-
 #if APR_HAS_FORK
 /**
  * This is currently the only non-portable call in APR.  This executes 

Modified: apr/apr/branches/1.5.x/include/arch/unix/apr_arch_proc_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/arch/unix/apr_arch_proc_mutex.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/arch/unix/apr_arch_proc_mutex.h (original)
+++ apr/apr/branches/1.5.x/include/arch/unix/apr_arch_proc_mutex.h Thu Oct 17 15:14:27 2013
@@ -75,7 +75,6 @@ struct apr_proc_mutex_unix_lock_methods_
     apr_status_t (*release)(apr_proc_mutex_t *);
     apr_status_t (*cleanup)(void *);
     apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *);
-    apr_status_t (*perms_set)(apr_proc_mutex_t *, apr_fileperms_t, apr_uid_t, apr_gid_t);
     const char *name;
 };
 typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t;

Modified: apr/apr/branches/1.5.x/include/arch/unix/apr_arch_shm.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/arch/unix/apr_arch_shm.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/arch/unix/apr_arch_shm.h (original)
+++ apr/apr/branches/1.5.x/include/arch/unix/apr_arch_shm.h Thu Oct 17 15:14:27 2013
@@ -67,7 +67,6 @@ struct apr_shm_t {
     const char *filename;      /* NULL if anonymous */
 #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON
     int shmid;          /* shmem ID returned from shmget() */
-    key_t shmkey;       /* shmem key IPC_ANON or returned from ftok() */
 #endif
 };
 

Modified: apr/apr/branches/1.5.x/include/arch/unix/apr_arch_threadproc.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/arch/unix/apr_arch_threadproc.h?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/arch/unix/apr_arch_threadproc.h (original)
+++ apr/apr/branches/1.5.x/include/arch/unix/apr_arch_threadproc.h Thu Oct 17 15:14:27 2013
@@ -19,7 +19,6 @@
 #include "apr_thread_proc.h"
 #include "apr_file_io.h"
 #include "apr_arch_file_io.h"
-#include "apr_perms_set.h"
 
 /* System headers required for thread/process library */
 #if APR_HAVE_PTHREAD_H
@@ -77,14 +76,6 @@ struct apr_thread_once_t {
 
 #endif
 
-typedef struct apr_procattr_pscb_t apr_procattr_pscb_t;
-struct apr_procattr_pscb_t {
-    struct apr_procattr_pscb_t *next;
-    apr_perms_setfn_t *perms_set_fn;
-    apr_fileperms_t perms;
-    const void *data;
-};
-
 struct apr_procattr_t {
     apr_pool_t *pool;
     apr_file_t *parent_in;
@@ -112,7 +103,6 @@ struct apr_procattr_t {
     apr_int32_t errchk;
     apr_uid_t   uid;
     apr_gid_t   gid;
-    apr_procattr_pscb_t *perms_set_callbacks;
 };
 
 #endif  /* ! THREAD_PROC_H */

Modified: apr/apr/branches/1.5.x/locks/beos/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/beos/proc_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/beos/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/beos/proc_mutex.c Thu Oct 17 15:14:27 2013
@@ -140,8 +140,6 @@ APR_DECLARE(const char *) apr_proc_mutex
     return "beossem";
 }
 
-APR_PERMS_SET_ENOTIMPL(proc_mutex)
-
 APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
 
 /* Implement OS-specific accessors defined in apr_portable.h */

Modified: apr/apr/branches/1.5.x/locks/netware/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/netware/proc_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/netware/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/netware/proc_mutex.c Thu Oct 17 15:14:27 2013
@@ -97,8 +97,6 @@ APR_DECLARE(const char *) apr_proc_mutex
     return "netwarethread";
 }
 
-APR_PERMS_SET_ENOTIMPL(proc_mutex)
-
 APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
 
 /* Implement OS-specific accessors defined in apr_portable.h */

Modified: apr/apr/branches/1.5.x/locks/os2/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/os2/proc_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/os2/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/os2/proc_mutex.c Thu Oct 17 15:14:27 2013
@@ -199,7 +199,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex
     return APR_FROM_OS_ERROR(rc);
 }
 
-APR_PERMS_SET_ENOTIMPL(proc_mutex)
+
 
 APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
 

Modified: apr/apr/branches/1.5.x/locks/unix/global_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/unix/global_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/unix/global_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/unix/global_mutex.c Thu Oct 17 15:14:27 2013
@@ -185,13 +185,4 @@ APR_DECLARE(const char *) apr_global_mut
     return apr_proc_mutex_name(mutex->proc_mutex);
 }
 
-APR_PERMS_SET_IMPLEMENT(global_mutex)
-{
-    apr_status_t rv;
-    apr_global_mutex_t *mutex = (apr_global_mutex_t *)theglobal_mutex;
-
-    rv = apr_proc_mutex_set_perms(mutex->proc_mutex, perms, uid, gid);
-    return rv;
-}
-
 APR_POOL_IMPLEMENT_ACCESSOR(global_mutex)

Modified: apr/apr/branches/1.5.x/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/unix/proc_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/unix/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/unix/proc_mutex.c Thu Oct 17 15:14:27 2013
@@ -35,17 +35,6 @@ static apr_status_t proc_mutex_no_child_
 }
 #endif    
 
-#if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_PROC_PTHREAD_SERIALIZE
-static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex,
-                                            apr_fileperms_t perms,
-                                            apr_uid_t uid,
-                                            apr_gid_t gid)
-{
-    return APR_ENOTIMPL;
-}
-#endif    
-
-
 #if APR_HAS_POSIXSEM_SERIALIZE
 
 #ifndef SEM_FAILED
@@ -194,7 +183,6 @@ static const apr_proc_mutex_unix_lock_me
     proc_mutex_posix_release,
     proc_mutex_posix_cleanup,
     proc_mutex_no_child_init,
-    proc_mutex_no_perms_set,
     "posixsem"
 };
 
@@ -303,24 +291,6 @@ static apr_status_t proc_mutex_sysv_rele
     return APR_SUCCESS;
 }
 
-static apr_status_t proc_mutex_sysv_perms_set(apr_proc_mutex_t *mutex,
-                                              apr_fileperms_t perms,
-                                              apr_uid_t uid,
-                                              apr_gid_t gid)
-{
-
-    union semun ick;
-    struct semid_ds buf;
-    buf.sem_perm.uid = uid;
-    buf.sem_perm.gid = gid;
-    buf.sem_perm.mode = apr_unix_perms2mode(perms);
-    ick.buf = &buf;
-    if (semctl(mutex->interproc->filedes, 0, IPC_SET, ick) < 0) {
-        return errno;
-    }
-    return APR_SUCCESS;
-}
-
 static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods =
 {
 #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL)
@@ -334,7 +304,6 @@ static const apr_proc_mutex_unix_lock_me
     proc_mutex_sysv_release,
     proc_mutex_sysv_cleanup,
     proc_mutex_no_child_init,
-    proc_mutex_sysv_perms_set,
     "sysvsem"
 };
 
@@ -530,7 +499,6 @@ static const apr_proc_mutex_unix_lock_me
     proc_mutex_proc_pthread_release,
     proc_mutex_proc_pthread_cleanup,
     proc_mutex_no_child_init,
-    proc_mutex_no_perms_set,
     "pthread"
 };
 
@@ -652,22 +620,6 @@ static apr_status_t proc_mutex_fcntl_rel
     return APR_SUCCESS;
 }
 
-static apr_status_t proc_mutex_fcntl_perms_set(apr_proc_mutex_t *mutex,
-                                               apr_fileperms_t perms,
-                                               apr_uid_t uid,
-                                               apr_gid_t gid)
-{
-
-    if (mutex->fname) {
-        if (!(perms & APR_FPROT_GSETID))
-            gid = -1;
-        if (fchown(mutex->interproc->filedes, uid, gid) < 0) {
-            return errno;
-        }
-    }
-    return APR_SUCCESS;
-}
-
 static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods =
 {
 #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL)
@@ -681,7 +633,6 @@ static const apr_proc_mutex_unix_lock_me
     proc_mutex_fcntl_release,
     proc_mutex_fcntl_cleanup,
     proc_mutex_no_child_init,
-    proc_mutex_fcntl_perms_set,
     "fcntl"
 };
 
@@ -807,22 +758,6 @@ static apr_status_t proc_mutex_flock_chi
     return APR_SUCCESS;
 }
 
-static apr_status_t proc_mutex_flock_perms_set(apr_proc_mutex_t *mutex,
-                                               apr_fileperms_t perms,
-                                               apr_uid_t uid,
-                                               apr_gid_t gid)
-{
-
-    if (mutex->fname) {
-        if (!(perms & APR_FPROT_GSETID))
-            gid = -1;
-        if (fchown(mutex->interproc->filedes, uid, gid) < 0) {
-            return errno;
-        }
-    }
-    return APR_SUCCESS;
-}
-
 static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods =
 {
 #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL)
@@ -836,7 +771,6 @@ static const apr_proc_mutex_unix_lock_me
     proc_mutex_flock_release,
     proc_mutex_flock_cleanup,
     proc_mutex_flock_child_init,
-    proc_mutex_flock_perms_set,
     "flock"
 };
 
@@ -1009,12 +943,6 @@ APR_DECLARE(const char *) apr_proc_mutex
     return NULL;
 }
 
-APR_PERMS_SET_IMPLEMENT(proc_mutex)
-{
-    apr_proc_mutex_t *mutex = (apr_proc_mutex_t *)theproc_mutex;
-    return mutex->meth->perms_set(mutex, perms, uid, gid);
-}
-
 APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
 
 /* Implement OS-specific accessors defined in apr_portable.h */

Modified: apr/apr/branches/1.5.x/locks/win32/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/win32/proc_mutex.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/win32/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/win32/proc_mutex.c Thu Oct 17 15:14:27 2013
@@ -199,8 +199,6 @@ APR_DECLARE(const char *) apr_proc_mutex
     return "win32mutex";
 }
 
-APR_PERMS_SET_ENOTIMPL(proc_mutex)
-
 APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
 
 /* Implement OS-specific accessors defined in apr_portable.h */

Modified: apr/apr/branches/1.5.x/shmem/beos/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/shmem/beos/shm.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/shmem/beos/shm.c (original)
+++ apr/apr/branches/1.5.x/shmem/beos/shm.c Thu Oct 17 15:14:27 2013
@@ -149,8 +149,6 @@ APR_DECLARE(apr_size_t) apr_shm_size_get
     return m->reqsize;
 }
 
-APR_PERMS_SET_ENOTIMPL(shm)
-
 APR_POOL_IMPLEMENT_ACCESSOR(shm)
 
 APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,

Modified: apr/apr/branches/1.5.x/shmem/os2/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/shmem/os2/shm.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/shmem/os2/shm.c (original)
+++ apr/apr/branches/1.5.x/shmem/os2/shm.c Thu Oct 17 15:14:27 2013
@@ -113,8 +113,6 @@ APR_DECLARE(apr_size_t) apr_shm_size_get
     return size;
 }
 
-APR_PERMS_SET_ENOTIMPL(shm)
-
 APR_POOL_IMPLEMENT_ACCESSOR(shm)
 
 APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,

Modified: apr/apr/branches/1.5.x/shmem/unix/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/shmem/unix/shm.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/shmem/unix/shm.c (original)
+++ apr/apr/branches/1.5.x/shmem/unix/shm.c Thu Oct 17 15:14:27 2013
@@ -15,7 +15,6 @@
  */
 
 #include "apr_arch_shm.h"
-#include "apr_arch_file_io.h"
 
 #include "apr_general.h"
 #include "apr_errno.h"
@@ -103,6 +102,7 @@ APR_DECLARE(apr_status_t) apr_shm_create
 #endif
 #if APR_USE_SHMEM_SHMGET
     apr_size_t nbytes;
+    key_t shmkey;
 #endif
 #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \
     APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM
@@ -175,8 +175,8 @@ APR_DECLARE(apr_status_t) apr_shm_create
         new_m->reqsize = reqsize;
         new_m->realsize = reqsize;
         new_m->filename = NULL;
-        new_m->shmkey = IPC_PRIVATE;
-        if ((new_m->shmid = shmget(new_m->shmkey, new_m->realsize,
+
+        if ((new_m->shmid = shmget(IPC_PRIVATE, new_m->realsize,
                                    SHM_R | SHM_W | IPC_CREAT)) < 0) {
             return errno;
         }
@@ -312,13 +312,13 @@ APR_DECLARE(apr_status_t) apr_shm_create
 
         /* ftok() (on solaris at least) requires that the file actually
          * exist before calling ftok(). */
-        new_m->shmkey = ftok(filename, 1);
-        if (new_m->shmkey == (key_t)-1) {
+        shmkey = ftok(filename, 1);
+        if (shmkey == (key_t)-1) {
             apr_file_close(file);
             return errno;
         }
 
-        if ((new_m->shmid = shmget(new_m->shmkey, new_m->realsize,
+        if ((new_m->shmid = shmget(shmkey, new_m->realsize,
                                    SHM_R | SHM_W | IPC_CREAT | IPC_EXCL)) < 0) {
             apr_file_close(file);
             return errno;
@@ -523,6 +523,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach
         apr_status_t status;
         apr_file_t *file;   /* file where metadata is stored */
         apr_size_t nbytes;
+        key_t shmkey;
 
         new_m = apr_palloc(pool, sizeof(apr_shm_t));
 
@@ -545,11 +546,11 @@ APR_DECLARE(apr_status_t) apr_shm_attach
 
         new_m->filename = apr_pstrdup(pool, filename);
         new_m->pool = pool;
-        new_m->shmkey = ftok(filename, 1);
-        if (new_m->shmkey == (key_t)-1) {
+        shmkey = ftok(filename, 1);
+        if (shmkey == (key_t)-1) {
             return errno;
         }
-        if ((new_m->shmid = shmget(new_m->shmkey, 0, SHM_R | SHM_W)) == -1) {
+        if ((new_m->shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1) {
             return errno;
         }
         if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) {
@@ -586,28 +587,6 @@ APR_DECLARE(apr_size_t) apr_shm_size_get
     return m->reqsize;
 }
 
-APR_PERMS_SET_IMPLEMENT(shm)
-{
-#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON
-    struct shmid_ds shmbuf;
-    int shmid;
-    apr_shm_t *m = (apr_shm_t *)theshm;
-
-    if ((shmid = shmget(m->shmkey, 0, SHM_R | SHM_W)) == -1) {
-        return errno;
-    }
-    shmbuf.shm_perm.uid  = uid;
-    shmbuf.shm_perm.gid  = gid;
-    shmbuf.shm_perm.mode = apr_unix_perms2mode(perms);
-    if (shmctl(shmid, IPC_SET, &shmbuf) == -1) {
-        return errno;
-    }
-    return APR_SUCCESS;
-#else
-    return APR_ENOTIMPL;
-#endif
-}
-
 APR_POOL_IMPLEMENT_ACCESSOR(shm)
 
 APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,

Modified: apr/apr/branches/1.5.x/shmem/win32/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/shmem/win32/shm.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/shmem/win32/shm.c (original)
+++ apr/apr/branches/1.5.x/shmem/win32/shm.c Thu Oct 17 15:14:27 2013
@@ -281,8 +281,6 @@ APR_DECLARE(apr_size_t) apr_shm_size_get
     return m->length;
 }
 
-APR_PERMS_SET_ENOTIMPL(shm)
-
 APR_POOL_IMPLEMENT_ACCESSOR(shm)
 
 APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,

Modified: apr/apr/branches/1.5.x/strings/apr_cpystrn.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/strings/apr_cpystrn.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/strings/apr_cpystrn.c (original)
+++ apr/apr/branches/1.5.x/strings/apr_cpystrn.c Thu Oct 17 15:14:27 2013
@@ -38,7 +38,6 @@
  *   (3) Instead of returning the pointer to the beginning of
  *       the destination string, we return a pointer to the
  *       terminating '\0' to allow us to "check" for truncation
- *   (4) If src is NULL, null terminate dst (empty string copy)
  *
  * apr_cpystrn() follows the same call structure as strncpy().
  */
@@ -52,15 +51,13 @@ APR_DECLARE(char *) apr_cpystrn(char *ds
         return (dst);
     }
 
-    if (src) {
-        d = dst;
-        end = dst + dst_size - 1;
-
-        for (; d < end; ++d, ++src) {
-            if (!(*d = *src)) {
-                return (d);
-            }
-        }
+    d = dst;
+    end = dst + dst_size - 1;
+
+    for (; d < end; ++d, ++src) {
+	if (!(*d = *src)) {
+	    return (d);
+	}
     }
 
     *d = '\0';	/* always null terminate */

Modified: apr/apr/branches/1.5.x/threadproc/beos/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/beos/proc.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/threadproc/beos/proc.c (original)
+++ apr/apr/branches/1.5.x/threadproc/beos/proc.c Thu Oct 17 15:14:27 2013
@@ -444,11 +444,3 @@ APR_DECLARE(apr_status_t) apr_procattr_g
 {
     return APR_ENOTIMPL;
 }
-
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms)
-{
-    return APR_ENOTIMPL;
-}

Modified: apr/apr/branches/1.5.x/threadproc/netware/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/netware/proc.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/threadproc/netware/proc.c (original)
+++ apr/apr/branches/1.5.x/threadproc/netware/proc.c Thu Oct 17 15:14:27 2013
@@ -505,11 +505,3 @@ APR_DECLARE(apr_status_t) apr_procattr_g
     /* Always return SUCCESS because NetWare threads don't run within a group */
     return APR_SUCCESS;
 }
-
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms)
-{
-    return APR_ENOTIMPL;
-}

Modified: apr/apr/branches/1.5.x/threadproc/os2/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/os2/proc.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/threadproc/os2/proc.c (original)
+++ apr/apr/branches/1.5.x/threadproc/os2/proc.c Thu Oct 17 15:14:27 2013
@@ -662,11 +662,3 @@ APR_DECLARE(apr_status_t) apr_procattr_g
 {
     return APR_ENOTIMPL;
 }
-
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms)
-{
-    return APR_ENOTIMPL;
-}

Modified: apr/apr/branches/1.5.x/threadproc/unix/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/unix/proc.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/threadproc/unix/proc.c (original)
+++ apr/apr/branches/1.5.x/threadproc/unix/proc.c Thu Oct 17 15:14:27 2013
@@ -461,19 +461,7 @@ APR_DECLARE(apr_status_t) apr_proc_creat
                 _exit(-1);   /* We have big problems, the child should exit. */
             }
         }
-        if (!geteuid()) {
-            apr_procattr_pscb_t *c = attr->perms_set_callbacks;
 
-            while (c) {
-                apr_status_t r;
-                r = (*c->perms_set_fn)((void *)c->data, c->perms,
-                                       attr->uid, attr->gid);
-                if (r != APR_SUCCESS || r != APR_ENOTIMPL) {
-                    _exit(-1);
-                }
-                c = c->next;
-            }
-        }
         /* Only try to switch if we are running as root */
         if (attr->gid != -1 && !geteuid()) {
             if (setgid(attr->gid)) {
@@ -721,20 +709,3 @@ APR_DECLARE(apr_status_t) apr_procattr_l
 }
 #endif /* APR_HAVE_STRUCT_RLIMIT */
 
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms)
-{
-    apr_procattr_pscb_t *c;
-
-    c = apr_palloc(attr->pool, sizeof(apr_procattr_pscb_t));
-    c->data = data;
-    c->perms = perms;
-    c->perms_set_fn = perms_set_fn;
-    c->next = attr->perms_set_callbacks;
-    attr->perms_set_callbacks = c;
-
-    return APR_SUCCESS;
-}
-

Modified: apr/apr/branches/1.5.x/threadproc/win32/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/win32/proc.c?rev=1533107&r1=1533106&r2=1533107&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/threadproc/win32/proc.c (original)
+++ apr/apr/branches/1.5.x/threadproc/win32/proc.c Thu Oct 17 15:14:27 2013
@@ -1147,11 +1147,3 @@ APR_DECLARE(apr_status_t) apr_proc_detac
 {
     return APR_ENOTIMPL;
 }
-
-APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr,
-                                                 apr_perms_setfn_t *perms_set_fn,
-                                                 void *data,
-                                                 apr_fileperms_t perms)
-{
-    return APR_ENOTIMPL;
-}



Mime
View raw message