Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In makefile, i used 'install' command as below

command:'install -o 1010 -g 100 -m 0755 -D path'

instead of checking user name and group name i would like to check uid and gid.

Consider the following scenario.

Step 1:

System 1: User corresponding to UID 1010 is “XXXX”. Using “System 1” create RPM installer.

Step 2:

System 2: User corresponding to UID 1010 is “YYYY” While installing RPM file we get a warning message saying “warning: user XXXX does not exist – using root”

In this step i assume the logged in user’s UID should be equal to “1010” for the RPM installer to install successfully. But what actually happens is, the RPM installer expects the user name to be equal in the installation system

share|improve this question

migrated from stackoverflow.com Jul 8 '12 at 23:32

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

Well, across different machines the uid/oid/gid can have different values unless you're using something like LDAP. Even then, the users which are defined on your system will have their own id-s. There is no guarantee that the user will exist on another machine.

Perhaps you should further explain your use case?

share|improve this answer
add comment

Use the %files section of your RPM's .spec file to set the ownership expected on the installed system (System 2 in your question).

You may also use the %pre section of your RPM's .spec file to determine if the expected users and groups actually exist on the installed system (System 2 in your question).

%files
# Set file permissions and ownership

%pre
# Check if expected user 'myuser' exists. If not, exit with an error.
# Check if expected group 'mygroup' exists. If not, exit with an error

Further reading at rpm.org.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.