@dmnks commented on this pull request.


> @@ -0,0 +1,137 @@
+#!/bin/bash -e
+
+rpmhome=$(rpm --eval "%{xdg:config}/rpm")
+macros="macros"
+# if oldstyle config exists, then use that instead
+if [[ ! -d "${rpmhome}" && ( -f ~/.rpmmacros || -f ~/.rpmrc) ]]; then
+    rpmhome="${HOME}"
+    macros=".rpmmacros"
+fi
+mkdir -p "${rpmhome}"
+
+email="rpmbuild-${USER}@$(uname -n)"
+keypath="${rpmhome}/${email}.asc"

> Having a file with that name in your homedir seems extremely unlikely, but 
> then it IS the users homedir and we need to be careful. I guess we could 
> always mktemp it if it already exists, hmm, but actually the most likely 
> scenario for that file existing is that the user already ran this script. So 
> perhaps detecting it and erroring out early is the thing to do.

Indeed. What could happen is that `${email}` gets reset to something else in 
the script in the future (by accident) and will end up in a more generic 
filename... so better be safe than sorry when it comes to dumping stuff in 
`$HOME` :smile: And yep, we could just use it as another bail-out conditional.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3665#discussion_r2020920781
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3665/review/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to