Make sure we mark the assumption of a fstring parameter for 'devicetype'
authorAndrew Bartlett <abartlet@samba.org>
Sun, 16 Mar 2003 13:24:36 +0000 (13:24 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 16 Mar 2003 13:24:36 +0000 (13:24 +0000)
in the function prototype, and change callers to respect this.

Andrew Bartlett

source/rpc_server/srv_srvsvc_nt.c
source/smbd/reply.c
source/smbd/service.c

index 6d2320d67d30ff7ad63b5c164443d8746a9a670d..815dd75d2261c4b2875f870ee7629ead35a1fef6 100644 (file)
@@ -1840,6 +1840,8 @@ WERROR _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
        struct current_user user;
        connection_struct *conn = NULL;
        BOOL became_user = False; 
+       fstring dev;
+       fstrcpy(dev, "A:");
 
        ZERO_STRUCT(st);
 
@@ -1853,7 +1855,7 @@ WERROR _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
        get_current_user(&user, p);
 
        become_root();
-       conn = make_connection(qualname, null_pw, "A:", user.vuid, &nt_status);
+       conn = make_connection(qualname, null_pw, dev, user.vuid, &nt_status);
        unbecome_root();
 
        if (conn == NULL) {
@@ -1943,9 +1945,12 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
        struct current_user user;
        connection_struct *conn = NULL;
        BOOL became_user = False;
+       fstring dev;
+       fstrcpy(dev, "A:");
 
        ZERO_STRUCT(st);
 
+
        r_u->status = WERR_OK;
 
        unistr2_to_ascii(qualname, &q_u->uni_qual_name, sizeof(qualname));
@@ -1956,7 +1961,7 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
        get_current_user(&user, p);
 
        become_root();
-       conn = make_connection(qualname, null_pw, "A:", user.vuid, &nt_status);
+       conn = make_connection(qualname, null_pw, dev, user.vuid, &nt_status);
        unbecome_root();
 
        if (conn == NULL) {
index 80f648981a3b56a78cbf76e72fe5dc7b4bc09b88..5ca0ae52deec9a0d661bec8f2beb56db33c943bf 100644 (file)
@@ -148,7 +148,7 @@ int reply_tcon(connection_struct *conn,
        const char *service;
        pstring service_buf;
        pstring password;
-       pstring dev;
+       fstring dev;
        int outsize = 0;
        uint16 vuid = SVAL(inbuf,smb_uid);
        int pwlen=0;
@@ -204,7 +204,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
 {
        fstring service;
        DATA_BLOB password;
-       pstring devicename;
+       fstring devicename;
        NTSTATUS nt_status;
        uint16 vuid = SVAL(inbuf,smb_uid);
        int passlen = SVAL(inbuf,smb_vwv3);
index 1c7e4017b095a67ef773902c3bce0e7aa90dd9c8..a47e6c1bbc82353a3ecee2efe41b5796996fca2a 100644 (file)
@@ -218,7 +218,7 @@ int find_service(fstring service)
  do some basic sainity checks on the share.  
  This function modifies dev, ecode.
 ****************************************************************************/
-static NTSTATUS share_sanity_checks(int snum, pstring dev) 
+static NTSTATUS share_sanity_checks(int snum, fstring dev) 
 {
        
        if (!lp_snum_ok(snum) || 
@@ -233,9 +233,9 @@ static NTSTATUS share_sanity_checks(int snum, pstring dev)
        
        if (dev[0] == '?' || !dev[0]) {
                if (lp_print_ok(snum)) {
-                       pstrcpy(dev,"LPT1:");
+                       fstrcpy(dev,"LPT1:");
                } else {
-                       pstrcpy(dev,"A:");
+                       fstrcpy(dev,"A:");
                }
        }
 
@@ -248,7 +248,7 @@ static NTSTATUS share_sanity_checks(int snum, pstring dev)
 
        /* Behave as a printer if we are supposed to */
        if (lp_print_ok(snum) && (strcmp(dev, "A:") == 0)) {
-               pstrcpy(dev, "LPT1:");
+               fstrcpy(dev, "LPT1:");
        }
 
        return NT_STATUS_OK;
@@ -326,7 +326,7 @@ static void set_admin_user(connection_struct *conn, gid_t *groups, size_t n_grou
 
 static connection_struct *make_connection_snum(int snum, user_struct *vuser,
                                               DATA_BLOB password, 
-                                              char *dev, NTSTATUS *status)
+                                              fstring dev, NTSTATUS *status)
 {
        struct passwd *pass = NULL;
        BOOL guest = False;
@@ -747,7 +747,7 @@ connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB
 ****************************************************************************/
 
 connection_struct *make_connection(const char *service_in, DATA_BLOB password, 
-                                  char *dev, uint16 vuid, NTSTATUS *status)
+                                  fstring dev, uint16 vuid, NTSTATUS *status)
 {
        uid_t euid;
        user_struct *vuser = NULL;