rpc_server/srv_netlog.c: Fixed crash bug with ACB_PWNOTREQ.
authorJeremy Allison <jra@samba.org>
Wed, 11 Nov 1998 23:25:51 +0000 (23:25 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 11 Nov 1998 23:25:51 +0000 (23:25 +0000)
script/makeyodldocs.sh: Added code to make text docs for non-man page YODL docs.
web/cgi.c web/swat.c: SGI compiler warnings fixed.
Jeremy.

source/include/proto.h
source/rpc_server/srv_netlog.c
source/script/makeyodldocs.sh
source/web/cgi.c
source/web/swat.c

index cce55a47cd4871f7ba3258ee77b006bc2c86ca02..6bb801b633e8fd6b8bc003c37de034246e06d10e 100644 (file)
@@ -2629,6 +2629,8 @@ int smbw_stat(const char *fname, struct stat *st);
 
 void cgi_load_variables(FILE *f1);
 char *cgi_variable(char *name);
+BOOL is_root(void);
+char *get_user_name(void);
 void cgi_setup(char *rootdir, int auth_required);
 char *cgi_baseurl(void);
 char *cgi_pathinfo(void);
index de3eaf9bd9c591972a370e97f4bd4e4174af4947..f93d09b3ba91f1eccba258291e4c4c0d35f026ae 100644 (file)
@@ -544,8 +544,7 @@ static uint32 net_login_interactive(NET_ID_INFO_1 *id1,
  net_login_network:
  *************************************************************************/
 static uint32 net_login_network(NET_ID_INFO_2 *id2,
-                               struct smb_passwd *smb_pass,
-                               user_struct *vuser)
+                               struct smb_passwd *smb_pass)
 {
        DEBUG(5,("net_login_network: lm_len: %d nt_len: %d\n",
                id2->hdr_lm_chal_resp.str_str_len, 
@@ -674,15 +673,17 @@ static void api_net_sam_logon( uint16 vuid,
     smb_pass = getsmbpwnam(samlogon_user);
     unbecome_root(True);
 
-    if (smb_pass == NULL)
+    if (smb_pass->acct_ctrl & ACB_PWNOTREQ)
+      status = 0;
+    else if (smb_pass == NULL)
       status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
     else if (smb_pass->acct_ctrl & ACB_DISABLED)
       status =  0xC0000000 | NT_STATUS_ACCOUNT_DISABLED;
   }
 
-  /* validate password. */
+  /* Validate password - if required. */
 
-  if (status == 0)
+  if ((status == 0) && !(smb_pass->acct_ctrl & ACB_PWNOTREQ))
   {
     switch (q_l.sam_id.logon_level)
     {
@@ -695,7 +696,7 @@ static void api_net_sam_logon( uint16 vuid,
       case NET_LOGON_TYPE:
       {
         /* network login.  lm challenge and 24 byte responses */
-        status = net_login_network(&q_l.sam_id.ctr->auth.id2, smb_pass, vuser);
+        status = net_login_network(&q_l.sam_id.ctr->auth.id2, smb_pass);
         break;
       }
     }
index 16a905c6e1ad5d8bad4273e06aaa669c48f33057..c943224fe5b964dea1cb28069c700bf44b8f97ba 100755 (executable)
@@ -67,7 +67,7 @@ do
                        ;;
                *)
 #
-# Non man-page YODL docs - just make html.
+# Non man-page YODL docs - just make html and text.
 #
                        echo $d
                        rm -f $bn.html
@@ -78,6 +78,14 @@ do
             fi
                        cp $bn.html ../htmldocs || echo "Cannot create $YODLDIR/../htmldocs/$bn.html"
                        rm -f $bn.html
+                       rm -f $bn.txt
+                       yodl2txt $d
+                       if [ ! -f $bn.txt ]; then
+                echo "Failed to make text page for $d"
+                exit 1
+            fi
+                       cp $bn.txt ../textdocs || echo "Cannot create $YODLDIR/../textdocs/$bn.txt"
+                       rm -f $bn.txt
                ;;
        esac
 done
index a11abe074e621c1a4181e7caa63ce0362231fe6e..86366d1083f980824f593b1b638db291cd3cad09 100644 (file)
@@ -321,7 +321,7 @@ static int cgi_handle_authorization(char *line)
 /***************************************************************************
 is this root?
   ***************************************************************************/
-BOOL is_root()
+BOOL is_root(void)
 {
        if ((C_user) && (strcmp(C_user,"root") == 0)) {
                return( True);
@@ -333,7 +333,7 @@ BOOL is_root()
 /***************************************************************************
 return a ptr to the users name
   ***************************************************************************/
-char * get_user_name()
+char *get_user_name(void)
 {
         return(C_user);
 }
index 81dca8fc049e07a241d1a18026a37d96278b99f9..da032e077d494e719ed6f3fd6960d9d424d46230 100644 (file)
@@ -621,7 +621,6 @@ static BOOL talk_to_smbpasswd(char *old, char *new)
                int     to_child    = fd1[1];
                int     from_child  = fd2[0];
                int     wstat;
-               pid_t   wpid;
 
                close(fd1[0]); /* parent doesn't need input  side of pipe fd1 */
                close(fd2[1]); /* parent doesn't need output side of pipe fd2 */
@@ -661,7 +660,7 @@ static BOOL talk_to_smbpasswd(char *old, char *new)
                /*
                 * Wait for smbpasswd to finish
                 */
-               if ((wpid = sys_waitpid(pid, &wstat, 0)) < 0) {
+               if (sys_waitpid(pid, &wstat, 0) < 0) {
                        printf("<p> problem waiting");
                }
 
@@ -919,9 +918,8 @@ static void chg_passwd(void)
 ****************************************************************************/
 static void passwd_page(void)
 {
-       char *s, *new_name;
+       char *new_name;
        int i;
-       extern char * get_user_name();
 
        printf("<H2>Password Manager</H2>\n");
 
@@ -962,7 +960,7 @@ static void passwd_page(void)
         * If we don't have user information then there's nothing to do. It's probably
         * the first time through this code.
         */
-       if (s = cgi_variable(user)) {
+       if (cgi_variable(user)) {
                chg_passwd();           
        }