[28306] in Source-Commits
Re: dconf-config commit: Initial check-in of dconf-config
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Sun Jul 6 11:07:08 2014
Date: Sun, 6 Jul 2014 11:06:57 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201406161943.s5GJhdUR008344@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1407061103260.17412@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
I think a little more paranoid shell quoting may be needed in these new
files. (Though, maybe Anders will tell me I'm wrong.)
On Mon, 16 Jun 2014, Jonathan D Reed wrote:
> https://github.com/mit-athena/dconf-config/commit/bdde42c7ba8495a6acf96e2b834e2f560546b468
> commit bdde42c7ba8495a6acf96e2b834e2f560546b468
> Author: Jonathan Reed <jdreed@mit.edu>
> Date: Mon Jun 16 15:42:56 2014 -0400
>
> Initial check-in of dconf-config
>
> diff --git a/debian/10debathena-copy-dconf b/debian/10debathena-copy-dconf
> new file mode 100644
> index 0000000..adfd58c
> --- /dev/null
> +++ b/debian/10debathena-copy-dconf
> +get_user_dconf_profile() {
> + profile=
> + if [ -f "/etc/dconf/profile/user" ]; then
> + profile=$(awk -F: '/^user-db/ { print $2}' /etc/dconf/profile/user)
> + fi
> + USER_PROFILE="${profile:-user}"
These quotes don't do much if word-splitting was already performed when
setting the value of 'profile'?
> +}
> +
> +ATHENA_DCONF_PROFILE=/etc/dconf/profile/athena_user
> +PROFILE_DIR=${XDG_CONFIG_HOME:-"$HOME/.config"}/dconf
What ensures that the expansion of XDG_CONFIG_HOME contains no whitespace?
> +if [ -f "$ATHENA_DCONF_PROFILE" ] && \
> + [ "$DEBATHENA_HOME_TYPE" = afs ] && \
[...]
> diff --git a/debian/generate_dconf_user.sh b/debian/generate_dconf_user.sh
> new file mode 100755
> index 0000000..736b8a5
> --- /dev/null
> +++ b/debian/generate_dconf_user.sh
> @@ -0,0 +1,13 @@
> +#!/bin/sh
> +
> +user_db="user"
> +codename=$(lsb_release -sc 2>/dev/null)
Paranoid quoting would also quote this expansion, I think.
-Ben
> +if [ -n "$codename" ]; then
> + # Profile names may only contain [[:alnum:]] and '_'
> + user_db="user_${codename}"
> +fi
> +
> +cat <<EOF
> +user-db:${user_db}
> +system-db:athena
> +EOF