Make dptr_path() and dptr_wcard() const.
authorJeremy Allison <jra@samba.org>
Sat, 25 Feb 2012 01:12:52 +0000 (17:12 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 25 Feb 2012 01:12:52 +0000 (17:12 -0800)
source3/smbd/dir.c
source3/smbd/proto.h
source3/smbd/trans2.c

index d8e26f6912e458110dacc6e12839ea1da354ab47..f3cc36e872e2c0cc02ffdcc73d62d2d341a167c6 100644 (file)
@@ -215,7 +215,7 @@ static struct dptr_struct *dptr_get(struct smbd_server_connection *sconn,
  Get the dir path for a dir index.
 ****************************************************************************/
 
-char *dptr_path(struct smbd_server_connection *sconn, int key)
+const char *dptr_path(struct smbd_server_connection *sconn, int key)
 {
        struct dptr_struct *dptr = dptr_get(sconn, key, false);
        if (dptr)
@@ -227,7 +227,7 @@ char *dptr_path(struct smbd_server_connection *sconn, int key)
  Get the dir wcard for a dir index.
 ****************************************************************************/
 
-char *dptr_wcard(struct smbd_server_connection *sconn, int key)
+const char *dptr_wcard(struct smbd_server_connection *sconn, int key)
 {
        struct dptr_struct *dptr = dptr_get(sconn, key, false);
        if (dptr)
index 8124ee9de84a1a2cb078855fb97f8e6b4fe50f6f..4ec91a11dbf2e72c5916aee3ad88017abeedd711 100644 (file)
@@ -189,8 +189,8 @@ bool make_dir_struct(TALLOC_CTX *ctx,
                        time_t date,
                        bool uc);
 bool init_dptrs(struct smbd_server_connection *sconn);
-char *dptr_path(struct smbd_server_connection *sconn, int key);
-char *dptr_wcard(struct smbd_server_connection *sconn, int key);
+const char *dptr_path(struct smbd_server_connection *sconn, int key);
+const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
 uint16 dptr_attr(struct smbd_server_connection *sconn, int key);
 void dptr_close(struct smbd_server_connection *sconn, int *key);
 void dptr_closecnum(connection_struct *conn);
index d2eff4d8f5dcc80f9aac58a91a63af56980e9bd0..5ee02c4278e7c6cebb345c06c8977239fb4ab143 100644 (file)
@@ -2773,14 +2773,12 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
        directory = dptr_path(sconn, dptr_num);
 
        /* Get the wildcard mask from the dptr */
-       if((p = dptr_wcard(sconn, dptr_num))== NULL) {
+       if((mask = dptr_wcard(sconn, dptr_num))== NULL) {
                DEBUG(2,("dptr_num %d has no wildcard\n", dptr_num));
                reply_nterror(req, STATUS_NO_MORE_FILES);
                return;
        }
 
-       mask = p;
-
        /* Get the attr mask from the dptr */
        dirtype = dptr_attr(sconn, dptr_num);