The branch, master has been updated
       via  c026252 tests: Use alpha-specific syscalls.
       via  cf2b353 uwrap: Use alpha-specific syscalls.
       via  a00a6b8 uwrap: Attempt to dlopen libc.so.*.1 as a fallback.
      from  2bd91fc Bump version to 1.2.1

https://git.samba.org/?p=uid_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c026252807478862e9d718b00b6ae4493a84b976
Author: Matt Turner <[email protected]>
Date:   Tue Apr 5 13:28:56 2016 -0700

    tests: Use alpha-specific syscalls.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
    
    Signed-off-by: Matt Turner <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit cf2b35344d4de927f158a1e6d5b6bbc1be2ffd96
Author: Matt Turner <[email protected]>
Date:   Tue Apr 5 13:28:30 2016 -0700

    uwrap: Use alpha-specific syscalls.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
    
    Signed-off-by: Matt Turner <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit a00a6b8b300b7baa867191e2bc016b835cf8d1b3
Author: Matt Turner <[email protected]>
Date:   Tue Apr 5 13:41:13 2016 -0700

    uwrap: Attempt to dlopen libc.so.*.1 as a fallback.
    
    glibc on Alpha and IA64 is libc.so.6.1.
    
    Without this, uwrap.libc.handle is set to RTLD_NEXT, leading to a
    segmentation fault in the unit tests when dlclose() is called.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
    
    Signed-off-by: Matt Turner <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 src/uid_wrapper.c           | 15 +++++++++++++++
 tests/test_syscall.c        |  4 ++++
 tests/test_syscall_gid.c    |  4 ++++
 tests/test_syscall_setuid.c |  4 ++++
 4 files changed, 27 insertions(+)


Changeset truncated at 500 lines:

diff --git a/src/uid_wrapper.c b/src/uid_wrapper.c
index 743d590..ded857a 100644
--- a/src/uid_wrapper.c
+++ b/src/uid_wrapper.c
@@ -407,6 +407,13 @@ static void *uwrap_load_lib_handle(enum uwrap_lib lib)
                                if (handle != NULL) {
                                        break;
                                }
+
+                               /* glibc on Alpha and IA64 is libc.so.6.1 */
+                               snprintf(soname, sizeof(soname), 
"libc.so.%d.1", i);
+                               handle = dlopen(soname, flags);
+                               if (handle != NULL) {
+                                       break;
+                               }
                        }
 
                        uwrap.libc.handle = handle;
@@ -1894,7 +1901,11 @@ static long int uwrap_syscall (long int sysno, va_list 
vp)
 
        switch (sysno) {
                /* gid */
+#ifdef __alpha__
+               case SYS_getxgid:
+#else
                case SYS_getgid:
+#endif
 #ifdef HAVE_LINUX_32BIT_SYSCALLS
                case SYS_getgid32:
 #endif
@@ -1963,7 +1974,11 @@ static long int uwrap_syscall (long int sysno, va_list 
vp)
 #endif /* SYS_getresgid && HAVE_GETRESGID */
 
                /* uid */
+#ifdef __alpha__
+               case SYS_getxuid:
+#else
                case SYS_getuid:
+#endif
 #ifdef HAVE_LINUX_32BIT_SYSCALLS
                case SYS_getuid32:
 #endif
diff --git a/tests/test_syscall.c b/tests/test_syscall.c
index c43f1f9..912686f 100644
--- a/tests/test_syscall.c
+++ b/tests/test_syscall.c
@@ -26,7 +26,11 @@ static void test_uwrap_syscall(void **state)
 
        (void) state; /* unused */
 
+#ifdef __alpha__
+       rc = syscall(SYS_getxpid);
+#else
        rc = syscall(SYS_getpid);
+#endif
        assert_int_equal(rc, getpid());
 
        ZERO_STRUCT(tv1);
diff --git a/tests/test_syscall_gid.c b/tests/test_syscall_gid.c
index 3ccdd4a..5664dc2 100644
--- a/tests/test_syscall_gid.c
+++ b/tests/test_syscall_gid.c
@@ -33,7 +33,11 @@ static void test_uwrap_syscall_setgid(void **state)
 
        g = getgid();
        assert_int_equal(g, 1);
+#ifdef __alpha__
+       assert_int_equal(g, syscall(SYS_getxgid));
+#else
        assert_int_equal(g, syscall(SYS_getgid));
+#endif
 }
 
 static void test_uwrap_syscall_setregid(void **state)
diff --git a/tests/test_syscall_setuid.c b/tests/test_syscall_setuid.c
index fbe9200..d237e27 100644
--- a/tests/test_syscall_setuid.c
+++ b/tests/test_syscall_setuid.c
@@ -69,7 +69,11 @@ static void test_uwrap_syscall_setuid(void **state)
 
        u = getuid();
        assert_int_equal(u, 5555);
+#ifdef __alpha
+       assert_int_equal(u, syscall(SYS_getxuid));
+#else
        assert_int_equal(u, syscall(SYS_getuid));
+#endif
 
        rc = syscall(SYS_setuid, 0);
        assert_int_equal(rc, -1);


-- 
UID Wrapper Repository

Reply via email to