[MacPorts] #22798: signing-party port is missing a dependency to "getent"
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: --------------------------------------+------------------------------------- B$ gpg-mailkeys KEYIDMASKED /opt/local/bin/gpg-mailkeys: line 54: getent: command not found Looks like getent isn't available on OS-X, due to weirdness in NetInfo and DirectoryServices vs Linux user management. Looks like it's simply puling out the current user's name: getent passwd $USER | cut -d: -f5 | cut -d, -f1 We could use a fake script called getent like this: #!/bin/bash # This file will not be consulted for authentication unless the BSD local node #!/bin/bash if [ -z $1 ]; then echo "You must specify an user" exit 1 else echo `dscl . -read /Users/$2 RecordName | sed 's/RecordName: //g'`:*:`dscl . -read /Users/$2 UniqueID | sed 's/UniqueID: //g'`:`dscl . -read /Users/$2 PrimaryGroupID | sed 's/PrimaryGroupID: //g'`:`dscl . -read /Users/$2 RealName | sed -e 's/RealName://g' -e 's/^ //g' | awk '{printf("%s", $0 (NR==1 ? "" : ""))}'`:/Users/$2:`dscl . -read /Users/$2 UserShell | sed 's/UserShell: //g'` fi exit 0 -- Ticket URL: <http://trac.macports.org/ticket/22798> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: --------------------------------------+------------------------------------- Comment(by brian.gupta@…): Opps try this: #!/bin/bash if [ -z $1 ]; then echo "You must specify an user" exit 1 else echo dscl . -read /Users/$2 RecordName | sed 's/RecordName: //g':*:dscl . -read /Users/$2 UniqueID | sed 's/UniqueID: //g':dscl . -read /Users/$2 PrimaryGroupID | sed 's/PrimaryGroupID: //g':dscl . -read /Users/$2 RealName | sed -e 's/RealName://g' -e 's/^ //g' | awk '{printf("%s", $0 (NR==1 ? "" : ""))}':/Users/$2:dscl . -read /Users/$2 UserShell | sed 's/UserShell: //g' fi exit 0 -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: --------------------------------------+------------------------------------- Comment(by brian.gupta@…): Find another missing deplendcy: qprint. http://www.fourmilab.ch/webtools/qprint/ Replying to [ticket:22798 brian.gupta@…]:
B$ gpg-mailkeys KEYIDMASKED /opt/local/bin/gpg-mailkeys: line 54: getent: command not found
Looks like getent isn't available on OS-X, due to weirdness in NetInfo and DirectoryServices vs Linux user management.
Looks like it's simply puling out the current user's name: getent passwd $USER | cut -d: -f5 | cut -d, -f1
We could use a fake script called getent like this:
#!/bin/bash # This file will not be consulted for authentication unless the BSD local node #!/bin/bash if [ -z $1 ]; then echo "You must specify an user" exit 1 else echo `dscl . -read /Users/$2 RecordName | sed 's/RecordName: //g'`:*:`dscl . -read /Users/$2 UniqueID | sed 's/UniqueID: //g'`:`dscl . -read /Users/$2 PrimaryGroupID | sed 's/PrimaryGroupID: //g'`:`dscl . -read /Users/$2 RealName | sed -e 's/RealName://g' -e 's/^ //g' | awk '{printf("%s", $0 (NR==1 ? "" : ""))}'`:/Users/$2:`dscl . -read /Users/$2 UserShell | sed 's/UserShell: //g'` fi
exit 0
-- Ticket URL: <http://trac.macports.org/ticket/22798#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: signing-party --------------------------------------+------------------------------------- Changes (by jmr@…): * owner: macports-tickets@… => milosh@… * port: => signing-party Old description:
B$ gpg-mailkeys KEYIDMASKED /opt/local/bin/gpg-mailkeys: line 54: getent: command not found
Looks like getent isn't available on OS-X, due to weirdness in NetInfo and DirectoryServices vs Linux user management.
Looks like it's simply puling out the current user's name: getent passwd $USER | cut -d: -f5 | cut -d, -f1
We could use a fake script called getent like this:
#!/bin/bash # This file will not be consulted for authentication unless the BSD local node #!/bin/bash if [ -z $1 ]; then echo "You must specify an user" exit 1 else echo `dscl . -read /Users/$2 RecordName | sed 's/RecordName: //g'`:*:`dscl . -read /Users/$2 UniqueID | sed 's/UniqueID: //g'`:`dscl . -read /Users/$2 PrimaryGroupID | sed 's/PrimaryGroupID: //g'`:`dscl . -read /Users/$2 RealName | sed -e 's/RealName://g' -e 's/^ //g' | awk '{printf("%s", $0 (NR==1 ? "" : ""))}'`:/Users/$2:`dscl . -read /Users/$2 UserShell | sed 's/UserShell: //g'` fi
exit 0
New description: B$ gpg-mailkeys KEYIDMASKED /opt/local/bin/gpg-mailkeys: line 54: getent: command not found Looks like getent isn't available on OS-X, due to weirdness in NetInfo and DirectoryServices vs Linux user management. Looks like it's simply puling out the current user's name: getent passwd $USER | cut -d: -f5 | cut -d, -f1 We could use a fake script called getent like this: {{{ #!/bin/bash # This file will not be consulted for authentication unless the BSD local node #!/bin/bash if [ -z $1 ]; then echo "You must specify an user" exit 1 else echo `dscl . -read /Users/$2 RecordName | sed 's/RecordName: //g'`:*:`dscl . -read /Users/$2 UniqueID | sed 's/UniqueID: //g'`:`dscl . -read /Users/$2 PrimaryGroupID | sed 's/PrimaryGroupID: //g'`:`dscl . -read /Users/$2 RealName | sed -e 's/RealName://g' -e 's/^ //g' | awk '{printf("%s", $0 (NR==1 ? "" : ""))}'`:/Users/$2:`dscl . -read /Users/$2 UserShell | sed 's/UserShell: //g'` fi exit 0 }}} -- -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: signing-party --------------------------------------+------------------------------------- Comment(by milosh@…): Is this really this difficult to get a line like {{{ milosh:x:1000:1000:Full Name:/home/milosh:/bin/zsh }}} on osx? There is no /etc/passwd file? -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: signing-party --------------------------------------+------------------------------------- Comment(by brian.gupta@…): It sadly is so difficult because basically you have to pull the info out of Apple's DirectoryServices daemon, which is the successor to the NextStep netinfo tools. This has it's pluses and minuses. Key minus being incompatibility with legacy UNIX/Linux tools. -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: signing-party --------------------------------------+------------------------------------- Comment(by milosh@…): On the mac I tested, there is a /etc/passwd file. So I propose as a replacement for getent the following script: {{{ #! /bin/sh if [ $# -eq 1 ] && [ $1 = 'passwd' ]; then cat /etc/passwd elif [ $# -eq 2 ] && [ $1 = 'passwd' ]; then grep ^$2 /etc/passwd else echo "getent: wrong number of arguments" exit 1 fi }}} -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" --------------------------------------+------------------------------------- Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: signing-party --------------------------------------+------------------------------------- Comment(by brian.gupta@…): /etc/passwd is a legecy file that won't have a user's entry in it. From: http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPag... "The /etc/passwd file is a legacy BSD 4.3 format file. It is mostly unused, but is updated by some utility programs. Its format is similar to the /etc/master.passwd file, except that it does not con-tain containtain the class, change, and expire fields described below." Thus we do need to either use the getent I provided, or we need to succesfully push changes to support Mac OS-X dscl upstream. (into the Debian project). Cheers, Brian -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#22798: signing-party port is missing a dependency to "getent" ---------------------------------------+------------------------------------ Reporter: brian.gupta@… | Owner: milosh@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: fixed | Keywords: Port: signing-party | ---------------------------------------+------------------------------------ Changes (by milosh@…): * status: new => closed * resolution: => fixed Comment: Resolved in r61387 -- Ticket URL: <http://trac.macports.org/ticket/22798#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts