search for: read_user_detail

Displaying 2 results from an estimated 2 matches for "read_user_detail".

2016 May 19
2
[PATCH 1/2] customize: minor function factoring in ssh_key
.../ssh_key.ml b/customize/ssh_key.ml index a4e4a51..7c482e7 100644 --- a/customize/ssh_key.ml +++ b/customize/ssh_key.ml @@ -106,13 +106,15 @@ let do_ssh_inject_unix (g : Guestfs.guestfs) user selector = (* Get user's home directory. *) g#aug_init "/" 0; - let home_dir = + let read_user_detail what = try - let expr = sprintf "/files/etc/passwd/%s/home" user in + let expr = sprintf "/files/etc/passwd/%s/%s" user what in g#aug_get expr with G.Error _ -> error (f_"ssh-inject: the user %s does not exist on the guest") -...
2016 May 19
0
[PATCH 2/2] customize: fix ownership when creating ~/.ssh/authorized_keys (RHBZ#1337561)
...ged, 6 insertions(+), 2 deletions(-) diff --git a/customize/ssh_key.ml b/customize/ssh_key.ml index 7c482e7..d05816c 100644 --- a/customize/ssh_key.ml +++ b/customize/ssh_key.ml @@ -115,20 +115,24 @@ let do_ssh_inject_unix (g : Guestfs.guestfs) user selector = user in let home_dir = read_user_detail "home" in + let uid = int_of_string (read_user_detail "uid") in + let gid = int_of_string (read_user_detail "gid") in g#aug_close (); (* Create ~user/.ssh if it doesn't exist. *) let ssh_dir = sprintf "%s/.ssh" home_dir in if not (g#exists...