-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save user name and group name rather than UID, GID #4
Comments
Indeed. Unfortunately, the Do you really need to save the user and group information? |
Hey thanks for responding. Ive never programmed in perl but after looking
at your code, I can't say I understand everything it does, but I definitely
was able to find the chown block and lstat statements and understood where
you were getting and setting the uid and gids. I was able to make a few
modifications to the code for it to actually store the user and group
names. I think this is a little more practical then storing uids and gids
since these numbers are likely to be different on the machines they pull
the code. It's one thing to have the same user and group names on different
machines but it's a heck of a lot more burdensome to actually have the same
uid and gids particularly if these numbers are already taken. I'm in the
process of testing things right now to see if the code actually works as
intended with the modifications. I'm working back and forth between osx,
bsd and Linux to test things. Unfortunately I don't think the code is meant
for windows and that's OK for my requirements
…On Thu, Oct 17, 2019 at 2:32 PM Christophe Drevet-Droguet < ***@***.***> wrote:
Indeed. Unfortunately, the chown perl function needs numeric IDs and
can's use names. Thus, if we want to support this, we'll have to transform
names into ids before ownership restauration.
Do you really need to save the user and group information?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=ABH75V7ZAZAAWAC76WOPDD3QPC4URA5CNFSM4JB3L4EKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRIJRA#issuecomment-543327428>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABH75V3UBP6MJ2IIVHG63FTQPC4URANCNFSM4JB3L4EA>
.
|
Ok - reviewing your code I have a question since the restore part isn't working. My setup for testing is I have a push repository (server pushing changes to git) and a pull repository (server pulling changes from git). I'd like the permissions,owner,group data to be propogated from push repository to pull repository. So the main options I don't understand (See below) -- preserve-permissions.user: true/false to save/restore uid (defaults to false) I would take this as preserve-permissions.user = true -> save permissions of user, preserve-permissions.user = true -> save permissions of user However based on this assumption, the restore isn't actually happening -- but the save is. Going with the defaults (not setting any of these variables) -- on the main/push side the file permissions (octal) and username/groupnames are saved -- after I made changes to the code to write username/groupname rather than UID/GID. Here is snippet:
However during the restore function (gpg_restore) there is a call to Within check_ids:
$options{'user'} always defaults to zero and hence this function will never return 1 and hence restore command will not get executed. So in summary to restore everything similar to permission on push server For saving the defaults can be used. |
Ok - Code tested and seems be working
Here are changes:
|
Hi - I'm working in between systems -- Mac, Linux, BSD. I have the same users and groups on all the systems however the UIDs and GIDs don't match. When I run this program on MAC to save permissions I get something like:
0775:501:20:post-merge
I believe 501 refers to UID and 20 is GID, however these aren't going to match up on the remote systems.
If they were save like
0775:kevdog:wheel:post-merge
then this would actually work.
The text was updated successfully, but these errors were encountered: