Various winbind updates:
authorAndrew Bartlett <abartlet@samba.org>
Sat, 23 Mar 2002 08:28:19 +0000 (08:28 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 23 Mar 2002 08:28:19 +0000 (08:28 +0000)
- pam_winbind updates from vance, fixing a typo and making some the options
  work properly.

- Extra parinoia in the winbind connection loop

- Allow pam_winbind to compile on HP-UX (Don Mcall, more work to do).

- Fix up configure.in to use the same method for building the test .so
  as the Makefile uses.

Andrew Bartlett

source/configure.in
source/nsswitch/pam_winbind.c
source/nsswitch/pam_winbind.h
source/nsswitch/winbindd_cm.c
source/nsswitch/winbindd_pam.c

index 3610b37b2533c10955f629fddb0335997af844c9..59df6e809915056cb3f89567dbd477b1131522a7 100644 (file)
@@ -763,8 +763,9 @@ case "$host_os" in
                        SHLIBEXT="sl"
                        # Use special PIC flags for the native HP-UX compiler.
                        if test $ac_cv_prog_cc_Ae = yes; then
-                               #BLDSHARED="true"
-                               LDSHFLAGS="-b -z +h \$@"
+                               SHLD="/usr/bin/ld"
+                               BLDSHARED="true"
+                               LDSHFLAGS="-B symbolic -b -z +h \$@"
                                PICFLAG="+z"
                        fi
                        DYNEXP="-Wl,-E"
@@ -823,7 +824,7 @@ AC_CACHE_CHECK([whether building shared libraries actually 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 &&
+     $SHLD $CPPFLAGS $CFLAGS $LDSHFLAGS -o shlib.so shlib.po &&
      ac_cv_shlib_works=yes
    rm -f shlib.so shlib.po
 ])
index 42cc29f3207f90b0b53a15e7655c39a988a6ebef..cad75f7907bec6ebe552adc7c3913ca764997d93 100644 (file)
@@ -45,9 +45,9 @@ static int _pam_parse(int argc, const char **argv)
                else if (!strcasecmp(*argv, "use_authtok"))
                        ctrl |= WINBIND_USE_AUTHTOK_ARG;
                else if (!strcasecmp(*argv, "use_first_pass"))
-                       ctrl |= WINBIND_TRY_FIRST_PASS_ARG;
-               else if (!strcasecmp(*argv, "try_first_pass"))
                        ctrl |= WINBIND_USE_FIRST_PASS_ARG;
+               else if (!strcasecmp(*argv, "try_first_pass"))
+                       ctrl |= WINBIND_TRY_FIRST_PASS_ARG;
                else if (!strcasecmp(*argv, "unknown_ok"))
                        ctrl |= WINBIND_UNKNOWN_OK_ARG;
                else {
@@ -405,7 +405,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
                                     &password);
      
      if (retval != PAM_SUCCESS) {
-        _pam_log(LOG_ERR, "Could not retrive user's password");
+        _pam_log(LOG_ERR, "Could not retrieve user's password");
         return PAM_AUTHTOK_ERR;
      }
      
index 93d9ec9e735d67e6bfc03fb28254e7d571dc6d41..9897249e164101a19c78304785c87c4f045d8739 100644 (file)
@@ -25,7 +25,7 @@
 #define PAM_SM_ACCOUNT
 #define PAM_SM_PASSWORD
 
-#if defined(SUNOS5) || defined(SUNOS4)
+#if defined(SUNOS5) || defined(SUNOS4) || defined(HPUX)
 
 /* Solaris always uses dynamic pam modules */
 #define PAM_EXTERN extern
index 03a8e3cdd1e1b15930e30bfbaa27ecee2aa48d24..f4abf86c47d0c45107ca4a7bc34e05ed6edf7992 100644 (file)
@@ -415,6 +415,7 @@ static NTSTATUS get_connection_from_cache(const char *domain, const char *pipe_n
                                if (conn->cli) {
                                        cli_shutdown(conn->cli);
                                }
+                               ZERO_STRUCT(conn_temp);
                                conn_temp.next = conn->next;
                                DLIST_REMOVE(cm_conns, conn);
                                SAFE_FREE(conn);
@@ -426,7 +427,7 @@ static NTSTATUS get_connection_from_cache(const char *domain, const char *pipe_n
        }
        
        if (!conn) {
-               if (!(conn = (struct winbindd_cm_conn *) malloc(sizeof(struct winbindd_cm_conn))))
+               if (!(conn = malloc(sizeof(*conn))))
                        return NT_STATUS_NO_MEMORY;
                
                ZERO_STRUCTP(conn);
index 6a7afd2b3b09686f48065da18e5c038413da2512..2fa346151ee493d9ba9355356df65ba5853367e4 100644 (file)
@@ -189,7 +189,7 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
         result = cm_get_netlogon_cli(lp_workgroup(), trust_passwd, &cli);
 
         if (!NT_STATUS_IS_OK(result)) {
-                DEBUG(3, ("could not open handle to NETLOGON pipe\n"));
+                DEBUG(3, ("could not open handle to NETLOGON pipe (error: %s)\n", nt_errstr(result)));
                 goto done;
         }