Updates from HEAD:
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Nov 2002 21:43:57 +0000 (21:43 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 15 Nov 2002 21:43:57 +0000 (21:43 +0000)
 - const for PACKS() in lanman.c
 - change auth to 'account before password'
 - add help to net rpc {vampire,samsync}
 - configure updates for sun workshop cc
 - become_root() around pdb_ calls in auth_util for guest login.

Andrew Bartlett

source/auth/auth_sam.c
source/auth/auth_util.c
source/auth/auth_winbind.c
source/configure
source/configure.in
source/libads/ldap.c
source/smbd/lanman.c
source/utils/net_rpc.c

index 9fa33dccf68c12e161a7e9cd1fbab0a182fed7c8..02f8511d6af53067726069aac6ac51ed59a9fc06 100644 (file)
@@ -393,6 +393,8 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
                return NT_STATUS_NO_SUCH_USER;
        }
 
+       nt_status = sam_account_ok(mem_ctx, sampass, user_info);
+       
        nt_status = sam_password_ok(auth_context, mem_ctx, sampass, user_info, user_sess_key);
 
        if (!NT_STATUS_IS_OK(nt_status)) {
@@ -400,8 +402,6 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
                return nt_status;
        }
 
-       nt_status = sam_account_ok(mem_ctx, sampass, user_info);
-       
        if (!NT_STATUS_IS_OK(nt_status)) {
                pdb_free_sam(&sampass);
                return nt_status;
index 98b15f3fb624a34ea2412f8cbd9f0fad9d9babd8..5696b8f2dcc14c3fba9aacf27d5524db3b1b173e 100644 (file)
@@ -821,9 +821,12 @@ NTSTATUS make_server_info_guest(auth_serversupplied_info **server_info)
        sid_copy(&guest_sid, get_global_sam_sid());
        sid_append_rid(&guest_sid, DOMAIN_USER_RID_GUEST);
 
+       become_root();
        if (!pdb_getsampwsid(sampass, &guest_sid)) {
+               unbecome_root();
                return NT_STATUS_NO_SUCH_USER;
        }
+       unbecome_root();
 
        nt_status = make_server_info_sam(server_info, sampass);
 
index 10788721fdebec9893161765909ffbde349748d5..c6a1727ebeaf90e69c4a4be6c9ac997d56053d5b 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
-/* Prototypes from common.h */
-
-NSS_STATUS winbindd_request(int req_type, 
-                           struct winbindd_request *request,
-                           struct winbindd_response *response);
-
-NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
+static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
 {
        uint8 *info3_ndr;
        size_t len = response->length - sizeof(response);
index 574879addee77fffc365cb816bd58de80042c8fa..a881461b65cf7286d713bd8c154ee2aaeea50683 100755 (executable)
@@ -16462,9 +16462,16 @@ else
 
    ac_cv_shlib_works=no
    # try building a trivial shared library
-   $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
-     $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
-     ac_cv_shlib_works=yes
+   if test "$PICSUFFIX" = "po"; then
+     $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
+       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
+       ac_cv_shlib_works=yes
+   else
+     $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
+       mv shlib.$PICSUFFIX shlib.po &&
+       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
+       ac_cv_shlib_works=yes
+   fi
    rm -f shlib.so shlib.po
 
 fi
index 167f977522a35d50c27d2d9fede2403aa438e28a..7a251fde8379203dc7793b6f3354688e86ca532d 100644 (file)
@@ -1003,9 +1003,16 @@ AC_CACHE_CHECK([whether building shared libraries actually works],
                [ac_cv_shlib_works],[
    ac_cv_shlib_works=no
    # try building a trivial shared library
-   $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
-     $CC $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
-     ac_cv_shlib_works=yes
+   if test "$PICSUFFIX" = "po"; then
+     $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
+       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
+       ac_cv_shlib_works=yes
+   else
+     $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
+       mv shlib.$PICSUFFIX shlib.po &&
+       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o shlib.so shlib.po &&
+       ac_cv_shlib_works=yes
+   fi
    rm -f shlib.so shlib.po
 ])
 if test $ac_cv_shlib_works = no; then
index d5cd56001be8a34058322a28d835bdcadf2b0771..60427323b0b779b566064b57b349dc13aa819b36 100644 (file)
@@ -1790,8 +1790,8 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
        p = strchr(ads->config.ldap_server_name, '$');
        if (!p || p[1] != '@') {
                talloc_destroy(ctx);
+               DEBUG(1, ("ads_server_info: returned ldap server name (%s) does not contain '$@' so was deemed invalid\n", ads->config.ldap_server_name));
                SAFE_FREE(ads->config.ldap_server_name);
-               DEBUG(1, ("ads_server_info: returned ldap server name did not contain '$@' so was deemed invalid\n"));
                return ADS_ERROR(LDAP_DECODING_ERROR);
        }
 
index 6a031dde6f89c375c8fbfd85656fe21aa4900fbd..43b5d9e55f053e73e9b665544fa9b4708de0d9de 100644 (file)
@@ -218,7 +218,7 @@ static int package(struct pack_desc* p, ...)
 {
   va_list args;
   int needed=0, stringneeded;
-  char* str=NULL;
+  const char* str=NULL;
   int is_string=0, stringused;
   int32 temp;
 
@@ -334,7 +334,7 @@ static void PACKI(struct pack_desc* desc,char *t,int v)
   PACK(desc,t,v);
 }
 
-static void PACKS(struct pack_desc* desc,char *t,char *v)
+static void PACKS(struct pack_desc* desc,const char *t,const char *v)
 {
   PACK(desc,t,v);
 }
index 16caa8d8615089364577590f92665069767329f1..d5af6e3fb8889891427280ccd9418ca572a46082 100644 (file)
@@ -2198,6 +2198,8 @@ int net_rpc_usage(int argc, const char **argv)
        d_printf("  net rpc file \t\t\tto list open files\n");
        d_printf("  net rpc changetrustpw \tto change the trust account password\n");
        d_printf("  net rpc getsid \t\tfetch the domain sid into the local secrets.tdb\n");
+       d_printf("  net rpc vampire \t\tsyncronise an NT PDC's users and groups into the local passdb\n");
+       d_printf("  net rpc samdump \t\tdiplay an NT PDC's users, groups and other data\n");
        d_printf("  net rpc trustdom \t\tto create trusting domain's account\n"
                 "\t\t\t\t\tor establish trust\n");
        d_printf("  net rpc abortshutdown \tto abort the shutdown of a remote server\n");