IDcheck.sh - awk problem
Hi All,
There will be good to prevent missing /etc/passwd for installing to different folder.
export DESTDIR=pwd/nfs
mkdir -p nfs
make install
Thanks,
Michal
Checking for required user/group ids
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
sys => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
users => 2
'nobody' user id and group found.
'bin' user id and group found.
'daemon' user id and group found.
Users group found.
Sys group found.
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
users => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
sys => 2
Required users/groups exist.
Signature · 15 lines
Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 77 lines · Michal Simek
Hi All,
There will be good to prevent missing
/etc/passwdfor installing to different folder.export DESTDIR=
pwd/nfs
mkdir -p nfs
make installThanks,
MichalChecking for required user/group ids
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
sys => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
users => 2
'nobody' user id and group found.
'bin' user id and group found.
'daemon' user id and group found.
Users group found.
Sys group found.
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file
Quoted 8 lines
`/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
users => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
sys => 2
Required users/groups exist.
That's part of the reason why I wanted it to be reviewed before it was committed, and I halfway expected Mike to provide that assistance but he didn't... *sigh*.
Does the /etc/passwd // /etc/group file exist?
Thanks,
-Garrett
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 89 lines · Garrett Cooper
Quoted 77 lines · Michal Simek
Hi All,
There will be good to prevent missing
/etc/passwdfor installing to different folder.export DESTDIR=
pwd/nfs
mkdir -p nfs
make installThanks,
MichalChecking for required user/group ids
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
sys => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
users => 2
'nobody' user id and group found.
'bin' user id and group found.
'daemon' user id and group found.
Users group found.
Sys group found.
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
nobody => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
bin => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/group' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
daemon => 2
awk: cmd. line:1: fatal: cannot open fileQuoted 9 lines
`/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
users => 2
awk: cmd. line:1: fatal: cannot open file `/home/projects/xils/ltp-microblaze.git/nfs/etc/passwd' for reading (No such file or directory)
sys => 2
Required users/groups exist.
Quoted 6 lines
That's part of the reason why I wanted it to be reviewed before it was committed, and I halfway expected Mike to provide that assistance but he didn't... *sigh*.
Does the
/etc/passwd///etc/groupfile exist?
Of course not because I cross compile ltp for Microblaze - correct /etc/passwd - group is on
target system. Maybe worth to remove calling IDcheck.sh from make install and call it only before
running the test.
Michal
Quoted 3 lines
Thanks,
-Garrett
Signature · 15 lines
Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 7 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.
Michal,
Please give this patch a try, and instead when you run make
install, do SKIP_IDCHECK=1.
HTH,
-Garrett
This patch does the same as the previous released patch in this thread, which is:
IDcheck.sh:
1. Fixes the DESTDIR != "" | "/" behavior.
2. Spew out less awk errors if files don't exist by instead short-circuiting the logic to detect whether or not the file exists in the fe function subroutine.
In addition to the above, this adds SKIP_IDCHECK behavior, by request of Michal, so it's no longer required for make install, and can be disabled by entering specifying the variable SKIP_IDCHECK=1 when calling make install, e.g...
make \
[make-options-and-variables] \
SKIP_IDCHECK=1 \
install
Warning! This patch has Makefile changes and as such the files patched contents should be committed directly, NOT the inline text shown below (for reviewing purposes only).
Index: IDcheck.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/IDcheck.sh,v
retrieving revision 1.19
IDcheck.sh 9 Jul 2009 05:21:34 -0000 renamed from IDcheck.sh 7 Jul 2009 14:30:27 -0000 1.19 +0 -4
@@ -22,7 +22,6 @@ # # Prompt user if ids/groups should be created -clear echo "Checking for required user/group ids" echo ""
@@ -41,12 +40,11 @@ # find entry. fe() { - ID=$1; shift - FILE=$1; shift - awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 0; }
exit 1; }" \
- "$FILE"
- ec=$?
- echo "$ID => $ec"
+ ID=$1; shift
+ FILE=$1; shift
+ [ -e "$FILE" ] || return $?
+ awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 1; } exit 0; }" \
+ "$FILE"}
prompt_for_create() {
@@ -70,13 +68,12 @@
EUID=$(id -u)
fi
-if [ -e "$passwd" -a ! -r "$passwd" ] ; then
- echo "/etc/passwd not readable by uid $EUID"
+for i in "$passwd" "$group"; do
+ if [ -e "$i" -a ! -r "$i" ] ; then
+ echo "$i not readable by uid $EUID"
exit 1
-elif [ -e "$group" -a ! -r "$group" ] ; then
- echo "$group not readable by uid $EUID"
- exit 1
-fi
+ fi
+done
fe bin "$passwd"; NO_BIN_ID=$?
fe daemon "$passwd"; NO_DAEMON_ID=$?
@@ -110,10 +107,10 @@
#debug_vals
if [ $CREATE_ENTRIES -ne 0 ] ; then
- if ! touch "$group" ; then
- echo "Couldn't touch $group"
- exit 1
- fi
+ if ! touch "$group" "$passwd" 2>/dev/null; then
+ echo "Failed to touch $group or $passwd"
+ exit 1
+ fi
fi
make_user_group() {
Index: Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/Makefile,v
retrieving revision 1.39
Makefile 9 Jul 2009 05:27:34 -0000 renamed from Makefile 25 Mar 2009 06:17:48 -0000 1.39 +6 -1
@@ -14,6 +14,10 @@ export CFLAGS += -Wall $(CROSS_CFLAGS) export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA +# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute +# IDcheck.sh at the end of `make install'. +SKIP_IDCHECK ?= 0 + -include config.mk VPATH += include m4
@@ -36,8 +40,9 @@ @$(MAKE) -C m4 install @$(MAKE) -C doc/man1 install @$(MAKE) -C doc/man3 install - +ifneq ($(filter $(SKIP_IDCHECK)),1) @./IDcheck.sh +endif libltp.a: config.h @$(MAKE) -C lib $@
Index: IDcheck.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/IDcheck.sh,v
retrieving revision 1.19
IDcheck.sh +14 -17
@@ -22,7 +22,6 @@ # # Prompt user if ids/groups should be created -clear echo "Checking for required user/group ids" echo ""
@@ -41,12 +40,11 @@ # find entry. fe() { - ID=$1; shift - FILE=$1; shift - awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 0; } exit 1; }" \ - "$FILE" - ec=$? - echo "$ID => $ec" + ID=$1; shift + FILE=$1; shift + [ -e "$FILE" ] || return $? + awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 1; } exit 0; }" \ + "$FILE" } prompt_for_create() {
@@ -70,13 +68,12 @@ EUID=$(id -u) fi -if [ -e "$passwd" -a ! -r "$passwd" ] ; then - echo "/etc/passwd not readable by uid $EUID" +for i in "$passwd" "$group"; do + if [ -e "$i" -a ! -r "$i" ] ; then + echo "$i not readable by uid $EUID" exit 1 -elif [ -e "$group" -a ! -r "$group" ] ; then - echo "$group not readable by uid $EUID" - exit 1 -fi + fi +done fe bin "$passwd"; NO_BIN_ID=$? fe daemon "$passwd"; NO_DAEMON_ID=$?
@@ -110,10 +107,10 @@ #debug_vals if [ $CREATE_ENTRIES -ne 0 ] ; then - if ! touch "$group" ; then - echo "Couldn't touch $group" - exit 1 - fi + if ! touch "$group" "$passwd" 2>/dev/null; then + echo "Failed to touch $group or $passwd" + exit 1 + fi fi make_user_group() {
Index: Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/Makefile,v
retrieving revision 1.39
Makefile +6 -1
@@ -14,6 +14,10 @@ export CFLAGS += -Wall $(CROSS_CFLAGS) export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA +# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute +# IDcheck.sh at the end of `make install'. +SKIP_IDCHECK ?= 0 + -include config.mk VPATH += include m4
@@ -36,8 +40,9 @@ @$(MAKE) -C m4 install @$(MAKE) -C doc/man1 install @$(MAKE) -C doc/man3 install - +ifneq ($(filter $(SKIP_IDCHECK)),1) @./IDcheck.sh +endif libltp.a: config.h @$(MAKE) -C lib $@
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 30 lines · Garrett Cooper
Quoted 7 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.Michal,
Please give this patch a try, and instead when you run make
install, do SKIP_IDCHECK=1.
HTH,
-GarrettThis patch does the same as the previous released patch in this thread, which is:
IDcheck.sh:
1. Fixes the DESTDIR != "" | "/" behavior.
2. Spew out less awk errors if files don't exist by instead short-circuiting the logic to detect whether or not the file exists in the fe function subroutine.In addition to the above, this adds
SKIP_IDCHECKbehavior, by request of Michal, so it's no longer required for make install, and can be disabled by entering specifying the variable SKIP_IDCHECK=1 when calling make install, e.g...
Quoted 5 lines
make \
[make-options-and-variables] \
SKIP_IDCHECK=1 \
install
you should add SKIP_IDCHECK to uclinux_install too.
[monstr@monstr ltp-microblaze.git]$ make SKIP_IDCHECK=1 install Makefile:43: *** insufficient number of arguments (1) to function `filter'. Stop.
Michal
Quoted 104 lines
Warning! This patch has
Makefilechanges and as such the files patched contents should be committed directly, NOT the inline text shown below (for reviewing purposes only).Signed-off-by Garrett Cooper <[email protected]>Index:
IDcheck.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/IDcheck.sh,v
retrieving revision 1.19
diff -u -r1.19IDcheck.shIDcheck.sh 9 Jul 2009 05:21:34 -0000 renamed from IDcheck.sh 7 Jul 2009 14:30:27 -0000 1.19 +5
-7@@ -22,7 +22,6 @@ # # Prompt user if ids/groups should be created -clear echo "Checking for required user/group ids" echo ""@@ -41,12 +40,11 @@ # find entry. fe() { - ID=$1; shift - FILE=$1; shift - awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 0; } exit 1; }" \ - "$FILE" - ec=$? - echo "$ID => $ec" + ID=$1; shift + FILE=$1; shift + [ -e "$FILE" ] || return $? + awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 1; } exit 0; }" \ + "$FILE" }
prompt_for_create(){IDcheck.sh 9 Jul 2009 05:21:34 -0000 renamed from IDcheck.sh 7 Jul 2009 14:30:27 -0000 1.19 +9
-10@@ -70,13 +68,12 @@ EUID=$(id -u) fi -if [ -e "$passwd" -a ! -r "$passwd" ] ; then - echo "/etc/passwd not readable by uid $EUID" +for i in "$passwd" "$group"; do + if [ -e "$i" -a ! -r "$i" ] ; then + echo "$i not readable by uid $EUID" exit 1 -elif [ -e "$group" -a ! -r "$group" ] ; then - echo "$group not readable by uid $EUID" - exit 1 -fi + fi +done fe bin "$passwd"; NO_BIN_ID=$? fe daemon "$passwd"; NO_DAEMON_ID=$?@@ -110,10 +107,10 @@ #debug_vals if [ $CREATE_ENTRIES -ne 0 ] ; then - if ! touch "$group" ; then - echo "Couldn't touch $group" - exit 1 - fi + if ! touch "$group" "$passwd" 2>/dev/null; then + echo "Failed to touch $group or $passwd" + exit 1 + fi fi make_user_group() {Index:
Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/Makefile,v
retrieving revision 1.39
diff -u -r1.39MakefileMakefile 9 Jul 2009 05:27:34 -0000 renamed from Makefile 25 Mar 2009 06:17:48 -0000 1.39 +6
-1@@ -14,6 +14,10 @@ export CFLAGS += -Wall $(CROSS_CFLAGS) export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA +# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute +# IDcheck.sh at the end of `make install'. +SKIP_IDCHECK ?= 0 + -include config.mk VPATH += include m4@@ -36,8 +40,9 @@ @$(MAKE) -C m4 install @$(MAKE) -C doc/man1 install @$(MAKE) -C doc/man3 install - +ifneq ($(filter $(SKIP_IDCHECK)),1) @./IDcheck.sh +endif libltp.a: config.h @$(MAKE) -C lib $@
Signature · 15 lines
Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 11 lines · Michal Simek
Quoted 10 lines · Garrett Cooper
Quoted 7 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.
Quoted 5 lines
Quoted 5 lines
Michal,
Please give this patch a try, and instead when you run make install, do SKIP_IDCHECK=1.
HTH,
-Garrett
Wow. I must have been tired at the time; no idea why I used filter instead of strip. Please try this instead.
Index: IDcheck.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/IDcheck.sh,v
retrieving revision 1.19
IDcheck.sh +14 -17
@@ -22,7 +22,6 @@ # # Prompt user if ids/groups should be created -clear echo "Checking for required user/group ids" echo ""
@@ -41,12 +40,11 @@ # find entry. fe() { - ID=$1; shift - FILE=$1; shift - awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 0; } exit 1; }" \ - "$FILE" - ec=$? - echo "$ID => $ec" + ID=$1; shift + FILE=$1; shift + [ -e "$FILE" ] || return $? + awk "/^$ID:/ { FOUND=1 } END { if (\$FOUND == 1) { exit 1; } exit 0; }" \ + "$FILE" } prompt_for_create() {
@@ -70,13 +68,12 @@ EUID=$(id -u) fi -if [ -e "$passwd" -a ! -r "$passwd" ] ; then - echo "/etc/passwd not readable by uid $EUID" +for i in "$passwd" "$group"; do + if [ -e "$i" -a ! -r "$i" ] ; then + echo "$i not readable by uid $EUID" exit 1 -elif [ -e "$group" -a ! -r "$group" ] ; then - echo "$group not readable by uid $EUID" - exit 1 -fi + fi +done fe bin "$passwd"; NO_BIN_ID=$? fe daemon "$passwd"; NO_DAEMON_ID=$?
@@ -110,10 +107,10 @@ #debug_vals if [ $CREATE_ENTRIES -ne 0 ] ; then - if ! touch "$group" ; then - echo "Couldn't touch $group" - exit 1 - fi + if ! touch "$group" "$passwd" 2>/dev/null; then + echo "Failed to touch $group or $passwd" + exit 1 + fi fi make_user_group() {
Index: Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/Makefile,v
retrieving revision 1.39
Makefile +8 -1
@@ -14,6 +14,10 @@ export CFLAGS += -Wall $(CROSS_CFLAGS) export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA +# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute +# IDcheck.sh at the end of `make install'. +SKIP_IDCHECK ?= 0 + -include config.mk VPATH += include m4
@@ -36,8 +40,9 @@ @$(MAKE) -C m4 install @$(MAKE) -C doc/man1 install @$(MAKE) -C doc/man3 install - +ifneq ($(strip $(SKIP_IDCHECK)),1) @./IDcheck.sh +endif libltp.a: config.h @$(MAKE) -C lib $@
@@ -54,7 +59,9 @@ uclinux_install: uclinux @$(MAKE) -C testcases uclinux_install @$(MAKE) -C tools install +ifneq ($(strip $(SKIP_IDCHECK)),1) @./IDcheck.sh +endif uclinux_libltp.a: @$(MAKE) -C lib UCLINUX=1 libltp.a
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Michal Simek
Tested-byQuoted 22 lines · Garrett Cooper
Quoted 13 lines · Michal Simek
Quoted 11 lines · Garrett Cooper
Quoted 8 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.Quoted 6 lines
Quoted 6 lines
Michal,
Please give this patch a try, and instead when you run make
install, do SKIP_IDCHECK=1.
HTH,
-Garrett
Quoted 5 lines
Wow. I must have been tired at the time; no idea why I used filter instead of strip. Please try this instead.
Signed-off-by Garrett Cooper <[email protected]>
Sorry for delay.
Signature · 15 lines
Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 23 lines · Michal Simek
Quoted 22 lines · Garrett Cooper
Quoted 19 lines · Michal Simek
Quoted 17 lines · Garrett Cooper
Quoted 8 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.Michal,
Please give this patch a try, and instead when you run make install, do SKIP_IDCHECK=1.
HTH,
-Garrett
Quoted 8 lines
Quoted 5 lines
Wow. I must have been tired at the time; no idea why I used filter instead of strip. Please try this instead.
Signed-off-by Garrett Cooper <[email protected]>Sorry for delay.
Tested-by Michal Simek <[email protected]>
Subrata,
The fix for IDcheck.sh / the top-level Makefile is ready to be
committed to HEAD. Are we ok for commit?
Thanks,
-Garrett
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 30 lines · Garrett Cooper
Quoted 28 lines · Michal Simek
Quoted 27 lines · Garrett Cooper
Quoted 13 lines · Michal Simek
Quoted 11 lines · Garrett Cooper
Quoted 8 lines · Michal Simek
Of course not because I cross compile ltp for Microblaze - correct
/etc/passwd- group is on
target system. Maybe worth to remove callingIDcheck.shfrom make install and call it only before
running the test.Quoted 6 lines
Quoted 6 lines
Michal,
Please give this patch a try, and instead when you run make
install, do SKIP_IDCHECK=1.
HTH,
-GarrettWow. I must have been tired at the time; no idea why I used filter instead of strip. Please try this instead.
Signed-off-by Garrett Cooper <[email protected]>
Quoted 7 lines
Quoted 3 lines
Sorry for delay.
Tested-by Michal Simek <[email protected]>Subrata,
The fix forIDcheck.sh/ the top-levelMakefileis ready to be
committed to HEAD. Are we ok for commit?
Garrett,
Please go ahead. I am making for some final preparations for OLS 2009 ;-). Would you all be interested to see my paper:
http://www.linuxsymposium.org/2009/view_abstract.php?content_key=24,
http://www.linuxsymposium.org/2009/view_abstract.php?content_key=25,
Regards--
Subrata
Quoted 2 lines
Thanks,
-Garrett
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 18 lines · Subrata Modak
Quoted 9 lines · Garrett Cooper
Quoted 7 lines · Michal Simek
Quoted 6 lines · Garrett Cooper
Wow. I must have been tired at the time; no idea why I used filter instead of strip. Please try this instead.
Signed-off-by Garrett Cooper <[email protected]>Quoted 7 lines
Quoted 3 lines
Sorry for delay.
Tested-by Michal Simek <[email protected]>Subrata,
The fix forIDcheck.sh/ the top-levelMakefileis ready to be committed to HEAD. Are we ok for commit?
Quoted 7 lines
Garrett,
Please go ahead. I am making for some final preparations for OLS 2009 ;-). Would you all be interested to see my paper:
http://www.linuxsymposium.org/2009/view_abstract.php?content_key=24,
http://www.linuxsymposium.org/2009/view_abstract.php?content_key=25,
Committed.
Sure! Looks like an interesting read -- feel free to copy the glibc stuff that we found a few days ago as a reference if you like :}.
If you want me to check in my nose-based python unittests for IDcheck.sh, I can do that as well.
Thanks!
-Garrett
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list