]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Simplify clistr_is_previous_version_path()
authorVolker Lendecke <vl@samba.org>
Thu, 15 Dec 2022 18:14:48 +0000 (19:14 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 16 Dec 2022 08:42:18 +0000 (08:42 +0000)
Nobody looks at the out params anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Dec 16 08:42:18 UTC 2022 on sn-devel-184

source3/lib/util_path.c
source3/lib/util_path.h
source3/libsmb/clifile.c
source3/libsmb/clilist.c

index fc76f6fb0bbd2b55113e611b6c60605fe475ae18..9c9c6eb580733b38ae1c07fe615c57c8d9e0b5ab 100644 (file)
@@ -260,10 +260,7 @@ static bool find_snapshot_token(
        return true;
 }
 
-bool clistr_is_previous_version_path(const char *path,
-                                    const char **startp,
-                                    const char **endp,
-                                    NTTIME *ptwrp)
+bool clistr_is_previous_version_path(const char *path)
 {
        const char *start = NULL;
        const char *next = NULL;
@@ -271,20 +268,7 @@ bool clistr_is_previous_version_path(const char *path,
        bool ok;
 
        ok = find_snapshot_token(path, '\\', &start, &next, &twrp);
-       if (!ok) {
-               return false;
-       }
-
-       if (startp != NULL) {
-               *startp = start;
-       }
-       if (endp != NULL) {
-               *endp = next;
-       }
-       if (ptwrp != NULL) {
-               *ptwrp = twrp;
-       }
-       return true;
+       return ok;
 }
 
 static bool extract_snapshot_token_internal(char *fname, NTTIME *twrp, char sep)
index 7dd307f44dc5d8fed7e7ea157b1687d9f9f6c6a3..9dcc1dd23cac3c95422c113a6b4d965fe157c8fe 100644 (file)
@@ -46,10 +46,7 @@ char *cache_path(TALLOC_CTX *mem_ctx, const char *name);
 char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path);
 bool extract_snapshot_token(char *fname, NTTIME *twrp);
 bool clistr_smb2_extract_snapshot_token(char *fname, NTTIME *twrp);
-bool clistr_is_previous_version_path(const char *path,
-                                    const char **startp,
-                                    const char **endp,
-                                    NTTIME *ptwrp);
+bool clistr_is_previous_version_path(const char *path);
 bool subdir_of(const char *parent,
               size_t parent_len,
               const char *subdir,
index 91bb1095643657befb56196a757391dc05e1297a..13619c7420963bd2f69ec15d5b0b505ce4724aad 100644 (file)
@@ -79,7 +79,7 @@ struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(path, NULL, NULL, NULL) &&
+       if (clistr_is_previous_version_path(path) &&
                        !INFO_LEVEL_IS_UNIX(level)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
@@ -1332,7 +1332,7 @@ static struct tevent_req *cli_cifs_rename_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname_src, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname_src)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -1558,7 +1558,7 @@ static struct tevent_req *cli_ntrename_internal_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname_src, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname_src)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -2009,7 +2009,7 @@ struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -2141,7 +2141,7 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(dname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(dname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -2280,7 +2280,7 @@ struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(dname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(dname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -2549,7 +2549,7 @@ static struct tevent_req *cli_ntcreate1_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -2896,7 +2896,7 @@ struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -3136,7 +3136,7 @@ struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -4363,7 +4363,7 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -4676,7 +4676,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -4836,7 +4836,7 @@ struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(fname)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -5182,7 +5182,7 @@ struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(path, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(path)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -6574,7 +6574,7 @@ struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(fname, NULL, NULL, NULL) &&
+       if (clistr_is_previous_version_path(fname) &&
                        !INFO_LEVEL_IS_UNIX(level)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
index c41ba93cd255bd6d14036cdab1f9007ecd692490..903c5d227771561f63f79346912f3c16539e06ff 100644 (file)
@@ -700,7 +700,7 @@ static struct tevent_req *cli_list_trans_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (clistr_is_previous_version_path(state->mask, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(state->mask)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }
 
@@ -901,7 +901,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
        }
        param_len = talloc_get_size(state->param);
 
-       if (clistr_is_previous_version_path(state->mask, NULL, NULL, NULL)) {
+       if (clistr_is_previous_version_path(state->mask)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;
        }