Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #261 from ospalax/enforce-lang-c
Browse files Browse the repository at this point in the history
B #251: Enforce POSIX C locale
  • Loading branch information
Petr Ospalý committed May 3, 2022
2 parents 40efc92 + 8c875a1 commit 6c18bfb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/usr/sbin/one-contextd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# -------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
Expand All @@ -18,6 +18,23 @@

set -e

# Save original locale variables and enforce POSIX C locale
#
# We provide the user a way to fallback to the correct locale when a command
# should or must respect system's locale by saving the original values into the
# '_one_orig*' variables...

export _one_orig_LANG="${LANG}"
export _one_orig_LC_ALL="${LC_ALL}"
export _one_orig_LC_COLLATE="${LC_COLLATE}"
export _one_orig_LC_CTYPE="${LC_CTYPE}"
export _one_orig_LC_MESSAGES="${LC_MESSAGES}"
export _one_orig_LC_MONETARY="${LC_MONETARY}"
export _one_orig_LC_NUMERIC="${LC_NUMERIC}"
export _one_orig_LC_TIME="${LC_TIME}"
export LANG=C
export LC_ALL=C

TYPE="${1:-all}" # local, online, network, all
COMMAND="${2}" # force, reconfigure?

Expand Down

0 comments on commit 6c18bfb

Please sign in to comment.