Fixed user key getting

pull/7/head
parent bce80395af
commit 5f70327ea7

@ -116,7 +116,6 @@ void on_load(){
config_str packs = yon_char_parse(parameter_string,&packsize," ");
GtkTreeIter packIter;
if (!packs){
printf("%s\n",get_saved_package_info_command(path,parameter_string));
FILE *file = popen(get_saved_package_info_command(path,parameter_string),"r");
char *cur_string=g_malloc0(sizeof(char)*4096);
char *packname=NULL, *packver=NULL, *packarch=NULL, *packdepends=NULL;
@ -133,7 +132,6 @@ void on_load(){
}
else
for (int j=0;j<packsize;j++){
printf("%s\n",get_saved_package_info_command(path,parameter_string));
char *command = get_saved_package_info_command(path,packs[j]);
FILE *file = popen(command,"r");
char *cur_string=g_malloc0(sizeof(char)*4096);
@ -268,7 +266,6 @@ void on_save(){
} char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL;
repo_sign_flagged=NULL;
char *sign_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged, sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" , " --sign-pkg ", dct->key, " -p ", signed_packs,NULL);
printf("%s\n",sign_command);
system(sign_command);
}
@ -330,7 +327,7 @@ void on_tree_selection_changed(GtkWidget *self,main_window *widgets){
gtk_label_set_text(GTK_LABEL(widgets->VersionInfoLabel),version ? version : "");
gtk_label_set_text(GTK_LABEL(widgets->ArchitectureInfoLabel),architecture ? architecture : "");
gtk_label_set_text(GTK_LABEL(widgets->DependencesInfoLabel),dependeces ? dependeces : "");
gtk_label_set_text(GTK_LABEL(widgets->SignatureInfoLabel),signature ? signature : "");
gtk_label_set_text(GTK_LABEL(widgets->SignatureInfoLabel),signature ? signature : ABSENT_LABEL);
int depth = gtk_tree_store_iter_depth(main_config.tree_store,&iter);
if (depth == 0){
gtk_widget_set_sensitive(widgets->CreateButton,1);
@ -338,7 +335,10 @@ void on_tree_selection_changed(GtkWidget *self,main_window *widgets){
gtk_widget_set_sensitive(widgets->ConfigureButton,1);
gtk_widget_set_sensitive(widgets->DeleteButton,1);
gtk_widget_set_sensitive(widgets->AddPackageButton,1);
gtk_widget_set_sensitive(widgets->RemovePackageButton,1);
gtk_widget_set_sensitive(widgets->RemovePackageButton,0);
// if (main_config.lock_root==1){
// gtk_widget_set_sensitive(widgets->SignButton,0);
// }
} else if (depth == 1){
gtk_widget_set_sensitive(widgets->CreateButton,1);
gtk_widget_set_sensitive(widgets->LoadFromLocalButton,1);
@ -346,6 +346,9 @@ void on_tree_selection_changed(GtkWidget *self,main_window *widgets){
gtk_widget_set_sensitive(widgets->DeleteButton,0);
gtk_widget_set_sensitive(widgets->AddPackageButton,1);
gtk_widget_set_sensitive(widgets->RemovePackageButton,1);
// if (main_config.lock_root==1){
// gtk_widget_set_sensitive(widgets->SignButton,0);
// }
}
}
}
@ -621,7 +624,6 @@ void yon_add_file(main_window *widgets){
char *cur_string=g_malloc0(sizeof(char)*4096);
char *packname=NULL, *packver=NULL, *packarch=NULL, *packdepends=NULL;
while (fgets(cur_string,4096,file)){
printf("%s\n",cur_string);
char *stringe = yon_char_divide_search(cur_string,"\n",-1);
char *p = yon_char_divide_search(stringe,":",-1);
if (strstr(p,"Name")) packname = yon_char_new(stringe);
@ -855,6 +857,7 @@ int main(int argc, char *argv[]){
main_config.lock_load_global=1;
main_config.lock_save_global=1;
main_config.lock_save_local=1;
main_config.lock_root=1;
}
gtk_init(&argc,&argv);
@ -875,6 +878,8 @@ int main(int argc, char *argv[]){
gtk_paned_set_position(GTK_PANED(widgets->MovePaned),400);
on_load();
// if (getuid()!=0)
// yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
GtkCssProvider *css=gtk_css_provider_new();
gtk_css_provider_load_from_resource(css,CssPath);
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),

@ -42,7 +42,7 @@ typedef char* string;
#define get_package_info_command(filename) yon_char_unite("LC_ALL=EN pacman -Q --info --file ",filename," |sed -e 's/ */ /g' -e 's/ : /:/g' -e 's/:/:/;s/\\n/ /g' -e 's/ *//g'",NULL)
#define get_saved_package_info_command(path,filename) yon_char_unite("LC_ALL=EN pacman -Q --info --file $(find \"",path,"\" -name *",filename,"* -not -name *.sig |head -n 1)|sed -e 's/ */ /g' -e 's/ : /:/g'",NULL)
#define get_gpg_keys_command yon_char_unite("su - ",yon_ubl_root_user_get()," -c \"gpg --list-signatures\" | grep '^sig 3' | cut -d' ' -f10,11,13- | sort -u |sed -e 's/[0-9]*-[0-9]*-[0-9]* //g'",NULL)
#define get_gpg_keys_command yon_char_unite(yon_ubl_check_root()==1 ? yon_char_unite("su - ",yon_ubl_root_user_get()," -c \"gpg --list-signatures\"",NULL):"","gpg --list-signatures | grep '^sig 3' | cut -d' ' -f10,11,13- | sort -u |sed -e 's/[0-9]*-[0-9]*-[0-9]* //g'",NULL)
string version_application;
@ -64,6 +64,7 @@ typedef struct {
int lock_save_local;
int lock_save_global;
int lock_load_global;
int lock_root;
} config;
typedef struct {

@ -1,6 +1,8 @@
#define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL)
#define HELP_LABEL yon_char_unite(_("ubl-settings-repomanager version:")," ", version_application,"\n",TITLE_LABEL,"\n",_("Usage:"), " ubl-settings-repomanager ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL)
#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
#define TITLE_LABEL _("Repository manager")
#define TITLE_INFO_LABEL _("Repository management and configuring")
#define SUCCESS_LABEL _("Operation succeeded")
@ -80,4 +82,6 @@
#define CHOOSE_PATH_LABEL _("Choose path for new repository")
#define ADD_REPO_LABEL _("Choose repository folder")
#define LOAD_REPO_LABEL _("Choose repository")
#define LOAD_REPO_LABEL _("Choose repository")
#define ABSENT_LABEL _("Absent")

@ -308,3 +308,7 @@ msgstr ""
#: source/ubl-strings.h:83
msgid "Choose repository"
msgstr ""
#: source/ubl-strings.h:85
msgid "Absent"
msgstr ""

@ -217,7 +217,7 @@ msgstr "Компоненты"
#: source/ubl-strings.h:55
msgid "Signature:"
msgstr "Подпись"
msgstr "Подпись:"
#: source/ubl-strings.h:57
msgid "Create repository"
@ -318,3 +318,7 @@ msgstr "Выбрать директорию для репозитория"
#, fuzzy
msgid "Choose repository"
msgstr "Выбрать репозиторий"
#: source/ubl-strings.h:85
msgid "Absent"
msgstr "Отсутствует"

Loading…
Cancel
Save