Skip to content

Commit ab07022

Browse files
committed
[copyright + license] Fix headers
Replace the header from source code files using the following script: ```Python for dir_path, dir_names, file_names in os.walk("flare-floss"): for file_name in file_names: try: file_path = f"{dir_path}/{file_name}" f = open(file_path, "rb+") content = f.read() m = re.search(OLD_HEADER, content) if not m: continue print(f"{file_path}: {m.group('year')}") content = content.replace(m.group(0), NEW_HEADER % m.group("year")) f.seek(0) f.write(content) except: continue ``` Some files had the copyright headers inside a `"""` comment and needed manual changes before applying the script. The old header had the confusing sentence `All rights reserved`, which does not make sense for an open source license. Replace the header by the default Google header that corrects this issue and keep floss consistent with other Google projects.
1 parent 8d58e82 commit ab07022

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+623
-91
lines changed

Diff for: .github/pyinstaller/floss.spec

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# -*- mode: python -*-
2-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2017 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
317
import subprocess
418

519
# when invoking pyinstaller from the project root,

Diff for: .github/pyinstaller/hooks/hook-vivisect.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
from PyInstaller.utils.hooks import copy_metadata
417

Diff for: floss/api_hooks.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import contextlib
417
from typing import Any, List, Tuple

Diff for: floss/const.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
KILOBYTE = 1024
417
MEGABYTE = 1024 * KILOBYTE

Diff for: floss/decoding_manager.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
from typing import List, Tuple
417
from dataclasses import dataclass

Diff for: floss/features/extract.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215
from typing import Any, Tuple, Callable, Iterator
316

417
import envi

Diff for: floss/features/features.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import floss.identify
417

Diff for: floss/function_argument_getter.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import contextlib
417
from typing import Set, List

Diff for: floss/identify.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import copy
417
import operator

Diff for: floss/language/go/coverage.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215
import sys
316
import logging
417
import pathlib

Diff for: floss/language/go/extract.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import re
417
import sys

Diff for: floss/language/identify.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import re
417
from enum import Enum

Diff for: floss/language/rust/coverage.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import sys
417
import logging

Diff for: floss/language/rust/extract.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215
import sys
316
import logging
417
import pathlib

Diff for: floss/language/rust/rust_version_database.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2023 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
#############################################################################################
417
# File: rust_version_database.py

Diff for: floss/logging_.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import logging
417
from enum import Enum

Diff for: floss/main.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
2+
# Copyright 2017 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
316
import os
417
import sys
518
import codecs

Diff for: floss/render/default.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import io
417
import sys

Diff for: floss/render/json.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2022 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import json
417
import datetime

Diff for: floss/render/sanitize.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Copyright (C) 2017 Mandiant, Inc. All Rights Reserved.
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
215

316
import string
417

0 commit comments

Comments
 (0)