nixpkgs/pkgs/by-name/li/libutempter/exec_path.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

33 lines
851 B
Diff

diff --git a/libutempter/iface.c b/libutempter/iface.c
index 37c74a8..6f44c9a 100644
--- a/libutempter/iface.c
+++ b/libutempter/iface.c
@@ -43,7 +43,7 @@
__result; }))
#endif
-#define UTEMPTER_DEFAULT_PATHNAME LIBEXECDIR "/utempter/utempter"
+#define UTEMPTER_DEFAULT_PATHNAME "utempter"
static const char *utempter_pathname;
static int saved_fd = -1;
@@ -57,8 +57,8 @@ do_child(int master_fd, const char *path, char *const *argv)
_exit(EXIT_FAILURE);
}
- execv(path, argv);
- print_dbg("execv: %s", strerror(errno));
+ execvp(path, argv);
+ print_dbg("execvp: %s", strerror(errno));
while (EACCES == errno) {
/* try saved group ID */
@@ -73,7 +73,7 @@ do_child(int master_fd, const char *path, char *const *argv)
if (setgid(sgid))
break;
- (void) execv(path, argv);
+ (void) execvp(path, argv);
break;
}