瀏覽代碼

HUE-559. The setuid binary in the shell app should be in a build directory.

Aditya Acharya 14 年之前
父節點
當前提交
bdd3aca54f
共有 3 個文件被更改,包括 8 次插入4 次删除
  1. 1 1
      apps/shell/Makefile
  2. 6 2
      apps/shell/src/shell/Makefile
  3. 1 1
      apps/shell/src/shell/shellmanager.py

+ 1 - 1
apps/shell/Makefile

@@ -26,7 +26,7 @@ clean:: remove_setuid
 
 
 .PHONY: setuid
 .PHONY: setuid
 setuid:
 setuid:
-	make -C src/shell setuid
+	make -C src/shell
 
 
 .PHONY: remove_setuid
 .PHONY: remove_setuid
 remove_setuid:
 remove_setuid:

+ 6 - 2
apps/shell/src/shell/Makefile

@@ -16,10 +16,14 @@
 
 
 CC := gcc
 CC := gcc
 CFLAGS := -Werror -Wall
 CFLAGS := -Werror -Wall
+DESTDIR := build
 
 
-setuid: setuid.c
+default: $(DESTDIR)/setuid
+
+$(DESTDIR)/setuid: setuid.c
+	mkdir -p $(@D)
 	$(CC) $(CFLAGS) $< -o $@
 	$(CC) $(CFLAGS) $< -o $@
 	chmod 4711 $@
 	chmod 4711 $@
 
 
 clean:
 clean:
-	rm -f setuid
+	rm -rf $(DESTDIR)

+ 1 - 1
apps/shell/src/shell/shellmanager.py

@@ -43,7 +43,7 @@ from hadoop.cluster import all_mrclusters, get_all_hdfs
 
 
 LOG = logging.getLogger(__name__)
 LOG = logging.getLogger(__name__)
 
 
-_SETUID_PROG = os.path.join(os.path.dirname(__file__), 'setuid')
+_SETUID_PROG = os.path.join(os.path.dirname(__file__), 'build', 'setuid')
 
 
 class NewShellInterrupt(Exception):
 class NewShellInterrupt(Exception):
   """
   """