The Samba-Bugzilla – Attachment 5751 Details for
Bug 7476
configure fails when checking for 'designated initializers' on NSK
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
samba-3.5.3-bug7476.diff (text/plain), 47.44 KB, created by
Joachim Schmitz (mail address dead)
on 2010-05-31 12:14:01 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joachim Schmitz (mail address dead)
Created:
2010-05-31 12:14:01 UTC
Size:
47.44 KB
patch
obsolete
>diff -u ./README_FLOSS.orig ./README_FLOSS >--- ./README_FLOSS.orig 2009-12-11 07:50:49.000000000 -0600 >+++ ./README_FLOSS 2010-05-27 07:43:37.000000000 -0500 >@@ -0,0 +1,79 @@ >+THIS SOFTWARE IS PROVIDED "AS-IS", WITHOUT WARRANTY OF ANY KIND, >+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN >+NO EVENT SHALL THE HEWLETT PACKARD COMPANY OR ITS SUBSIDIARIES BE >+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION >+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION >+WITH THE SOFTWARE INCURRED BY YOU OR ANY THIRD PARTY IN CONNECTION WITH >+THE USE OF THIS SOFTWARE. >+ >+Please post questions and comments to the "news:comp.sys.tandem" newsgroup. >+ >+This and other packages may be downloaded from "http://ituglib.connect-community.org". >+ >+This package is built for IEEE floating point format. >+ >+This package was built for NSK H06.19/J06.08 or later. >+ >+To compile it uses the sed, python, zlib and libiconv packages, >+probably some more are needed?? >+ >+Configuration information follows: >+ >+- Make sure the system's hostname is setup. The command "hostname" is in the >+ "sh-utils" or "coreutils" package. >+ >+ > hostname >+ nsk2.txn.cpqcorp.net >+ >+- Make sure /etc/services contains: >+ >+ netbios-ssn 139/tcp >+ netbios-ns 137/udp >+ >+- Make sure /etc/inetd.conf contains: >+ >+ netbios-ssn stream tcp nowait super.super /usr/local/samba3/sbin/smbd smbd >+ netbios-ns dgram udp wait super.super /usr/local/samba3/sbin/nmbd nmbd >+ >+- Create directories if necessary and set permissions: >+ >+ > mkdir -p /usr/local/samba3/private /usr/local/samba3/var/locks >+ > chmod 755 /usr/local/samba3/private /usr/local/samba3/var/locks >+ >+- Create and set permissions on /usr/local/samba3/lib/smb.conf. For example: >+ >+ interfaces = 16.74.34.241/255.255.252.0 >+ encrypt passwords = yes >+ >+ [tmp] >+ path = /tmp >+ >+ [homes] >+ read only = no >+ >+ > chmod 644 /usr/local/samba3/lib/smb.conf >+ >+- As super.super, create the samba password file: >+ >+ > touch /usr/local/samba3/private/smbpasswd >+ > chmod 644 /usr/local/samba3/private/smbpasswd >+ >+- As super.super, add users to the samba password file: >+ >+ > smbpasswd -L -a tbates >+ >+- As super.super, add group "floss", user "floss.nobody", and alias >+ "nobody" to the system. >+ >+ > gtacl -p safecom >+ =add user floss.nobody, 42,13 >+ =add alias nobody, floss.nobody >+ =freeze user floss.nobody >+ =freeze alias nobody >+ =exit >+ >+- As super.super, start inted: >+ >+ > /usr/ucb/inetd >+ >diff -u ./lib/async_req/async_sock.c.orig ./lib/async_req/async_sock.c >--- ./lib/async_req/async_sock.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/async_req/async_sock.c 2010-05-28 07:55:53.000000000 -0500 >@@ -21,6 +21,9 @@ > along with this program. If not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > #include "system/network.h" > #include "system/filesys.h" >diff -u ./lib/popt/findme.c.orig ./lib/popt/findme.c >--- ./lib/popt/findme.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/popt/findme.c 2010-05-27 07:56:51.000000000 -0500 >@@ -7,6 +7,10 @@ > ftp://ftp.rpm.org/pub/rpm/dist. */ > > #include "system.h" >+#ifdef __TANDEM >+#include <floss.h> >+#pragma function alloca (alias("floss_alloca"), unspecified) /* experimental */ >+#endif > #include "findme.h" > > const char * findProgramPath(const char * argv0) { >diff -u ./lib/popt/popt.c.orig ./lib/popt/popt.c >--- ./lib/popt/popt.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/popt/popt.c 2010-05-27 07:57:28.000000000 -0500 >@@ -9,6 +9,10 @@ > #undef MYDEBUG > > #include "system.h" >+#ifdef __TANDEM >+#include <floss.h> >+#pragma function alloca (alias("floss_alloca"), unspecified) /* experimental */ >+#endif > > #if HAVE_FLOAT_H > #include <float.h> >diff -u ./lib/popt/poptconfig.c.orig ./lib/popt/poptconfig.c >--- ./lib/popt/poptconfig.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/popt/poptconfig.c 2010-05-27 07:59:47.000000000 -0500 >@@ -7,6 +7,10 @@ > ftp://ftp.rpm.org/pub/rpm/dist. */ > > #include "system.h" >+#ifdef __TANDEM >+#include <floss.h> >+#pragma function alloca (alias("floss_alloca"), unspecified) /* experimental */ >+#endif > #include "poptint.h" > > /*@-compmempass@*/ /* FIX: item->option.longName kept, not dependent. */ >diff -u ./lib/popt/popthelp.c.orig ./lib/popt/popthelp.c >--- ./lib/popt/popthelp.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/popt/popthelp.c 2010-05-27 08:01:10.000000000 -0500 >@@ -10,6 +10,10 @@ > ftp://ftp.rpm.org/pub/rpm/dist. */ > > #include "system.h" >+#ifdef __TANDEM >+#include <floss.h> >+#pragma function alloca (alias("floss_alloca"), unspecified) /* experimental */ >+#endif > #include "poptint.h" > > /** >diff -u ./lib/popt/poptparse.c.orig ./lib/popt/poptparse.c >--- ./lib/popt/poptparse.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/popt/poptparse.c 2010-05-27 08:02:26.000000000 -0500 >@@ -7,6 +7,10 @@ > ftp://ftp.rpm.org/pub/rpm/dist. */ > > #include "system.h" >+#ifdef __TANDEM >+#include <floss.h> >+#pragma function alloca (alias("floss_alloca"), unspecified) /* experimental */ >+#endif > > #define POPT_ARGV_ARRAY_GROW_DELTA 5 > >diff -u ./lib/replace/replace.c.orig ./lib/replace/replace.c >--- ./lib/replace/replace.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/replace/replace.c 2010-05-26 08:15:31.000000000 -0500 >@@ -22,6 +22,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > > #include "system/filesys.h" >diff -u ./lib/replace/replace.h.orig ./lib/replace/replace.h >--- ./lib/replace/replace.h.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/replace/replace.h 2010-05-27 08:04:06.000000000 -0500 >@@ -540,8 +540,10 @@ > #endif > > #if !defined(HAVE_INTPTR_T) >+#ifndef __TANDEM /* ??? TODO? */ > typedef long long intptr_t ; > #endif >+#endif > > #if !defined(HAVE_UINTPTR_T) > typedef unsigned long long uintptr_t ; >diff -u ./lib/replace/system/filesys.h.orig ./lib/replace/system/filesys.h >--- ./lib/replace/system/filesys.h.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/replace/system/filesys.h 2010-05-27 07:07:01.000000000 -0500 >@@ -77,7 +77,9 @@ > #include <sys/filio.h> > #endif > >+#ifdef HAVE_SYS_FILE_H > #include <sys/file.h> >+#endif > > #ifdef HAVE_FCNTL_H > #include <fcntl.h> >diff -u ./lib/tdb/common/lock.c.orig ./lib/tdb/common/lock.c >--- ./lib/tdb/common/lock.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tdb/common/lock.c 2010-05-26 08:17:22.000000000 -0500 >@@ -25,6 +25,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "tdb_private.h" > > #define TDB_MARK_LOCK 0x80000000 >diff -u ./lib/tdb/common/open.c.orig ./lib/tdb/common/open.c >--- ./lib/tdb/common/open.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tdb/common/open.c 2010-05-26 08:18:02.000000000 -0500 >@@ -25,6 +25,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "tdb_private.h" > > /* all contexts, to ensure no double-opens (fcntl locks don't nest!) */ >diff -u ./lib/tdb/common/transaction.c.orig ./lib/tdb/common/transaction.c >--- ./lib/tdb/common/transaction.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tdb/common/transaction.c 2010-05-26 08:18:43.000000000 -0500 >@@ -23,6 +23,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "tdb_private.h" > > /* >diff -u ./lib/tevent/tevent_select.c.orig ./lib/tevent/tevent_select.c >--- ./lib/tevent/tevent_select.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tevent/tevent_select.c 2010-05-26 08:19:29.000000000 -0500 >@@ -22,6 +22,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > #include "system/filesys.h" > #include "system/select.h" >diff -u ./lib/tevent/tevent_signal.c.orig ./lib/tevent/tevent_signal.c >--- ./lib/tevent/tevent_signal.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tevent/tevent_signal.c 2010-05-30 13:19:38.000000000 -0500 >@@ -23,6 +23,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > #include "system/filesys.h" > #include "system/wait.h" >@@ -355,16 +358,22 @@ > (void*)&sig_state->sig_info[i][ofs], > se->private_data); > } >+/* defined in replace/system/wait.h it SA_RESETHAND is not defined */ >+# ifdef SA_ONESHOT > if (se->sa_flags & SA_RESETHAND) { > talloc_free(se); > } >+# endif > continue; > } > #endif > se->handler(ev, se, i, count, NULL, se->private_data); >+/* defined in replace/system/wait.h it SA_RESETHAND is not defined */ >+#ifdef SA_ONESHOT > if (se->sa_flags & SA_RESETHAND) { > talloc_free(se); > } >+#endif > } > > #ifdef SA_SIGINFO >diff -u ./lib/tevent/tevent_standard.c.orig ./lib/tevent/tevent_standard.c >--- ./lib/tevent/tevent_standard.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tevent/tevent_standard.c 2010-05-26 08:36:03.000000000 -0500 >@@ -31,6 +31,9 @@ > at runtime we fallback to select() > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > #include "system/filesys.h" > #include "system/select.h" >diff -u ./lib/tsocket/tsocket_bsd.c.orig ./lib/tsocket/tsocket_bsd.c >--- ./lib/tsocket/tsocket_bsd.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/tsocket/tsocket_bsd.c 2010-05-28 08:10:19.000000000 -0500 >@@ -21,6 +21,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "replace.h" > #include "system/filesys.h" > #include "system/network.h" >diff -u ./lib/util/tevent_unix.c.orig ./lib/util/tevent_unix.c >--- ./lib/util/tevent_unix.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./lib/util/tevent_unix.c 2010-05-27 05:14:34.000000000 -0500 >@@ -21,8 +21,8 @@ > along with this program. If not, see <http://www.gnu.org/licenses/>. > */ > >-#include "tevent_unix.h" > #include "../replace/replace.h" >+#include "tevent_unix.h" > > bool tevent_req_is_unix_error(struct tevent_req *req, int *perrno) > { >diff -u ./nsswitch/libwbclient/wbc_async.c.orig ./nsswitch/libwbclient/wbc_async.c >--- ./nsswitch/libwbclient/wbc_async.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./nsswitch/libwbclient/wbc_async.c 2010-05-28 07:54:29.000000000 -0500 >@@ -21,6 +21,7 @@ > along with this program. If not, see <http://www.gnu.org/licenses/>. > */ > >+#include "includes.h" > #include "replace.h" > #include "system/filesys.h" > #include "system/network.h" >@@ -252,7 +253,7 @@ > } > > if (!S_ISDIR(st.st_mode) || >- (st.st_uid != 0 && st.st_uid != geteuid())) { >+ (st.st_uid != SUPERUSER && st.st_uid != geteuid())) { > wbc_err = WBC_ERR_WINBIND_NOT_AVAILABLE; > goto post_status; > } >@@ -275,7 +276,7 @@ > > if ((lstat(sunaddr.sun_path, &st) == -1) > || !S_ISSOCK(st.st_mode) >- || (st.st_uid != 0 && st.st_uid != geteuid())) { >+ || (st.st_uid != SUPERUSER && st.st_uid != geteuid())) { > wbc_err = WBC_ERR_WINBIND_NOT_AVAILABLE; > goto post_status; > } >diff -u ./nsswitch/wb_common.c.orig ./nsswitch/wb_common.c >--- ./nsswitch/wb_common.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./nsswitch/wb_common.c 2010-05-26 08:37:55.000000000 -0500 >@@ -22,6 +22,7 @@ > along with this program. If not, see <http://www.gnu.org/licenses/>. > */ > >+#include "includes.h" > #include "winbind_client.h" > > /* Global variables. These are effectively the client state information */ >@@ -181,7 +182,7 @@ > } > > if (!S_ISDIR(st.st_mode) || >- (st.st_uid != 0 && st.st_uid != geteuid())) { >+ (st.st_uid != SUPERUSER && st.st_uid != geteuid())) { > errno = ENOENT; > return -1; > } >@@ -210,7 +211,7 @@ > /* Check permissions on unix socket file */ > > if (!S_ISSOCK(st.st_mode) || >- (st.st_uid != 0 && st.st_uid != geteuid())) { >+ (st.st_uid != SUPERUSER && st.st_uid != geteuid())) { > errno = ENOENT; > return -1; > } >diff -u ./source3/auth/pass_check.c.orig ./source3/auth/pass_check.c >--- ./source3/auth/pass_check.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/auth/pass_check.c 2010-05-26 08:39:30.000000000 -0500 >@@ -389,8 +389,8 @@ > goto err; > } > >- set_effective_uid(0); >- set_effective_gid(0); >+ set_effective_uid(SUPERUSER); >+ set_effective_gid(SUPERGROUP); > > t = localtime(&expire_time); > if (t) { >@@ -406,7 +406,7 @@ > err: > > /* Go back to root, JRA. */ >- set_effective_uid(0); >+ set_effective_uid(SUPERUSER); > set_effective_gid(egid); > return (False); > } >diff -u ./source3/client/client.c.orig ./source3/client/client.c >--- ./source3/client/client.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/client/client.c 2010-05-26 08:41:43.000000000 -0500 >@@ -3185,10 +3185,16 @@ > > /* Print out the stat values. */ > d_printf("File: %s\n", src); >+#ifdef HAVE_STAT_ST_BLOCKS > d_printf("Size: %-12.0f\tBlocks: %u\t%s\n", > (double)sbuf.st_ex_size, > (unsigned int)sbuf.st_ex_blocks, > filetype_to_str(sbuf.st_ex_mode)); >+#else >+ d_printf("Size: %-12.0f\t%s\n", >+ (double)sbuf.st_ex_size, >+ filetype_to_str(sbuf.st_ex_mode)); >+#endif > > #if defined(S_ISCHR) && defined(S_ISBLK) > if (S_ISCHR(sbuf.st_ex_mode) || S_ISBLK(sbuf.st_ex_mode)) { >diff -u ./source3/client/smbspool.c.orig ./source3/client/smbspool.c >--- ./source3/client/smbspool.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/client/smbspool.c 2010-05-26 08:46:16.000000000 -0500 >@@ -517,7 +517,11 @@ > } > > /* give a chance for a passwordless NTLMSSP session setup */ >+#ifdef __TANDEM >+ pwd = getpwnam(getlogin()); >+#else > pwd = getpwuid(geteuid()); >+#endif > if (pwd == NULL) { > return NULL; > } >diff -u ./source3/config.sub.orig ./source3/config.sub >--- ./source3/config.sub.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/config.sub 2010-05-26 06:41:54.000000000 -0500 >@@ -823,6 +823,9 @@ > np1) > basic_machine=np1-gould > ;; >+ nse-tandem) >+ basic_machine=nse-tandem >+ ;; > nsr-tandem) > basic_machine=nsr-tandem > ;; >diff -u ./source3/configure.orig ./source3/configure >--- ./source3/configure.orig 2010-05-17 06:53:13.000000000 -0500 >+++ ./source3/configure 2010-05-26 07:58:34.000000000 -0500 >@@ -5878,6 +5878,58 @@ > > rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext > fi >+# NonStop, try c89's option -Wc99lite, should do for designated initializers >+if test x"$c99_init" = x"no"; then >+ { $as_echo "$as_me:$LINENO: checking for C99 designated initializers with -Wc99lite" >&5 >+$as_echo_n "checking for C99 designated initializers with -Wc99lite... " >&6; } >+ CFLAGS="$saved_CFLAGS -Wc99lite" >+ cat >conftest.$ac_ext <<_ACEOF >+/* confdefs.h. */ >+_ACEOF >+cat confdefs.h >>conftest.$ac_ext >+cat >>conftest.$ac_ext <<_ACEOF >+/* end confdefs.h. */ >+#include <stdio.h> >+int >+main () >+{ >+ struct foo {int x;char y;}; >+ struct foo bar = { .y = 'X', .x = 1 }; >+ >+ ; >+ return 0; >+} >+_ACEOF >+rm -f conftest.$ac_objext >+if { (ac_try="$ac_compile" >+case "(($ac_try" in >+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; >+ *) ac_try_echo=$ac_try;; >+esac >+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" >+$as_echo "$ac_try_echo") >&5 >+ (eval "$ac_compile") 2>conftest.er1 >+ ac_status=$? >+ grep -v '^ *+' conftest.er1 >conftest.err >+ rm -f conftest.er1 >+ cat conftest.err >&5 >+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 >+ (exit $ac_status); } && { >+ test -z "$ac_c_werror_flag" || >+ test ! -s conftest.err >+ } && test -s conftest.$ac_objext; then >+ { $as_echo "$as_me:$LINENO: result: yes" >&5 >+$as_echo "yes" >&6; }; c99_init=yes >+else >+ $as_echo "$as_me: failed program was:" >&5 >+sed 's/^/| /' conftest.$ac_ext >&5 >+ >+ { $as_echo "$as_me:$LINENO: result: no" >&5 >+$as_echo "no" >&6; } >+fi >+ >+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext >+fi > > if test "`uname`" = "HP-UX"; then > if test "$ac_cv_c_compiler_gnu" = no; then >diff -u ./source3/include/includes.h.orig ./source3/include/includes.h >--- ./source3/include/includes.h.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/include/includes.h 2010-05-28 03:46:26.000000000 -0500 >@@ -48,6 +48,16 @@ > > #include "local.h" > >+#ifdef __TANDEM >+#include <floss.h> >+#include <assert.h> >+#define SUPERUSER 65535 >+#define SUPERGROUP 255 >+#else >+#define SUPERUSER 0 >+#define SUPERGROUP 0 >+#endif >+ > #ifdef AIX > #define DEFAULT_PRINTING PRINT_AIX > #define PRINTCAP_NAME "/etc/qconfig" >@@ -440,6 +450,13 @@ > typedef long blkcnt_t; > #endif > >+#ifndef HAVE_STRUCT_TIMESPEC >+struct timespec { >+ time_t tv_sec; /* Seconds. */ >+ long tv_nsec; /* Nanoseconds. */ >+}; >+#endif >+ > /* > * Type for stat structure. > */ >@@ -459,8 +476,12 @@ > struct timespec st_ex_btime; /* birthtime */ > /* Is birthtime real, or was it calculated ? */ > bool st_ex_calculated_birthtime; >+#ifdef HAVE_ST_BLKSIZE > blksize_t st_ex_blksize; >+#endif >+#ifdef HAVE_ST_BLOCKS > blkcnt_t st_ex_blocks; >+#endif > > uint32_t st_ex_flags; > uint32_t st_ex_mask; >@@ -552,13 +573,6 @@ > # endif > #endif > >-#ifndef HAVE_STRUCT_TIMESPEC >-struct timespec { >- time_t tv_sec; /* Seconds. */ >- long tv_nsec; /* Nanoseconds. */ >-}; >-#endif >- > enum timestamp_set_resolution { > TIMESTAMP_SET_SECONDS = 0, > TIMESTAMP_SET_MSEC, >diff -u ./source3/include/smb.h.orig ./source3/include/smb.h >--- ./source3/include/smb.h.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/include/smb.h 2010-05-26 06:21:13.000000000 -0500 >@@ -434,6 +434,10 @@ > bool write_time_forced; > > int oplock_type; >+#ifdef __TANDEM /* for EDIT/101 file support */ >+ bool _101_file; >+ char _101_filename[FILENAME_MAX]; >+#endif > int sent_oplock_break; > struct timed_event *oplock_timeout; > struct lock_struct last_lock_failure; >diff -u ./source3/lib/afs_settoken.c.orig ./source3/lib/afs_settoken.c >--- ./source3/lib/afs_settoken.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/afs_settoken.c 2010-05-26 06:21:48.000000000 -0500 >@@ -236,7 +236,7 @@ > if (!afs_decode_token(token_string, &cell, &ticket, &ct)) > return False; > >- if (geteuid() != 0) >+ if (geteuid() != SUPERUSER) > ct.ViceId = getuid(); > > result = afs_settoken(cell, &ct, ticket); >diff -u ./source3/lib/debug.c.orig ./source3/lib/debug.c >--- ./source3/lib/debug.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/debug.c 2010-05-26 06:22:26.000000000 -0500 >@@ -738,7 +738,7 @@ > * loop check do a new check as root. > */ > >- if( geteuid() != 0 ) >+ if( geteuid() != SUPERUSER ) > return; > > if(log_overflow || !need_to_check_log_size() ) >diff -u ./source3/lib/fault.c.orig ./source3/lib/fault.c >--- ./source3/lib/fault.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/fault.c 2010-05-26 06:23:07.000000000 -0500 >@@ -304,7 +304,7 @@ > /* If we're running as non root we might not be able to dump the core > * file to the corepath. There must not be an unbecome_root() before > * we call abort(). */ >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > become_root(); > } > >diff -u ./source3/lib/messages_local.c.orig ./source3/lib/messages_local.c >--- ./source3/lib/messages_local.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/messages_local.c 2010-05-26 06:23:56.000000000 -0500 >@@ -262,15 +262,15 @@ > > SMB_ASSERT(pid > 0); > >- if (euid != 0) { >+ if (euid != SUPERUSER) { > /* If we're not root become so to send the message. */ > save_re_uid(); >- set_effective_uid(0); >+ set_effective_uid(SUPERUSER); > } > > ret = kill(pid, SIGUSR1); > >- if (euid != 0) { >+ if (euid != SUPERUSER) { > /* Go back to who we were. */ > int saved_errno = errno; > restore_re_uid_fromroot(); >diff -u ./source3/lib/system.c.orig ./source3/lib/system.c >--- ./source3/lib/system.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/system.c 2010-05-27 07:13:48.000000000 -0500 >@@ -534,8 +534,12 @@ > dst->st_ex_mtime = get_mtimespec(src); > dst->st_ex_ctime = get_ctimespec(src); > make_create_timespec(src, dst, fake_dir_create_times); >+#ifdef HAVE_STAT_ST_BLKSIZE > dst->st_ex_blksize = src->st_blksize; >+#endif >+#ifdef HAVE_STAT_ST_BLOCKS > dst->st_ex_blocks = src->st_blocks; >+#endif > > #ifdef HAVE_STAT_ST_FLAGS > dst->st_ex_flags = src->st_flags; >@@ -1205,17 +1209,15 @@ > > int sys_setgroups(gid_t UNUSED(primary_gid), int setlen, gid_t *gidset) > { >-#if !defined(HAVE_SETGROUPS) >- errno = ENOSYS; >- return -1; >-#endif /* HAVE_SETGROUPS */ >- > #if defined(USE_BSD_SETGROUPS) > return sys_bsd_setgroups(primary_gid, setlen, gidset); > #elif defined(HAVE_BROKEN_GETGROUPS) > return sys_broken_setgroups(setlen, gidset); >-#else >+#elif defined(HAVE_SETGROUPS) > return setgroups(setlen, gidset); >+#else >+ errno = ENOSYS; >+ return -1; > #endif > } > >diff -u ./source3/lib/util_sec.c.orig ./source3/lib/util_sec.c >--- ./source3/lib/util_sec.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/lib/util_sec.c 2010-05-26 06:37:22.000000000 -0500 >@@ -84,7 +84,7 @@ > ****************************************************************************/ > bool non_root_mode(void) > { >- return (initial_uid != (uid_t)0); >+ return (initial_uid != (uid_t)SUPERUSER); > } > > /**************************************************************************** >@@ -129,26 +129,26 @@ > void gain_root_privilege(void) > { > #if USE_SETRESUID >- setresuid(0,0,0); >+ setresuid(SUPERUSER,SUPERUSER,SUPERUSER); > #endif > > #if USE_SETEUID >- seteuid(0); >+ seteuid(SUPERUSER); > #endif > > #if USE_SETREUID >- setreuid(0, 0); >+ setreuid(SUPERUSER, SUPERUSER); > #endif > > #if USE_SETUIDX >- setuidx(ID_EFFECTIVE, 0); >- setuidx(ID_REAL, 0); >+ setuidx(ID_EFFECTIVE, SUPERUSER); >+ setuidx(ID_REAL, SUPERUSER); > #endif > > /* this is needed on some systems */ >- setuid(0); >+ setuid(SUPERUSER); > >- assert_uid(0, 0); >+ assert_uid(SUPERUSER, SUPERUSER); > } > > >@@ -159,25 +159,25 @@ > void gain_root_group_privilege(void) > { > #if USE_SETRESUID >- setresgid(0,0,0); >+ setresgid(SUPERGROUP,SUPERGROUP,SUPERGROUP); > #endif > > #if USE_SETREUID >- setregid(0,0); >+ setregid(SUPERGROUP,SUPERGROUP); > #endif > > #if USE_SETEUID >- setegid(0); >+ setegid(SUPERGROUP); > #endif > > #if USE_SETUIDX >- setgidx(ID_EFFECTIVE, 0); >- setgidx(ID_REAL, 0); >+ setgidx(ID_EFFECTIVE, SUPERGROUP); >+ setgidx(ID_REAL, SUPERGROUP); > #endif > >- setgid(0); >+ setgid(SUPERGROUP); > >- assert_gid(0, 0); >+ assert_gid(SUPERGROUP, SUPERGROUP); > } > > >@@ -286,7 +286,7 @@ > > void restore_re_uid(void) > { >- set_effective_uid(0); >+ set_effective_uid(SUPERUSER); > restore_re_uid_fromroot(); > } > >@@ -338,7 +338,7 @@ > #endif > > #if USE_SETREUID >- setreuid(0, 0); >+ setreuid(SUPERUSER, SUPERUSER); > setreuid(uid, -1); > setreuid(-1, uid); > #endif >@@ -439,7 +439,7 @@ > > main() > { >- if (getuid() != 0) { >+ if (getuid() != SUPERUSER) { > #if (defined(AIX) && defined(USE_SETREUID)) > /* setreuid is badly broken on AIX 4.1, we avoid it completely */ > fprintf(stderr,"avoiding possibly broken setreuid\n"); >@@ -461,8 +461,8 @@ > gain_root_privilege(); > gain_root_group_privilege(); > become_user_permanently(1, 1); >- setuid(0); >- if (getuid() == 0) { >+ setuid(SUPERUSER); >+ if (getuid() == SUPERUSER) { > fprintf(stderr,"uid not set permanently\n"); > exit(1); > } >@@ -478,5 +478,5 @@ > ****************************************************************************/ > bool is_setuid_root(void) > { >- return (geteuid() == (uid_t)0) && (getuid() != (uid_t)0); >+ return (geteuid() == (uid_t)SUPERUSER) && (getuid() != (uid_t)SUPERUSER); > } >diff -u ./source3/libaddns/dnssock.c.orig ./source3/libaddns/dnssock.c >--- ./source3/libaddns/dnssock.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/libaddns/dnssock.c 2010-05-26 08:49:50.000000000 -0500 >@@ -22,6 +22,9 @@ > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ > >+#ifdef __TANDEM >+#include <floss.h> >+#endif > #include "dns.h" > #include <sys/time.h> > #include <unistd.h> >diff -u ./source3/libads/dns.c.orig ./source3/libads/dns.c >--- ./source3/libads/dns.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/libads/dns.c 2010-05-30 13:07:12.000000000 -0500 >@@ -87,7 +87,11 @@ > > /* See RFC 1035 for details. If this fails, then return. */ > >+#ifdef HAVE_DN_EXPAND > namelen = dn_expand( start, end, p, hostname, sizeof(hostname) ); >+#else >+ namelen = -1; /* TODO!!! */ >+#endif > if ( namelen < 0 ) { > return False; > } >@@ -124,7 +128,11 @@ > ZERO_STRUCTP( rr ); > /* pull the name from the answer */ > >+#ifdef HAVE_DN_EXPAND > namelen = dn_expand( start, end, p, hostname, sizeof(hostname) ); >+#else >+ namelen = -1; /* TODO!!! */ >+#endif > if ( namelen < 0 ) { > return -1; > } >@@ -198,7 +206,11 @@ > > p += 6; > >+#ifdef HAVE_DN_EXPAND > namelen = dn_expand( start, end, p, dcname, sizeof(dcname) ); >+#else >+ namelen = -1; /* TODO!!! */ >+#endif > if ( namelen < 0 ) { > DEBUG(1,("ads_dns_parse_rr_srv: Failed to uncompress name!\n")); > return False; >@@ -247,7 +259,11 @@ > > /* ame server hostname */ > >+#ifdef HAVE_DN_EXPAND > namelen = dn_expand( start, end, p, nsname, sizeof(nsname) ); >+#else >+ namelen = -1; /* TODO!!! */ >+#endif > if ( namelen < 0 ) { > DEBUG(1,("ads_dns_parse_rr_ns: Failed to uncompress name!\n")); > return False; >@@ -336,6 +352,7 @@ > } > } > >+#ifdef HAVE_RES_QUERY /* or #ifdef HAVE_DN_EXPAND? */ > if ((resp_len = res_query(name, C_IN, q_type, buffer, buf_len)) > < 0 ) { > DEBUG(3,("ads_dns_lookup_srv: " >@@ -353,6 +370,15 @@ > last_dns_check = time(NULL); > return last_dns_status; > } >+#else /* TODO!!! */ >+ DEBUG(3,("ads_dns_lookup_srv: " >+ "Failed to resolve %s (%s)\n", >+ name, strerror(ENOTSUP))); >+ TALLOC_FREE( buffer ); >+ last_dns_status = NT_STATUS_UNSUCCESSFUL; >+ last_dns_check = time(NULL); >+ return last_dns_status; >+#endif > > /* On AIX, Solaris, and possibly some older glibc systems (e.g. SLES8) > truncated replies never give back a resp_len > buflen >diff -u ./source3/libsmb/clifile.c.orig ./source3/libsmb/clifile.c >--- ./source3/libsmb/clifile.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/libsmb/clifile.c 2010-05-26 08:56:24.000000000 -0500 >@@ -867,12 +867,14 @@ > } > > sbuf->st_ex_size = IVAL2_TO_SMB_BIG_UINT(state->data,0); /* total size, in bytes */ >+#if defined (HAVE_STAT_ST_BLOCKS) > sbuf->st_ex_blocks = IVAL2_TO_SMB_BIG_UINT(state->data,8); /* number of blocks allocated */ >-#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) >+# if defined defined(STAT_ST_BLOCKSIZE) > sbuf->st_ex_blocks /= STAT_ST_BLOCKSIZE; >-#else >+# else > /* assume 512 byte blocks */ > sbuf->st_ex_blocks /= 512; >+# endif > #endif > sbuf->st_ex_ctime = interpret_long_date((char *)(state->data + 16)); /* time of last change */ > sbuf->st_ex_atime = interpret_long_date((char *)(state->data + 24)); /* time of last access */ >diff -u ./source3/libsmb/clispnego.c.orig ./source3/libsmb/clispnego.c >--- ./source3/libsmb/clispnego.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/libsmb/clispnego.c 2010-05-27 05:12:43.000000000 -0500 >@@ -387,6 +387,7 @@ > DATA_BLOB tkt, tkt_wrapped; > const char *krb_mechs[] = {OID_KERBEROS5_OLD, OID_KERBEROS5, OID_NTLMSSP, NULL}; > >+#ifdef HAVE_KRB5 /* ??? TODO! */ > /* get a kerberos ticket for the service and extract the session key */ > retval = cli_krb5_get_ticket(principal, time_offset, > &tkt, session_key_krb5, extra_ap_opts, NULL, >@@ -394,6 +395,7 @@ > > if (retval) > return retval; >+#endif > > /* wrap that up in a nice GSS-API wrapping */ > tkt_wrapped = spnego_gen_krb5_wrap(tkt, TOK_ID_KRB_AP_REQ); >diff -u ./source3/modules/vfs_scannedonly.c.orig ./source3/modules/vfs_scannedonly.c >--- ./source3/modules/vfs_scannedonly.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/modules/vfs_scannedonly.c 2010-05-27 09:27:33.000000000 -0500 >@@ -476,7 +476,9 @@ > "(max %d), %d ms) for %s\n", > i, recheck_tries, > recheck_time, cache_smb_fname->base_name)); >+#ifdef HAVE_NANOSLEEP /* ? see also lib/util.c, function smb_msleep() */ > nanosleep(&req, NULL); >+#endif > retval = SMB_VFS_NEXT_STAT(handle, cache_smb_fname); > i++; > } >diff -u ./source3/modules/vfs_streams_xattr.c.orig ./source3/modules/vfs_streams_xattr.c >--- ./source3/modules/vfs_streams_xattr.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/modules/vfs_streams_xattr.c 2010-05-26 06:46:57.000000000 -0500 >@@ -237,7 +237,9 @@ > sbuf->st_ex_ino = stream_inode(sbuf, io->xattr_name); > sbuf->st_ex_mode &= ~S_IFMT; > sbuf->st_ex_mode |= S_IFREG; >+#ifdef HAVE_STAT_ST_BLOCKS > sbuf->st_ex_blocks = sbuf->st_ex_size % STAT_ST_BLOCKSIZE + 1; >+#endif > > return 0; > } >@@ -289,8 +291,10 @@ > smb_fname->st.st_ex_ino = stream_inode(&smb_fname->st, xattr_name); > smb_fname->st.st_ex_mode &= ~S_IFMT; > smb_fname->st.st_ex_mode |= S_IFREG; >+#ifdef HAVE_STAT_ST_BLOCKS > smb_fname->st.st_ex_blocks = > smb_fname->st.st_ex_size % STAT_ST_BLOCKSIZE + 1; >+#endif > > result = 0; > fail: >@@ -340,8 +344,10 @@ > smb_fname->st.st_ex_ino = stream_inode(&smb_fname->st, xattr_name); > smb_fname->st.st_ex_mode &= ~S_IFMT; > smb_fname->st.st_ex_mode |= S_IFREG; >+#ifdef HAVE_STAT_ST_BLOCKS > smb_fname->st.st_ex_blocks = > smb_fname->st.st_ex_size % STAT_ST_BLOCKSIZE + 1; >+#endif > > result = 0; > >diff -u ./source3/pam_smbpass/pam_smb_passwd.c.orig ./source3/pam_smbpass/pam_smb_passwd.c >--- ./source3/pam_smbpass/pam_smb_passwd.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/pam_smbpass/pam_smb_passwd.c 2010-05-26 08:58:18.000000000 -0500 >@@ -173,7 +173,7 @@ > > /* Password change by root, or for an expired token, doesn't > require authentication. Is this a good choice? */ >- if (getuid() != 0 && !(flags & PAM_CHANGE_EXPIRED_AUTHTOK)) { >+ if (getuid() != SUPERUSER && !(flags & PAM_CHANGE_EXPIRED_AUTHTOK)) { > > /* tell user what is happening */ > #define greeting "Changing password for " >diff -u ./source3/printing/printing_db.c.orig ./source3/printing/printing_db.c >--- ./source3/printing/printing_db.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/printing/printing_db.c 2010-05-26 08:59:25.000000000 -0500 >@@ -98,7 +98,7 @@ > return NULL; > } > >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > become_root(); > done_become_root = True; > } >diff -u ./source3/registry/reg_api.c.orig ./source3/registry/reg_api.c >--- ./source3/registry/reg_api.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/registry/reg_api.c 2010-05-26 14:36:46.000000000 -0500 >@@ -953,7 +953,11 @@ > /* open the registry file....fail if the file already exists */ > > regfile = regfio_open(fname, (O_RDWR|O_CREAT|O_EXCL), >+#if defined(S_IRUSR) && defined(S_IWUSR) >+ (S_IRUSR|S_IWUSR)); >+#else > (S_IREAD|S_IWRITE)); >+#endif > if (regfile == NULL) { > DEBUG(0,("backup_registry_key: failed to open \"%s\" (%s)\n", > fname, strerror(errno) )); >diff -u ./source3/smbd/close.c.orig ./source3/smbd/close.c >--- ./source3/smbd/close.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/close.c 2010-05-26 15:06:23.000000000 -0500 >@@ -655,6 +655,24 @@ > conn->num_files_open - 1, > nt_errstr(status) )); > >+#ifdef __TANDEM /* EDIT file support */ >+ if (fsp->_101_file == 1) { >+ char buffer[FILENAME_MAX * 4]; >+ if (fsp->can_write) { >+#undef sprintf /* identifier "__ERROR__XX__NEVER_USE_SPRINTF__" is undefined */ >+ sprintf(buffer, >+ "cd $(dirname %s) >/dev/null 2>&1 && gtacl -p ctoedit $(basename %s),$(basename %s) >/dev/null 2>&1", >+ fsp->_101_filename, fsp->fsp_name, fsp->_101_filename); >+ if (system(buffer) != 0) { >+ DEBUG(1,("101 file: %s failed.\n",buffer)); >+ status = -1; >+ } >+ } >+ >+ assert(unlink(fsp->fsp_name->base_name) == 0); >+ } >+#endif >+ > file_free(req, fsp); > return status; > } >diff -u ./source3/smbd/open.c.orig ./source3/smbd/open.c >--- ./source3/smbd/open.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/open.c 2010-05-26 15:04:29.000000000 -0500 >@@ -451,6 +451,79 @@ > } > > /* Actually do the open */ >+#ifdef __TANDEM /* EDIT file support */ /* TODO!!! */ >+ { >+ struct stat stat_buffer; >+ >+ if (lstat(smb_fname->base_name, &stat_buffer) == 0) { >+ if (S_ISREG(stat_buffer.st_mode) && >+ (S_ISGUARDIANOBJECT(stat_buffer.st_dev) || >+ S_ISEXPANDOBJECT(stat_buffer.st_dev))) { >+ FILE *file_command; >+ char buffer[FILENAME_MAX * 4]; >+ int i; >+ char file_type[] = "Guardian,unstructured file,file code:101\n"; >+ >+#undef sprintf /* identifier "__ERROR__XX__NEVER_USE_SPRINTF__" is undefined */ >+ sprintf(buffer,"/bin/file %s 2>&1", smb_fname); >+ file_command = popen(buffer,"r"); >+ assert(file_command != NULL); >+ assert(fgets(buffer, sizeof(buffer), file_command) != NULL); >+ assert(fclose(file_command) == 0); >+ >+ i = strlen(buffer); >+ >+ if ((i > sizeof(file_type)) && >+ (strcmp("Guardian,unstructured file,file code:101\n", >+ buffer + i - sizeof(file_type) + 1) == 0)) { >+ bool open_result; >+ char basename[FILENAME_MAX]; >+ char new_basename[FILENAME_MAX]; >+ char dirname[FILENAME_MAX]; >+ char *tok; >+ char *last_tok; >+ >+ while (flags & (O_WRONLY | O_RDWR)) { >+ if ((stat_buffer.st_uid == getuid()) && >+ (stat_buffer.st_mode & S_IWUSR)) break; >+ if ((stat_buffer.st_gid == getgid()) && >+ (stat_buffer.st_mode & S_IWGRP)) break; >+ if (stat_buffer.st_mode & S_IWOTH) break; >+ DEBUG(1,("101 file: mode mismatch\n")); >+ } >+ strncpy(buffer, smb_fname->base_name, sizeof(buffer)); >+ last_tok = tok = strtok(buffer, "/"); >+ >+ while (tok != NULL) { >+ last_tok = tok; >+ tok = strtok(NULL, "/"); >+ } >+ strncpy(basename, last_tok, sizeof(basename)); >+ strncpy(dirname, smb_fname->base_name, abs(buffer - last_tok) - 1); >+ dirname[abs(buffer - last_tok) - 1] = '\0'; >+ sprintf(new_basename, "%.7s0", basename); >+ sprintf(buffer, >+ "cd %s >/dev/null 2>&1 && gtacl -p edittoc %s,%s >/dev/null 2>&1", >+ dirname, basename, new_basename); >+ if (system(buffer) != 0) { >+ DEBUG(1,("101 file: %s failed.\n",buffer)); >+ return False; >+ } >+ >+ /*psbuf->st_nlink = 0;*/ >+ strncpy(fsp->_101_filename, smb_fname->base_name, >+ sizeof(fsp->_101_filename)); >+ /*sprintf((char *)name, "%s/%s", dirname, new_basename);*/ >+ open_result = open_file(fsp, conn, req, parent_dir, flags, unx_mode, access_mask, open_access_mask); >+ fsp->_101_file = 1; >+ return open_result; >+ } >+ } >+ } >+ fsp->_101_file = 0; >+ } >+#endif /* __TANDEM Edit file support */ >+ > status = fd_open(conn, fsp, local_flags, unx_mode); > if (!NT_STATUS_IS_OK(status)) { > DEBUG(3,("Error opening file %s (%s) (local_flags=%d) " >diff -u ./source3/smbd/sec_ctx.c.orig ./source3/smbd/sec_ctx.c >--- ./source3/smbd/sec_ctx.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/sec_ctx.c 2010-05-26 09:09:33.000000000 -0500 >@@ -106,20 +106,20 @@ > return; > } > >- if (geteuid() != 0) { >- set_effective_uid(0); >+ if (geteuid() != SUPERUSER) { >+ set_effective_uid(SUPERUSER); > >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > DEBUG(0, > ("Warning: You appear to have a trapdoor " > "uid system\n")); > } > } > >- if (getegid() != 0) { >- set_effective_gid(0); >+ if (getegid() != SUPERGROUP) { >+ set_effective_gid(SUPERGROUP); > >- if (getegid() != 0) { >+ if (getegid() != SUPERGROUP) { > DEBUG(0, > ("Warning: You appear to have a trapdoor " > "gid system\n")); >@@ -363,7 +363,7 @@ > { > /* May need to worry about supplementary groups at some stage */ > >- set_sec_ctx(0, 0, 0, NULL, NULL); >+ set_sec_ctx(SUPERUSER, SUPERGROUP, 0, NULL, NULL); > } > > /**************************************************************************** >diff -u ./source3/smbd/service.c.orig ./source3/smbd/service.c >--- ./source3/smbd/service.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/service.c 2010-05-26 09:10:28.000000000 -0500 >@@ -1113,7 +1113,7 @@ > > /* This must ONLY BE CALLED AS ROOT. As it exits this function as > * root. */ >- if (!non_root_mode() && (euid = geteuid()) != 0) { >+ if (!non_root_mode() && (euid = geteuid()) != SUPERUSER) { > DEBUG(0,("make_connection: PANIC ERROR. Called as nonroot " > "(%u)\n", (unsigned int)euid )); > smb_panic("make_connection: PANIC ERROR. Called as nonroot\n"); >diff -u ./source3/smbd/smb2_create.c.orig ./source3/smbd/smb2_create.c >--- ./source3/smbd/smb2_create.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/smb2_create.c 2010-05-28 04:45:12.000000000 -0500 >@@ -699,8 +699,16 @@ > get_change_timespec(smbreq->conn, result, > result->fsp_name)); > state->out_allocation_size = >+#ifdef HAVE_ST_BLKSIZE > result->fsp_name->st.st_ex_blksize * >+#else >+ STAT_ST_BLOCKSIZE * >+#endif >+#ifdef HAVE_ST_BLOCKS > result->fsp_name->st.st_ex_blocks; >+#else >+ result->fsp_name->st.st_ex_size % STAT_ST_BLOCKSIZE + 1; >+#endif > state->out_end_of_file = result->fsp_name->st.st_ex_size; > if (state->out_file_attributes == 0) { > state->out_file_attributes = FILE_ATTRIBUTE_NORMAL; >diff -u ./source3/smbd/vfs.c.orig ./source3/smbd/vfs.c >--- ./source3/smbd/vfs.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/smbd/vfs.c 2010-05-26 15:09:25.000000000 -0500 >@@ -1203,6 +1203,9 @@ > handle->fns->rewind_dir(handle, dirp); > } > >+#ifdef __TANDEM >+#undef mkdir >+#endif > int smb_vfs_call_mkdir(struct vfs_handle_struct *handle, const char *path, > mode_t mode) > { >diff -u ./source3/stf/comfychair.py.orig ./source3/stf/comfychair.py >--- ./source3/stf/comfychair.py.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/stf/comfychair.py 2010-05-26 09:11:39.000000000 -0500 >@@ -115,7 +115,8 @@ > def require_root(self): > """Skip this test unless run by root.""" > import os >- self.require(os.getuid() == 0, >+ __TANDEM self.require(os.getuid() == 0, >+ self.require(os.getuid() == 65535, > "must be root to run this test") > > ############################################################# >diff -u ./source3/utils/net_rpc_registry.c.orig ./source3/utils/net_rpc_registry.c >--- ./source3/utils/net_rpc_registry.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/utils/net_rpc_registry.c 2010-05-26 09:13:51.000000000 -0500 >@@ -1150,7 +1150,11 @@ > d_printf(_("ok\n")); > > d_printf(_("Opening %s...."), argv[1]); >+#if defined(S_IRUSR) && defined(S_IWUSR) >+ if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IRUSR|S_IWUSR) )) ) { >+#else > if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) { >+#endif > d_fprintf(stderr, _("Failed to open %s for writing\n"),argv[1]); > goto out; > } >diff -u ./source3/utils/net_sam.c.orig ./source3/utils/net_sam.c >--- ./source3/utils/net_sam.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/utils/net_sam.c 2010-05-26 09:14:28.000000000 -0500 >@@ -2139,7 +2139,7 @@ > {NULL, NULL, 0, NULL, NULL} > }; > >- if (getuid() != 0) { >+ if (getuid() != SUPERUSER) { > d_fprintf(stderr, _("You are not root, most things won't " > "work\n")); > } >diff -u ./source3/utils/net_usershare.c.orig ./source3/utils/net_usershare.c >--- ./source3/utils/net_usershare.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/utils/net_usershare.c 2010-05-26 09:15:07.000000000 -0500 >@@ -769,7 +769,7 @@ > /* If we're not root, check if we're restricted to sharing out directories > that we own only. */ > >- if ((myeuid != 0) && lp_usershare_owner_only() && (myeuid != sbuf.st_ex_uid)) { >+ if ((myeuid != SUPERUSER) && lp_usershare_owner_only() && (myeuid != sbuf.st_ex_uid)) { > d_fprintf(stderr, _("net usershare add: cannot share path %s as " > "we are restricted to only sharing directories we own.\n" > "\tAsk the administrator to add the line \"usershare owner only = false\" \n" >diff -u ./source3/utils/profiles.c.orig ./source3/utils/profiles.c >--- ./source3/utils/profiles.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/utils/profiles.c 2010-05-26 09:16:24.000000000 -0500 >@@ -275,7 +275,11 @@ > exit (1); > } > >+#if defined(S_IRUSR) && defined(S_IWUSR) >+ if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IRUSR|S_IWUSR) )) ) { >+#else > if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) { >+#endif > fprintf( stderr, "Failed to open new file %s!\n", new_filename ); > fprintf( stderr, "Error was (%s)\n", strerror(errno) ); > exit (1); >diff -u ./source3/utils/smbpasswd.c.orig ./source3/utils/smbpasswd.c >--- ./source3/utils/smbpasswd.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/utils/smbpasswd.c 2010-05-26 09:18:14.000000000 -0500 >@@ -95,7 +95,7 @@ > switch(ch) { > case 'L': > #if !defined(NSS_WRAPPER) >- if (getuid() != 0) { >+ if (getuid() != SUPERUSER) { > fprintf(stderr, "smbpasswd -L can only be used by root.\n"); > exit(1); > } >@@ -574,7 +574,7 @@ > set_auth_parameters(argc, argv); > #endif /* HAVE_SET_AUTH_PARAMETERS */ > >- if (getuid() == 0) { >+ if (getuid() == SUPERUSER) { > local_flags = LOCAL_AM_ROOT; > } > >diff -u ./source3/web/cgi.c.orig ./source3/web/cgi.c >--- ./source3/web/cgi.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/web/cgi.c 2010-05-26 09:19:10.000000000 -0500 >@@ -320,7 +320,7 @@ > exit(0); > } > >- setuid(0); >+ setuid(SUPERUSER); > setuid(pwd->pw_uid); > if (geteuid() != pwd->pw_uid || getuid() != pwd->pw_uid) { > printf("%sFailed to become user %s - uid=%d/%d<br>%s\n", >@@ -407,7 +407,7 @@ > ***************************************************************************/ > bool am_root(void) > { >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > return( True); > } else { > return( False); >diff -u ./source3/web/startstop.c.orig ./source3/web/startstop.c >--- ./source3/web/startstop.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/web/startstop.c 2010-05-26 09:20:47.000000000 -0500 >@@ -27,7 +27,7 @@ > { > char *binfile = NULL; > >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > return; > } > >@@ -47,7 +47,7 @@ > { > char *binfile = NULL; > >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > return; > } > >@@ -67,7 +67,7 @@ > { > char *binfile = NULL; > >- if (geteuid() != 0) { >+ if (geteuid() != SUPERUSER) { > return; > } > >@@ -88,7 +88,7 @@ > { > pid_t pid = pidfile_pid("smbd"); > >- if (geteuid() != 0) return; >+ if (geteuid() != SUPERUSER) return; > > if (pid <= 0) return; > >@@ -100,7 +100,7 @@ > { > pid_t pid = pidfile_pid("nmbd"); > >- if (geteuid() != 0) return; >+ if (geteuid() != SUPERUSER) return; > > if (pid <= 0) return; > >@@ -112,7 +112,7 @@ > { > pid_t pid = pidfile_pid("winbindd"); > >- if (geteuid() != 0) return; >+ if (geteuid() != SUPERUSER) return; > > if (pid <= 0) return; > >@@ -122,7 +122,7 @@ > /* kill a specified process */ > void kill_pid(struct server_id pid) > { >- if (geteuid() != 0) return; >+ if (geteuid() != SUPERUSER) return; > > if (procid_to_pid(&pid) <= 0) return; > >diff -u ./source3/web/statuspage.c.orig ./source3/web/statuspage.c >--- ./source3/web/statuspage.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source3/web/statuspage.c 2010-05-26 09:22:55.000000000 -0500 >@@ -211,7 +211,7 @@ > procid_str_static(&crec->pid), > crec->machine, crec->addr, > tstring(talloc_tos(),crec->start)); >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > printf("<td><input type=submit value=\"X\" name=\"kill_%s\"></td>\n", > procid_str_static(&crec->pid)); > } >@@ -349,7 +349,7 @@ > > fflush(stdout); > printf("<tr><td>%s</td><td>%s</td>\n", _("smbd:"), smbd_running()?_("running"):_("not running")); >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > if (smbd_running()) { > nr_running++; > printf("<td><input type=submit name=\"smbd_stop\" value=\"%s\"></td>\n", _("Stop smbd")); >@@ -362,7 +362,7 @@ > > fflush(stdout); > printf("<tr><td>%s</td><td>%s</td>\n", _("nmbd:"), nmbd_running()?_("running"):_("not running")); >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > if (nmbd_running()) { > nr_running++; > printf("<td><input type=submit name=\"nmbd_stop\" value=\"%s\"></td>\n", _("Stop nmbd")); >@@ -376,7 +376,7 @@ > #ifdef WITH_WINBIND > fflush(stdout); > printf("<tr><td>%s</td><td>%s</td>\n", _("winbindd:"), winbindd_running()?_("running"):_("not running")); >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > if (winbindd_running()) { > nr_running++; > printf("<td><input type=submit name=\"winbindd_stop\" value=\"%s\"></td>\n", _("Stop winbindd")); >@@ -388,7 +388,7 @@ > printf("</tr>\n"); > #endif > >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > printf("<tr><td></td><td></td>\n"); > if (nr_running >= 1) { > /* stop, restart all */ >@@ -407,7 +407,7 @@ > printf("<p><h3>%s</h3>\n", _("Active Connections")); > printf("<table border=1>\n"); > printf("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th>\n", _("PID"), _("Client"), _("IP address"), _("Date")); >- if (geteuid() == 0) { >+ if (geteuid() == SUPERUSER) { > printf("<th>%s</th>\n", _("Kill")); > } > printf("</tr>\n"); >diff -u ./source4/config.sub.orig ./source4/config.sub >--- ./source4/config.sub.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./source4/config.sub 2010-05-27 06:06:21.000000000 -0500 >@@ -823,6 +823,9 @@ > np1) > basic_machine=np1-gould > ;; >+ nse-tandem) >+ basic_machine=nse-tandem >+ ;; > nsr-tandem) > basic_machine=nsr-tandem > ;; >diff -u ./source4/configure.orig ./source4/configure >--- ./source4/configure.orig 2010-05-27 05:59:40.000000000 -0500 >+++ ./source4/configure 2010-05-27 06:24:13.000000000 -0500 >@@ -4440,6 +4440,61 @@ > fi > rm -f conftest.err conftest.$ac_objext conftest.$ac_ext > fi >+# NonStop, try c89's option -Wc99lite, should do for designated initializers >+if test x"$c99_init" = x"no"; then >+ echo "$as_me:$LINENO: checking for C99 designated initializers with -Wc99lite" >&5 >+echo $ECHO_N "checking for C99 designated initializers with -Wc99lite... $ECHO_C" >&6 >+ CFLAGS="$saved_CFLAGS -Wc99lite" >+ cat >conftest.$ac_ext <<_ACEOF >+/* confdefs.h. */ >+_ACEOF >+cat confdefs.h >>conftest.$ac_ext >+cat >>conftest.$ac_ext <<_ACEOF >+/* end confdefs.h. */ >+#include <stdio.h> >+int >+main () >+{ >+ struct foo {int x;char y;}; >+ struct foo bar = { .y = 'X', .x = 1 }; >+ >+ ; >+ return 0; >+} >+_ACEOF >+rm -f conftest.$ac_objext >+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 >+ (eval $ac_compile) 2>conftest.er1 >+ ac_status=$? >+ grep -v '^ *+' conftest.er1 >conftest.err >+ rm -f conftest.er1 >+ cat conftest.err >&5 >+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 >+ (exit $ac_status); } && >+ { ac_try='test -z "$ac_c_werror_flag" >+ || test ! -s conftest.err' >+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 >+ (eval $ac_try) 2>&5 >+ ac_status=$? >+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 >+ (exit $ac_status); }; } && >+ { ac_try='test -s conftest.$ac_objext' >+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 >+ (eval $ac_try) 2>&5 >+ ac_status=$? >+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 >+ (exit $ac_status); }; }; then >+ echo "$as_me:$LINENO: result: yes" >&5 >+echo "${ECHO_T}yes" >&6; c99_init=yes >+else >+ echo "$as_me: failed program was:" >&5 >+sed 's/^/| /' conftest.$ac_ext >&5 >+ >+echo "$as_me:$LINENO: result: no" >&5 >+echo "${ECHO_T}no" >&6 >+fi >+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext >+fi > > if test "`uname`" = "HP-UX"; then > if test "$ac_cv_c_compiler_gnu" = no; then >diff -u ./testsuite/smbd/sec_ctx_root.c.orig ./testsuite/smbd/sec_ctx_root.c >--- ./testsuite/smbd/sec_ctx_root.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./testsuite/smbd/sec_ctx_root.c 2010-05-26 09:23:36.000000000 -0500 >@@ -43,7 +43,7 @@ > > getgroups(actual_ngroups, actual_groups); > >- if (geteuid() != 0 || getegid() != 0 || actual_ngroups != 0) { >+ if (geteuid() != SUPERUSER || getegid() != SUPERGROUP || actual_ngroups != 0) { > printf("FAIL: root id not set\n"); > return 1; > } >diff -u ./testsuite/smbd/sec_ctx_stack.c.orig ./testsuite/smbd/sec_ctx_stack.c >--- ./testsuite/smbd/sec_ctx_stack.c.orig 2010-05-17 06:51:23.000000000 -0500 >+++ ./testsuite/smbd/sec_ctx_stack.c 2010-05-26 09:24:36.000000000 -0500 >@@ -71,7 +71,7 @@ > return 1; > } > } else { >- if ((geteuid() != 0) || (getegid() != 0)) { >+ if ((geteuid() != SUPERUSER) || (getegid() != SUPERGROUP)) { > printf("FAIL: incorrect context popped\n"); > return 1; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7476
:
5751
|
5769